#include <class.h>
Inheritance diagram for zeitgeist::Class:
Public Types | |
typedef GCValue(* | TCmdProc )(Object *, const zeitgeist::ParameterList &in) |
defines a signature for a function used as the c++ implementation of a member function exported to a script language. | |
typedef std::list< std::string > | TStringList |
Public Member Functions | |
Class (const std::string &name) | |
constructs a class object for the class 'name' | |
virtual | ~Class () |
boost::shared_ptr< Object > | Create () |
creates a new instance of the represented class | |
boost::shared_ptr< Core > | GetCore () const |
returns a pointer to the core this class is attached to | |
void | SetBundle (const boost::shared_ptr< salt::SharedLibrary > &bundle) |
sets the bundle, this class was loaded from | |
TCmdProc | GetCmdProc (const std::string &functionName) const |
the command procedure for a function | |
const TStringList & | GetBaseClasses () const |
returns a list of base class names | |
bool | SupportsClass (const std::string &name) const |
returns true iff the class supports a given 'interface', i.e. | |
bool | SupportsCommand (const std::string &name) const |
returns true iff the class supports a given command, i.e. | |
Protected Member Functions | |
void | AttachInstance (const boost::weak_ptr< Object > &instance) |
adds an instance to the local list of instances | |
void | DetachInstance (const boost::weak_ptr< Object > &instance) |
removes an instance from the local list of instances | |
Protected Attributes | |
TCommandMap | mFunctions |
TStringList | mBaseClasses |
Private Types | |
typedef std::list< boost::weak_ptr< Object > > | TObjectList |
defines a list of pointers to object instances | |
typedef std::map< std::string, TCmdProc > | TCommandMap |
defines a mapping from member names to command procedures | |
Private Member Functions | |
Class (const Class &obj) | |
Class & | operator= (const Class &obj) |
virtual Object * | CreateInstance () const |
pure virtual function which creates instances | |
virtual void | DefineClass ()=0 |
pure virtual function which initializes the script callbacks and links to parent classes | |
void | AttachTo (const boost::weak_ptr< Core > &core) |
set the core, which this class belongs to | |
Private Attributes | |
boost::weak_ptr< Core > | mCore |
boost::shared_ptr< salt::SharedLibrary > | mBundle |
a shared pointer to the bundle, this class object came from. | |
TObjectList | mInstances |
a list of instances, which were created by this class object | |
Friends | |
class | Object |
class | Core |
Every class which wants to be managed by Zeitgeist will have to derive a class object from this class and override the factory method. Only decendants from Object are able to use Class properly and the factory method returns a Object pointer.
A Class object is characterized by several parameters:
A version is stored as an unsigned 32-bit integer, with each byte representing a version number. So ABCD would be A.B.C.D. That way a simple integer comparison can be used for newer version queries.
Class objects also are the key to providing Zeitgeist with a plugin interface. The Core is responsible for managing all Class objects it knows. It is possible to export Class objects from a shared library through a unified interface, therefore enabling Class objects to be added at runtime to the Core.
Definition at line 135 of file class.h.
|
defines a signature for a function used as the c++ implementation of a member function exported to a script language. It receives a pointer to an instance of the class from which it is a member function along with a list of paramters. |
|
defines a mapping from member names to command procedures
|
|
defines a list of pointers to object instances
|
|
|
|
constructs a class object for the class 'name'
|
|
Definition at line 35 of file class.cpp. References mInstances. |
|
|
|
adds an instance to the local list of instances
Definition at line 91 of file class.cpp. References mInstances. Referenced by Create(). |
|
set the core, which this class belongs to
Definition at line 124 of file class.cpp. References mCore. |
|
creates a new instance of the represented class
Definition at line 58 of file class.cpp. References AttachInstance(), CreateInstance(), and zeitgeist::Object::GetSelf(). Here is the call graph for this function: ![]() |
|
pure virtual function which creates instances
Reimplemented in zeitgeist::Class_Leaf, zeitgeist::Class_LogServer, zeitgeist::Class_Node, and zeitgeist::Class_Object. Definition at line 119 of file class.cpp. Referenced by Create(). |
|
pure virtual function which initializes the script callbacks and links to parent classes
Implemented in zeitgeist::Class_Class, zeitgeist::Class_Leaf, zeitgeist::Class_LogServer, zeitgeist::Class_Node, and zeitgeist::Class_Object. |
|
removes an instance from the local list of instances
Definition at line 96 of file class.cpp. References mInstances. |
|
returns a list of base class names
Definition at line 176 of file class.cpp. References mBaseClasses. |
|
the command procedure for a function
Definition at line 134 of file class.cpp. References GetCore(), mBaseClasses, and mFunctions. Referenced by SupportsCommand(). Here is the call graph for this function: ![]() |
|
returns a pointer to the core this class is attached to
Reimplemented from zeitgeist::Object. Definition at line 79 of file class.cpp. References zeitgeist::Leaf::GetName(), and mCore. Referenced by GetCmdProc(), and SupportsClass(). Here is the call graph for this function: ![]() |
|
|
|
sets the bundle, this class was loaded from
Definition at line 129 of file class.cpp. References mBundle. |
|
returns true iff the class supports a given 'interface', i.e. the base class hierarchy contains the class 'name' Definition at line 186 of file class.cpp. References GetCore(), zeitgeist::Leaf::GetName(), and mBaseClasses. Here is the call graph for this function: ![]() |
|
returns true iff the class supports a given command, i.e. to this class or to one of its base classes the given command procedure is registered Definition at line 181 of file class.cpp. References GetCmdProc(). Here is the call graph for this function: ![]() |
|
|
|
|
|
Definition at line 224 of file class.h. Referenced by GetBaseClasses(), GetCmdProc(), and SupportsClass(). |
|
a shared pointer to the bundle, this class object came from. So, if all references to the class object are deleted, the shared library will be freed. Definition at line 232 of file class.h. Referenced by SetBundle(). |
|
Definition at line 226 of file class.h. Referenced by AttachTo(), and GetCore(). |
|
Definition at line 223 of file class.h. Referenced by GetCmdProc(). |
|
a list of instances, which were created by this class object
Definition at line 235 of file class.h. Referenced by AttachInstance(), DetachInstance(), and ~Class(). |