Exemplo n.º 1
0
void OMFile::registerFactory( OMStoredObjectFactory* factory )
{
  TRACE("OMFile::registerFactory");

  PRECONDITION("Valid factory", factory != 0);

  OMStoredObjectEncoding encoding = factory->encoding();
  PRECONDITION("Unique encoding", !hasFactory(encoding));
  PRECONDITION("Unique name", !hasFactory(factory->name()));

  _factory->insert(encoding, factory);

  factory->initialize();
}
void ossimPlanetNodeRegistry::registerFactory(ossimPlanetNodeFactoryBase* factory,
																	bool insertFrontFlag)
{
	if(!hasFactory(factory))
	{
      theFactoryListMutex.writeLock();
		if(!insertFrontFlag)
		{
			theFactoryList.push_back(factory);
		}
		else
		{
			theFactoryList.insert(theFactoryList.begin(),
										 factory);
		}
      theFactoryListMutex.writeUnlock();
	}
}