Definition at line 28 of file RepositoryInMonetDB.h.
References Impala::atol(), Impala::FileNameBase(), Impala::Persistency::Locator::GetDataSet(), Impala::Persistency::Locator::GetHost(), ILOG_ERROR, ILOG_INFO, mMap, and Impala::Persistency::Locator::ToString().
Referenced by Impala::Persistency::VideoSetRepositoryInMonet::Add(), Impala::Persistency::SegmentationRepositoryInMonet::Add(), Impala::Persistency::KeywordListRepositoryInMonet::Add(), Impala::Persistency::KeyframesRepositoryInMonet::Add(), Impala::Persistency::ImageArchiveRepositoryInMonet::Add(), Impala::Persistency::FeatureTableRepositoryInMonet::Add(), Impala::Persistency::AnnotationTableRepositoryInMonet::Add(), Impala::Persistency::VideoSetsRepository::CopyToMonetDB(), Impala::Persistency::VideoSetRepositoryInMonet::Get(), Impala::Persistency::SimilarityTableSetRepositoryInMonet::Get(), Impala::Persistency::SegmentationRepositoryInMonet::Get(), Impala::Persistency::KeywordListRepositoryInMonet::Get(), Impala::Persistency::KeyframesRepositoryInMonet::Get(), Impala::Persistency::ImageArchiveRepositoryInMonet::Get(), Impala::Persistency::FeatureTableRepositoryInMonet::Get(), Impala::Persistency::AnnotationTableRepositoryInMonet::Get(), Impala::Persistency::VideoSetsRepository::GetFromMonetDB(), Impala::Persistency::SimilarityTableSetRepositoryInMonet::LoadSim(), and Impala::Persistency::SimilarityTableSetRepositoryInMonet::SaveSim().
00029 {
00030 Connection* conn = 0;
00031 if (mMap.Get(loc.ToString(), conn))
00032 return conn;
00033
00034 StringList sl(loc.GetHost(), ':');
00035 std::cout << "list size = " << sl.size() << std::endl;
00036 StringListCI it = sl.begin();
00037 if (it == sl.end())
00038 {
00039 ILOG_ERROR("Missing host specification for mapi");
00040 return 0;
00041 }
00042
00043 String host = *it++;
00044 if (it == sl.end())
00045 {
00046 ILOG_ERROR("Missing port specification for mapi");
00047 return 0;
00048 }
00049
00050 int port = atol(*it++);
00051 String setName = loc.GetDataSet();
00052 String db = (it == sl.end()) ? FileNameBase(setName) : *it;
00053 ILOG_INFO("Mapi connection to " << host << ":" << port << ":" << db);
00054 conn = new Connection(host, port, db);
00055 if (!conn->Valid())
00056 {
00057 ILOG_ERROR("Failed to set up connection to " << host << ":" <<
00058 port << ":" << db);
00059 delete conn;
00060 return 0;
00061 }
00062
00063 mMap.Add(loc.ToString(), conn);
00064 return conn;
00065 }
Here is the call graph for this function: