Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SOME::ClassCatalog Class Reference

ClassCatalog is used to provide information about classes in the plugin library to the application using it. More...

#include <SOMEClassCatalog.h>

List of all members.

Public Types

typedef void* (* ConstructFunc )()

Public Methods

 ClassCatalog (const std::string& classname, const std::string& the_category, ConstructFunc def = NULL, ConstructFunc one = NULL, ConstructFunc two = NULL)
void addCategory ( std::string key, std::string value )
 adds extra class info for programs to use to their advantage. More...

std::map< std::string, std::string > getProperties ()
 a programmer may want to examin contents of the class_properties. More...

std::string getCategory (std::string key)
bool infoEquals ( std::string key, std::string value )
 support method that returns true if the given key in class_properties equals the given value. More...

const std::string& getClassName ()
const std::string& getCategory ()
 The category is a "guaranteed" property of the class. More...

ConstructFunc getCtor0 () const
ConstructFunc getCtor1 () const
ConstructFunc getCtor2 () const
template<classBaseClass> BaseClass* construct ()
 Calls the default constructor for the plugin class returns a pointer to the object. More...

template<classBaseClass> void deduce_construct (BaseClass** dest_ptr)
 Calls the default constructor for the plugin class and puts the object into a pointer passed in. More...

template<classBaseClass, typenameParamType1> BaseClass* construct (ParamType1& a)
 Calls the one parameter constructor for the plugin class returns a pointer to the object. More...

template<classBaseClass, typenameParamType1, typenameParamType2> BaseClass* construct (ParamType1& a, ParamType2& b)
 Calls the two parameter constructor for the plugin class returns a pointer to the object. More...


Detailed Description

ClassCatalog is used to provide information about classes in the plugin library to the application using it.

This information has little direct value to the user, and is usually just used to instantiate plugin objects by SOMEObj. However, you do have the option to get a shared_ptr from SOME::ClassCatalog to bypass the SOMEObj altogether using the construct function

Definition at line 42 of file SOMEClassCatalog.h.


Constructor & Destructor Documentation

SOME::ClassCatalog::ClassCatalog ( const std::string & classname,
const std::string & the_category,
ConstructFunc def = NULL,
ConstructFunc one = NULL,
ConstructFunc two = NULL )
 

Definition at line 47 of file SOMEClassCatalog.h.


Member Function Documentation

void SOME::ClassCatalog::addCategory ( std::string key,
std::string value ) [inline]
 

adds extra class info for programs to use to their advantage.

Definition at line 62 of file SOMEClassCatalog.h.

template<classBaseClass, typenameParamType1, typenameParamType2>
BaseClass * SOME::ClassCatalog::construct ( ParamType1 & a,
ParamType2 & b ) [inline]
 

Calls the two parameter constructor for the plugin class returns a pointer to the object.

This object is dynamically allocated, so must be delete'd. We strongly recommend the use of a automatic deletion class such as std::auto_ptr or boost::shared_ptr (http://www.boost.org) you must provide the BaseClass upon calling construct as so: BaseClass* plug = class_properties.construct<BaseClass>() If the construction function does not exist or fails, the return will contain a NULL pointer

Definition at line 199 of file SOMEClassCatalog.h.

template<classBaseClass, typenameParamType1>
BaseClass * SOME::ClassCatalog::construct ( ParamType1 & a ) [inline]
 

Calls the one parameter constructor for the plugin class returns a pointer to the object.

This object is dynamically allocated, so must be delete'd. We strongly recommend the use of a automatic deletion class such as std::auto_ptr or boost::shared_ptr (http://www.boost.org) you must provide the BaseClass upon calling construct as so: BaseClass* plug = class_properties.construct<BaseClass>() If the construction function does not exist or fails, the return will contain a NULL pointer

Definition at line 175 of file SOMEClassCatalog.h.

template<classBaseClass>
BaseClass * SOME::ClassCatalog::construct ( ) [inline]
 

Calls the default constructor for the plugin class returns a pointer to the object.

This object is dynamically allocated, so must be delete'd. We strongly recommend the use of a automatic deletion class such as std::auto_ptr or boost::shared_ptr (http://www.boost.org) You must provide the BaseClass upon calling construct as so: BaseClass plug = class_properties.construct<BaseClass>() If the construction function does not exist or fails, the return will contain a NULL pointer

Definition at line 130 of file SOMEClassCatalog.h.

template<classBaseClass>
void SOME::ClassCatalog::deduce_construct ( BaseClass ** dest_ptr ) [inline]
 

Calls the default constructor for the plugin class and puts the object into a pointer passed in.

This object is dynamically allocated, so must be delete'd. We strongly recommend the use of a automatic deletion class such as std::auto_ptr or boost::shared_ptr (http://www.boost.org) This function was created because MSVC wouldn't work with construct If the construction function does not exist or fails, the shared_ptr will contain a NULL pointer

Definition at line 152 of file SOMEClassCatalog.h.

const std::string & SOME::ClassCatalog::getCategory ( ) [inline]
 

The category is a "guaranteed" property of the class.

Definition at line 99 of file SOMEClassCatalog.h.

std::string SOME::ClassCatalog::getCategory ( std::string key ) [inline]
 

Definition at line 78 of file SOMEClassCatalog.h.

const std::string & SOME::ClassCatalog::getClassName ( ) [inline]
 

Definition at line 94 of file SOMEClassCatalog.h.

ConstructFunc SOME::ClassCatalog::getCtor0 ( ) const [inline]
 

Definition at line 103 of file SOMEClassCatalog.h.

ConstructFunc SOME::ClassCatalog::getCtor1 ( ) const [inline]
 

Definition at line 107 of file SOMEClassCatalog.h.

ConstructFunc SOME::ClassCatalog::getCtor2 ( ) const [inline]
 

Definition at line 111 of file SOMEClassCatalog.h.

std::map< std::string,std::string > SOME::ClassCatalog::getProperties ( ) [inline]
 

a programmer may want to examin contents of the class_properties.

Definition at line 70 of file SOMEClassCatalog.h.

bool SOME::ClassCatalog::infoEquals ( std::string key,
std::string value ) [inline]
 

support method that returns true if the given key in class_properties equals the given value.

Definition at line 87 of file SOMEClassCatalog.h.


The documentation for this class was generated from the following file:
Generated at Fri Dec 8 14:24:48 2000 for SOMELib by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000