[brlcad-commits] SF.net SVN: brlcad:[43915] geomcore/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2011-03-22 17:02:39
|
Revision: 43915 http://brlcad.svn.sourceforge.net/brlcad/?rev=43915&view=rev Author: davidloman Date: 2011-03-22 17:02:32 +0000 (Tue, 22 Mar 2011) Log Message: ----------- Simplify DataManager by only allowing it to handle a single DataSource.... for now. Modified Paths: -------------- geomcore/trunk/include/DataManager.h geomcore/trunk/src/GS/DataManager.cxx Modified: geomcore/trunk/include/DataManager.h =================================================================== --- geomcore/trunk/include/DataManager.h 2011-03-22 16:56:54 UTC (rev 43914) +++ geomcore/trunk/include/DataManager.h 2011-03-22 17:02:32 UTC (rev 43915) @@ -48,16 +48,16 @@ std::string getDbObjectByURL(std::string url); std::string getDbObjectByUUID(GSUuid* uuid); - void addDataSource(IDataSource* source); + bool setDataSource(IDataSource* source); private: static DataManager* pInstance; DataManager(); Logger* log; - GSMutex sourceLock; - std::list<IDataSource*> datasources; + IDataSource* datasource; + void handleGeometryReqMsg(GeometryReqMsg* msg); void handleGeometryChunkMsg(GeometryChunkMsg* msg); Modified: geomcore/trunk/src/GS/DataManager.cxx =================================================================== --- geomcore/trunk/src/GS/DataManager.cxx 2011-03-22 16:56:54 UTC (rev 43914) +++ geomcore/trunk/src/GS/DataManager.cxx 2011-03-22 17:02:32 UTC (rev 43915) @@ -47,11 +47,13 @@ std::string DataManager::getDbObjectByUUID(GSUuid* uuid) {} -void -DataManager::addDataSource(IDataSource* source) +bool +DataManager::setDataSource(IDataSource* source) { - GSMutexLocker lock (&this->sourceLock); - this->datasources.push_back(source); + if (this->datasource != NULL) + return false; + + this->datasource = source; } bool @@ -106,10 +108,9 @@ //TODO remove hardcoded FileDataSource - if (this->datasources.size() > 0) { - IDataSource* ds = *this->datasources.begin(); + if (this->datasource != NULL) { - DbObject* obj = NULL; //ds->getByPath(data); + DbObject* obj = NULL; //this->datasource->getByPath(data); if (obj == NULL) { TypeOnlyMsg* tom = new TypeOnlyMsg(COULD_NOT_FIND_GEOMETRY, msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |