MIRA
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() [1/3]

ClassProxy ( )
inline

◆ ClassProxy() [2/3]

ClassProxy ( ClassProxy const &  other)
inline

◆ ClassProxy() [3/3]

ClassProxy ( boost::shared_ptr< Class > *  iClass)
protected

Member Function Documentation

◆ operator==()

bool operator== ( ClassProxy const &  other) const
inline

◆ operator!=()

bool operator!= ( ClassProxy const &  other) const
inline

◆ operator<()

bool operator< ( ClassProxy const &  other) const
inline

◆ getIdentifier()

std::string const& getIdentifier ( ) const

Return identifier for the class.

See also
mira::Class::getIdentifier()

◆ getName()

std::string const& getName ( ) const

Return name of the class.

See also
mira::Class::getName()

◆ getTypeId()

int getTypeId ( ) const

Return unique id for the class.

See also
mira::Class::getTypeId()

◆ getTypename()

Typename getTypename ( ) const

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

See also
mira::Class::getTypename()

◆ getMetaInfo() [1/2]

std::map<std::string, std::string> const& getMetaInfo ( ) const

Return map with meta information.

See also
mira::Class::getMetaInfo()

◆ getMetaInfo() [2/2]

std::string const& getMetaInfo ( const std::string &  meta) const

Returns meta information for the given meta key.

See also
mira::Class::getMetaInfo( meta )

◆ newInstance() [1/6]

Object* newInstance ( ) const

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

See also
mira::Class::newInstance()

◆ newInstance() [2/6]

CLASS* newInstance ( ) const
inline

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

See also
mira::Class::newInstance()

◆ newInstance() [3/6]

Object* newInstance ( int  paramCount,
  ... 
) const

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

See also
mira::Class::newInstance()

◆ newInstance() [4/6]

Object* newInstance ( std::string const &  childIdentifier) const

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

See also
mira::Class::newInstance()

◆ newInstance() [5/6]

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& )

◆ newInstance() [6/6]

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, ... )

◆ isClassRegistered()

bool isClassRegistered ( std::string const &  classIdentifier) const

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

See also
mira::Class::isClassRegistered()

◆ eraseChild()

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.

◆ eraseParent()

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.

◆ getClassByIdentifier()

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

Return the Class object for the desired Class.

See also
mira::Class::getClassByIdentifier( classIdentifier )

◆ getClassByMeta() [1/2]

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& )

◆ getClassByMeta() [2/2]

std::vector<ClassProxy> getClassByMeta ( funcPtr) const
inline

Return vector of Class objects returning true for the given.

See also
mira::Class::getClassByMeta()

◆ getDerivedClasses()

std::map<std::string, ClassProxy > getDerivedClasses ( ) const

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

See also
mira::Class::getDerivedClasses()

◆ getDirectParents()

std::map<std::string, ClassProxy > getDirectParents ( ) const

Return map with the direct parents of this class.

See also
mira::Class::getDirectParents()

◆ isBaseOf() [1/3]

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 )

◆ isBaseOf() [2/3]

bool isBaseOf ( ClassProxy  derived) const

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

See also
mira::Class::isBaseOf( ClassProxy )

◆ isBaseOf() [3/3]

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& )

◆ isDerivedFrom() [1/2]

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 )

◆ isDerivedFrom() [2/2]

bool isDerivedFrom ( ClassProxy  base) const

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

See also
mira::Class::isDerivedFrom( ClassProxy )

◆ isDirectlyDerivedFrom() [1/2]

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 )

◆ isDirectlyDerivedFrom() [2/2]

bool isDirectlyDerivedFrom ( ClassProxy  base) const

Return true if the given class is a direct parent.

See also
mira::Class::isDirectlyDerivedFrom( ClassProxy )

◆ isAbstract()

bool isAbstract ( ) const

Return true if the associated class is abstract.

◆ isLibraryLoaded()

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.

◆ newVAInstance()

Object* newVAInstance ( int  paramCount,
std::va_list  list 
) const
protected

◆ setClass()

void setClass ( boost::shared_ptr< Class > *  iClass)
protected

Friends And Related Function Documentation

◆ ClassFactory

friend class ClassFactory
friend

◆ VacantClass

friend class VacantClass
friend

◆ Class

friend class Class
friend

◆ TClass

friend class TClass
friend

Member Data Documentation

◆ mClass

boost::shared_ptr<Class>* mClass
protected

◆ mThreadMutex

boost::recursive_mutex* mThreadMutex
protected

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