Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

VideoSet* Impala::Persistency::VideoSetRepositoryInMonet::Get ( const Locator loc  )  [inline]

Definition at line 25 of file VideoSetRepositoryInMonet.h.

References Impala::Core::Database::RawDataSet::AddFile(), Impala::FileNameBase(), Impala::Persistency::RepositoryInMonetDB::GetConnection(), Impala::Persistency::Locator::GetDataSet(), Impala::Persistency::Locator::GetProtocolAndHost(), Impala::Core::VideoSet::VideoSet::GetQuidVideo(), ILOG_ERROR, Impala::QuidId(), RepMonet(), and Impala::Core::Database::RawDataSet::SetProtocolAndHost().

00026     {
00027         Connection* conn = RepMonet().GetConnection(loc);
00028 
00029         String vidSetBase = FileNameBase(loc.GetDataSet());
00030         String query =
00031             "select f.filename, f.quid \
00032              from   file f, video_set vs, video_sets vss \
00033              where  vss.set_name = '" + vidSetBase + "' and \
00034                     vs.video_sets_id = vss.video_sets_id and \
00035                     f.file_id = vs.file_id \
00036              order by f.quid;";
00037 
00038         MapiHdl hdl = conn->QueryPartStart(query);
00039         if (hdl == 0)
00040             return 0;
00041 
00042         std::vector<String> fName;
00043         if (!conn->QueryPartFetchString(hdl, 0, fName))
00044             return 0;
00045 
00046         Quid* quid = 0;
00047         int quidSize = 0;
00048         if (!conn->QueryPartFetchULL(hdl, 1, quid, quidSize))
00049             return 0;
00050 
00051         conn->QueryPartEnd(hdl);
00052 
00053         VideoSet* vidSet = new VideoSet(loc.GetDataSet());
00054         vidSet->SetProtocolAndHost(loc.GetProtocolAndHost());
00055         for (int i=0 ; i<fName.size() ; i++)
00056         {
00057             int fileId = QuidId(quid[i]);
00058             vidSet->AddFile(fName[i], fileId);
00059             if (vidSet->GetQuidVideo(i, true) != quid[i])
00060                 ILOG_ERROR("Quid " << i << " doesn't match");
00061         }
00062         delete quid;
00063         return vidSet;
00064     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:23:55 2011 for ImpalaSrc by  doxygen 1.5.1