MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ClassProxy Class Reference

The class proxy assures that the pointer to the class object is always valid. More...

#include <factory/Class.h>

Public Member Functions

 ClassProxy ()
 
 ClassProxy (ClassProxy const &other)
 
bool operator== (ClassProxy const &other) const
 
bool operator!= (ClassProxy const &other) const
 
bool operator< (ClassProxy const &other) const
 
std::string const & getIdentifier () const
 Return identifier for the class. More...
 
std::string const & getName () const
 Return name of the class. More...
 
int getTypeId () const
 Return unique id for the class. More...
 
Typename getTypename () const
 Returns the platform independent C++ typename of the class. More...
 
std::map< std::string,
std::string > const & 
getMetaInfo () const
 Return map with meta information. More...
 
std::string const & getMetaInfo (const std::string &meta) const
 Returns meta information for the given meta key. More...
 
ObjectnewInstance () const
 Return a new instance of the class associated with the class object. More...
 
template<class CLASS >
CLASS * newInstance () const
 Return a new instance of the class associated with the class object. More...
 
ObjectnewInstance (int paramCount,...) const
 Return a new instance of the class associated with the class object. More...
 
ObjectnewInstance (std::string const &childIdentifier) const
 Return a new instance of the child class with the given identifier. More...
 
template<class CLASS >
CLASS * newInstance (std::string const &childIdentifier) const
 Return a new instance of the child class with the given identifier. More...
 
ObjectnewInstance (std::string const &childIdentifier, int paramCount,...) const
 Return a new instance of the child class with the given identifier. More...
 
bool isClassRegistered (std::string const &classIdentifier) const
 Return true if a class with the desired identifier is registered. More...
 
void eraseChild (Class const *const iClass)
 Remove the given child class from the class. More...
 
void eraseParent (Class const *const iClass)
 Remove the given class from the list of parents. More...
 
ClassProxy getClassByIdentifier (std::string const &classIdentifier) const
 Return the Class object for the desired Class. More...
 
std::vector< ClassProxygetClassByMeta (std::string const &metaKey, std::string const &metaValue) const
 Return vector of Class objects matching the meta criterion. More...
 
template<class T >
std::vector< ClassProxygetClassByMeta (T funcPtr) const
 Return vector of Class objects returning true for the given. More...
 
std::map< std::string, ClassProxygetDerivedClasses () const
 Return registered children for the associated class to the given map. More...
 
std::map< std::string, ClassProxygetDirectParents () const
 Return map with the direct parents of this class. More...
 
bool isBaseOf (Class const *const derived) const
 Return true if given class is registered and derived from this class. More...
 
bool isBaseOf (ClassProxy derived) const
 Return true if given class is registered and derived from this class. More...
 
bool isBaseOf (std::string const &identifier) const
 Return true if given class is registered and derived from this class. More...
 
bool isDerivedFrom (Class const *const base) const
 Return true if given class is registered and parent of this class. More...
 
bool isDerivedFrom (ClassProxy base) const
 Return true if given class is registered and parent of this class. More...
 
bool isDirectlyDerivedFrom (Class const *const base) const
 Return true if the given class is a direct parent. More...
 
bool isDirectlyDerivedFrom (ClassProxy base) const
 Return true if the given class is a direct parent. More...
 
bool isAbstract () const
 Return true if the associated class is abstract. More...
 
bool isLibraryLoaded () const
 Return true if the library which contains the associated class is loaded. More...
 

Protected Member Functions

ObjectnewVAInstance (int paramCount, std::va_list list) const
 
 ClassProxy (boost::shared_ptr< Class > *iClass)
 
void setClass (boost::shared_ptr< Class > *iClass)
 

Protected Attributes

boost::shared_ptr< Class > * mClass
 
boost::recursive_mutex * mThreadMutex
 

Friends

class ClassFactory
 
class VacantClass
 
class Class
 
template<typename CLASS >
class TClass
 

Detailed Description

The class proxy assures that the pointer to the class object is always valid.

This class supports the transparent change of a vacant class to a TClass object. Furthermore, it is necessary for thread-safe access.

Constructor & Destructor Documentation

ClassProxy ( )
inline
ClassProxy ( ClassProxy const &  other)
inline
ClassProxy ( boost::shared_ptr< Class > *  iClass)
protected

Member Function Documentation

bool operator== ( ClassProxy const &  other) const
inline
bool operator!= ( ClassProxy const &  other) const
inline
bool operator< ( ClassProxy const &  other) const
inline
std::string const& getIdentifier ( ) const

Return identifier for the class.

See Also
mira::Class::getIdentifier()
std::string const& getName ( ) const

Return name of the class.

See Also
mira::Class::getName()
int getTypeId ( ) const

Return unique id for the class.

See Also
mira::Class::getTypeId()
Typename getTypename ( ) const

Returns the platform independent C++ typename of the class.

See Also
mira::Class::getTypename()
std::map<std::string, std::string> const& getMetaInfo ( ) const

Return map with meta information.

See Also
mira::Class::getMetaInfo()
std::string const& getMetaInfo ( const std::string &  meta) const

Returns meta information for the given meta key.

See Also
mira::Class::getMetaInfo( meta )
Object* newInstance ( ) const

Return a new instance of the class associated with the class object.

See Also
mira::Class::newInstance()
CLASS* newInstance ( ) const
inline

Return a new instance of the class associated with the class object.

See Also
mira::Class::newInstance()
Object* newInstance ( int  paramCount,
  ... 
) const

Return a new instance of the class associated with the class object.

See Also
mira::Class::newInstance()
Object* newInstance ( std::string const &  childIdentifier) const

Return a new instance of the child class with the given identifier.

See Also
mira::Class::newInstance()
CLASS* newInstance ( std::string const &  childIdentifier) const
inline

Return a new instance of the child class with the given identifier.

See Also
mira::Class::newInstance( std::string const& )
Object* newInstance ( std::string const &  childIdentifier,
int  paramCount,
  ... 
) const

Return a new instance of the child class with the given identifier.

See Also
mira::Class::newInstance( std::string const&, int, ... )
bool isClassRegistered ( std::string const &  classIdentifier) const

Return true if a class with the desired identifier is registered.

See Also
mira::Class::isClassRegistered()
void eraseChild ( Class const *const  iClass)

Remove the given child class from the class.

Calls eraseChild on all parents and removed the given class from its own child list.

void eraseParent ( Class const *const  iClass)

Remove the given class from the list of parents.

Calls eraseParent on all children and removes the given class from its own parent list.

ClassProxy getClassByIdentifier ( std::string const &  classIdentifier) const

Return the Class object for the desired Class.

See Also
mira::Class::getClassByIdentifier( classIdentifier )
std::vector<ClassProxy> getClassByMeta ( std::string const &  metaKey,
std::string const &  metaValue 
) const

Return vector of Class objects matching the meta criterion.

See Also
mira::Class::getClassByMeta( std::string const&, std::string const& )
std::vector<ClassProxy> getClassByMeta ( funcPtr) const
inline

Return vector of Class objects returning true for the given.

See Also
mira::Class::getClassByMeta()
std::map<std::string, ClassProxy > getDerivedClasses ( ) const

Return registered children for the associated class to the given map.

See Also
mira::Class::getDerivedClasses()
std::map<std::string, ClassProxy > getDirectParents ( ) const

Return map with the direct parents of this class.

See Also
mira::Class::getDirectParents()
bool isBaseOf ( Class const *const  derived) const

Return true if given class is registered and derived from this class.

See Also
mira::Class::isBaseOf( Class const* const )
bool isBaseOf ( ClassProxy  derived) const

Return true if given class is registered and derived from this class.

See Also
mira::Class::isBaseOf( ClassProxy )
bool isBaseOf ( std::string const &  identifier) const

Return true if given class is registered and derived from this class.

See Also
mira::Class::isBaseOf( std::string const& )
bool isDerivedFrom ( Class const *const  base) const

Return true if given class is registered and parent of this class.

See Also
mira::Class:isDerivedFrom( Class const* const )
bool isDerivedFrom ( ClassProxy  base) const

Return true if given class is registered and parent of this class.

See Also
mira::Class::isDerivedFrom( ClassProxy )
bool isDirectlyDerivedFrom ( Class const *const  base) const

Return true if the given class is a direct parent.

See Also
mira::Class::isDirectlyDerivedFrom( Class const* const )
bool isDirectlyDerivedFrom ( ClassProxy  base) const

Return true if the given class is a direct parent.

See Also
mira::Class::isDirectlyDerivedFrom( ClassProxy )
bool isAbstract ( ) const

Return true if the associated class is abstract.

bool isLibraryLoaded ( ) const

Return true if the library which contains the associated class is loaded.

TClass classes will return true and Vacant class classes will return false.

Object* newVAInstance ( int  paramCount,
std::va_list  list 
) const
protected
void setClass ( boost::shared_ptr< Class > *  iClass)
protected

Friends And Related Function Documentation

friend class ClassFactory
friend
friend class VacantClass
friend
friend class Class
friend
friend class TClass
friend

Member Data Documentation

boost::shared_ptr<Class>* mClass
protected
boost::recursive_mutex* mThreadMutex
protected

The documentation for this class was generated from the following file: