CMS 3D CMS Logo

IgPluginFactoryBase Class Reference

Abstract base class to bridge IgManager and IgPluginFactory. More...

#include <Iguana/Framework/interface/IgPluginFactoryBase.h>

Inheritance diagram for IgPluginFactoryBase:

IgPluginFactory< I > IgPluginFactory< IgBrowser *(IgState *state, IgSite *host)> IgPluginFactory< IgDriver *(IgState *state)> IgPluginFactory< IgExtension *(IgState *state)> IgPluginFactory< IgFileProxy *(void)> IgPluginFactory< IgSite *(IgState *state, IgSite *parent)> IgPluginFactory< IgView *(IgPage *)> IgPluginFactory< IgWebService *(IgState *)> IgPluginFactoryImplBase< Types > IgPluginFactoryImplBase< IgPluginFactoryImplTypes< Proto > > IgPluginFactoryImplBase< IgPluginFactoryImplTypes< R * > > IgPluginFactoryImplBase< IgPluginFactoryImplTypes< void > >

List of all members.

Public Member Functions

virtual void addInfo (IgPluginInfo *info)=0
const std::string & category (void) const
 IgPluginFactoryBase (const std::string &tag)
virtual void removeInfo (IgPluginInfo *info)=0
virtual void restore (IgModule *module, IgModuleDescriptor *info)=0
virtual ~IgPluginFactoryBase (void)

Protected Member Functions

virtual void rebuild (void)

Private Member Functions

 IgPluginFactoryBase (const IgPluginFactoryBase &)
IgPluginFactoryBaseoperator= (const IgPluginFactoryBase &)

Private Attributes

std::string m_tag


Detailed Description

Abstract base class to bridge IgManager and IgPluginFactory.

Definition at line 22 of file IgPluginFactoryBase.h.


Constructor & Destructor Documentation

IgPluginFactoryBase::IgPluginFactoryBase ( const std::string &  tag  ) 

Definition at line 20 of file IgPluginFactoryBase.cc.

References IgPluginManager::addFactory(), ASSERT, IgPluginManager::get(), and m_tag.

00021     : m_tag (tag)
00022 {
00023     ASSERT (IgPluginManager::get ());
00024     ASSERT (! m_tag.empty ());
00025     IgPluginManager::get ()->addFactory (this);
00026 }

IgPluginFactoryBase::~IgPluginFactoryBase ( void   )  [virtual]

Definition at line 28 of file IgPluginFactoryBase.cc.

References ASSERT, IgPluginManager::get(), m_tag, and IgPluginManager::removeFactory().

00029 {
00030     ASSERT (IgPluginManager::get ());
00031     ASSERT (! m_tag.empty ());
00032     IgPluginManager::get ()->removeFactory (this);
00033 }

IgPluginFactoryBase::IgPluginFactoryBase ( const IgPluginFactoryBase  )  [private]


Member Function Documentation

virtual void IgPluginFactoryBase::addInfo ( IgPluginInfo info  )  [pure virtual]

Implemented in IgPluginFactoryImplBase< Types >, IgPluginFactory< I >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< Proto > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< R * > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< void > >, IgPluginFactory< IgExtension *(IgState *state)>, IgPluginFactory< IgBrowser *(IgState *state, IgSite *host)>, IgPluginFactory< IgFileProxy *(void)>, IgPluginFactory< IgSite *(IgState *state, IgSite *parent)>, IgPluginFactory< IgView *(IgPage *)>, IgPluginFactory< IgDriver *(IgState *state)>, and IgPluginFactory< IgWebService *(IgState *)>.

Referenced by IgPluginManager::addInfo().

const std::string & IgPluginFactoryBase::category ( void   )  const

Definition at line 36 of file IgPluginFactoryBase.cc.

References m_tag.

Referenced by IgPluginFactoryImplBase< Types >::declare(), rebuild(), and IgPluginFactoryImplBase< Types >::restore().

00037 { return m_tag; }

IgPluginFactoryBase& IgPluginFactoryBase::operator= ( const IgPluginFactoryBase  )  [private]

void IgPluginFactoryBase::rebuild ( void   )  [protected, virtual]

