BALL
1.4.2
|
#include <BALL/CONCEPT/embeddable.h>
Public Types | |
Type definitions | |
typedef std::vector< Embeddable * > | EmbeddableVector |
Public Member Functions | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Constructors and Destructors | |
Embeddable (const String &identifier="<Embeddable>") | |
Embeddable (const Embeddable &embeddable) | |
virtual | ~Embeddable () |
Accessors | |
void | setIdentifier (const String &identifier) |
const String & | getIdentifier () const |
void | unregisterThis () |
virtual void | registerThis () |
Static Protected Member Functions | |
static void | registerInstance_ (const std::type_info &type, const Embeddable *instance) |
static void | unregisterInstance_ (const Embeddable *instance) |
static Size | countInstances_ (const std::type_info &type) |
static Embeddable * | getInstance_ (const std::type_info &type, Position index) |
static Embeddable * | getInstance_ (const std::type_info &type, const String &identifier) |
Private Attributes | |
String | identifier_ |
Static Private Attributes | |
static StringHashMap < EmbeddableVector > | instance_vectors_ |
static HashMap< Embeddable *, string > | instance_to_type_map_ |
Python Embedding Base Class. This class defines a common interface for all classes that have to be accessible from an embedded Python interpreter. Each instance of a class derived from embeddable can be registered by calling registerThis() of the instance and is then accessible through the static methods of the class (e.g. getInstance).
Definition at line 81 of file embeddable.h.
typedef std::vector<Embeddable*> BALL::Embeddable::EmbeddableVector |
Definition at line 88 of file embeddable.h.
BALL::Embeddable::Embeddable | ( | const String & | identifier = "<Embeddable>" | ) |
Default constructor
BALL::Embeddable::Embeddable | ( | const Embeddable & | embeddable | ) |
Copy constructor
|
virtual |
|
staticprotected |
Return the number of instances of a certain type
|
virtual |
Internal value dump. Dump the current state to the output ostream s with dumping depth depth.
s | output stream where to output the state |
depth | the dumping depth |
Reimplemented in BALL::VIEW::MainControl, BALL::VIEW::Scene, BALL::VIEW::ModularWidget, BALL::VIEW::ServerWidget, and BALL::VIEW::PyWidget.
const String& BALL::Embeddable::getIdentifier | ( | ) | const |
Assign a new identifier
|
staticprotected |
Return an instance of a registered type by its index. If the index is out of bounds or the position is invalid, a null pointer is returned
|
staticprotected |
Return an instance of a registered type by its identifier. If the identifier does not exist, a null pointer is returned
|
staticprotected |
|
virtual |
Register the instance. DO NOT IMPLEMENT THIS METHOD! It is automatically implemented correctly when putting the BALL_EMBEDDABLE macro in a class definition.
void BALL::Embeddable::setIdentifier | ( | const String & | identifier | ) |
Return the instance identifier
|
staticprotected |
void BALL::Embeddable::unregisterThis | ( | ) |
Unregister the instance.
|
private |
An identifier for the class
Definition at line 183 of file embeddable.h.
|
staticprivate |
A hash map to retrieve the class ID for each instance.
Definition at line 191 of file embeddable.h.
|
staticprivate |
The instance vectors
Definition at line 187 of file embeddable.h.