Loading...
Searching...
No Matches
BALL::Embeddable Class Reference
Foundation Classes » Concepts » Miscellaneous

`#include <BALL/CONCEPT/embeddable.h>`

Inheritance diagram for BALL::Embeddable:

## Public Types

Type definitions
typedef std::vector< Embeddable * > | EmbeddableVector

## Public Member Functions

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 ()
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
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)

## Detailed Description

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

See also
  PyInterpreter
  MainControl
  ModularWidget

Definition at line 81 of file embeddable.h.

## Member Typedef Documentation

## EmbeddableVector

typedef std::vector<Embeddable*> BALL::Embeddable::EmbeddableVector

Definition at line 88 of file embeddable.h.

## Constructor & Destructor Documentation

## Embeddable() [1/2]

BALL::Embeddable::Embeddable | ( | const String & | identifier = "<Embeddable>" | ) |

Default constructor

## Embeddable() [2/2]

BALL::Embeddable::Embeddable | ( | const Embeddable & | embeddable | ) |

Copy constructor

## ~Embeddable()

virtual BALL::Embeddable::~Embeddable | ( |  | ) |

virtual

## Member Function Documentation

## countInstances_()

Size BALL::Embeddable::countInstances_ | ( | const std::type_info & | type | ) |

static protected

Return the number of instances of a certain type

## dump()

virtual void BALL::Embeddable::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Internal value dump. Dump the current state to the output ostream s with dumping depth depth.

Parameters

  s | output stream where to output the state
  depth | the dumping depth

Reimplemented in BALL::VIEW::MainControl, BALL::VIEW::ModularWidget, BALL::VIEW::PyWidget, BALL::VIEW::Scene, and BALL::VIEW::ServerWidget.

## getIdentifier()

const String & BALL::Embeddable::getIdentifier | ( |  | ) | const

Assign a new identifier

## getInstance_() [1/2]

Embeddable * BALL::Embeddable::getInstance_ | ( | const std::type_info & | type,
|  | const String & | identifier )

static protected

Return an instance of a registered type by its identifier. If the identifier does not exist, a null pointer is returned

## getInstance_() [2/2]

Embeddable * BALL::Embeddable::getInstance_ | ( | const std::type_info & | type,
|  | Position | index )

static protected

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

## registerInstance_()

void BALL::Embeddable::registerInstance_ | ( | const std::type_info & | type,
|  | const Embeddable * | instance )

static protected

## registerThis()

virtual void BALL::Embeddable::registerThis | ( |  | ) |

virtual

Register the instance. DO NOT IMPLEMENT THIS METHOD! It is automatically implemented correctly when putting the BALL_EMBEDDABLE macro in a class definition.

See also
  getInstanceVector

## setIdentifier()

void BALL::Embeddable::setIdentifier | ( | const String & | identifier | ) |

Return the instance identifier

## unregisterInstance_()

void BALL::Embeddable::unregisterInstance_ | ( | const Embeddable * | instance | ) |

static protected

## unregisterThis()

void BALL::Embeddable::unregisterThis | ( |  | ) |

Unregister the instance.