Reimplemented in IgPluginFactoryImplBase< Types >, IgPluginFactory< I >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< Proto > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< R * > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< void > >, IgPluginFactory< IgExtension *(IgState *state)>, IgPluginFactory< IgBrowser *(IgState *state, IgSite *host)>, IgPluginFactory< IgFileProxy *(void)>, IgPluginFactory< IgSite *(IgState *state, IgSite *parent)>, IgPluginFactory< IgView *(IgPage *)>, IgPluginFactory< IgDriver *(IgState *state)>, and IgPluginFactory< IgWebService *(IgState *)>.

Definition at line 40 of file IgPluginFactoryBase.cc.

References IgPluginManager::beginDirectories(), category(), IgModuleDescriptor::child(), IgModuleDescriptor::children(), archive::db, dir, IgPluginManager::endDirectories(), IgPluginManager::get(), i, restore(), and IgModuleDescriptor::token().

Referenced by IgPluginFactoryImplBase< Types >::rebuild().

00041 {
00042     IgPluginManager                     *db = IgPluginManager::get ();
00043     IgPluginManager::DirectoryIterator  dir;
00044     IgModuleCache::Iterator             module;
00045     IgModuleDescriptor                  *cache;
00046     unsigned                            i;
00047 
00048     // The modules cannot have infos already cached that we need to
00049     // avoid recreating.  This is because the infos can be created
00050     // only in one of two ways, and in either case the factory knows
00051     // *and* has already cleared out those infos in the derived
00052     // rebuild() before invoking us.  Infos restored from the cache
00053     // are managed by the factory, and thus the known and already
00054     // deleted.  When infos are created via the factory's describe()
00055     // method, the factory must already exist and thus the infos are
00056     // automatically registered (and thus already deleted).  The
00057     // latter is because the factory must be in the same library as the
00058     // one invoking describe(), or one of its dependents; either way
00059     // since the factory is a global object, it has been constructed (the
00060     // query happens after global constructors).
00061     //
00062     // Which brings us back to the point: there cannot be infos we
00063     // care about at this point.  As we start, the derived factory has no
00064     // infos (guaranteed by derived rebuild()), so the only infos that
00065     // exist are those we create here below.
00066     for (dir = db->beginDirectories (); dir != db->endDirectories (); ++dir)
00067         for (module = (*dir)->begin (); module != (*dir)->end (); ++module)
00068             for (cache=(*module)->cacheRoot(), i=0; i < cache->children(); ++i)
00069                 if (cache->child (i)->token (0) == category ())
00070                     restore (*module, cache->child (i));
00071 }

virtual void IgPluginFactoryBase::removeInfo ( IgPluginInfo info  )  [pure virtual]

Implemented in IgPluginFactoryImplBase< Types >, IgPluginFactory< I >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< Proto > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< R * > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< void > >, IgPluginFactory< IgExtension *(IgState *state)>, IgPluginFactory< IgBrowser *(IgState *state, IgSite *host)>, IgPluginFactory< IgFileProxy *(void)>, IgPluginFactory< IgSite *(IgState *state, IgSite *parent)>, IgPluginFactory< IgView *(IgPage *)>, IgPluginFactory< IgDriver *(IgState *state)>, and IgPluginFactory< IgWebService *(IgState *)>.

Referenced by IgPluginManager::removeInfo().

virtual void IgPluginFactoryBase::restore ( IgModule module,
IgModuleDescriptor info 
) [pure virtual]

Implemented in IgPluginFactoryImplBase< Types >, IgPluginFactory< I >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< Proto > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< R * > >, IgPluginFactoryImplBase< IgPluginFactoryImplTypes< void > >, IgPluginFactory< IgExtension *(IgState *state)>, IgPluginFactory< IgBrowser *(IgState *state, IgSite *host)>, IgPluginFactory< IgFileProxy *(void)>, IgPluginFactory< IgSite *(IgState *state, IgSite *parent)>, IgPluginFactory< IgView *(IgPage *)>, IgPluginFactory< IgDriver *(IgState *state)>, and IgPluginFactory< IgWebService *(IgState *)>.

Referenced by rebuild().


Member Data Documentation

std::string IgPluginFactoryBase::m_tag [private]

Definition at line 41 of file IgPluginFactoryBase.h.

Referenced by category(), IgPluginFactoryBase(), and ~IgPluginFactoryBase().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:20 2009 for CMSSW by  doxygen 1.5.4