Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Embeddable Class Reference
[Miscellaneous]

Python Embedding Base Class. More...

#include <embeddable.h>

Inheritance diagram for Embeddable:

VIEW::DatasetController VIEW::MainControl VIEW::ModularWidget VIEW::DockResultController VIEW::RegularData3DController VIEW::TrajectoryController VIEW::VectorGridController VIEW::DisplayProperties VIEW::DockingController VIEW::DockWidget VIEW::DownloadPDBFile VIEW::EditOperationDialog VIEW::FDPBDialog VIEW::LabelDialog VIEW::ModifyRepresentationDialog VIEW::MolecularFileDialog VIEW::MolecularStructure VIEW::OpenBruker1DFile VIEW::OpenBruker2DFile VIEW::PubChemDialog VIEW::RegularData1DWidget VIEW::RegularData2DWidget VIEW::Scene VIEW::Server VIEW::SnapshotVisualisationDialog VIEW::TestFramework List of all members.

Public Types

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

Public Member Functions

virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal value dump.
Constructors and Destructors
 Embeddable (const String &identifier="<Embeddable>") throw ()
 Default constructor.
 Embeddable (const Embeddable &embeddable) throw ()
 Copy constructor.
Accessors
void setIdentifier (const String &identifier) throw ()
 Return the instance identifier.
const StringgetIdentifier () const throw ()
 Assign a new identifier.
void unregisterThis () throw ()
 Unregister the instance.
virtual void registerThis () throw ()
 Register the instance.

Static Protected Member Functions

void registerInstance_ (const std::type_info &type, const Embeddable *instance) throw ()
void unregisterInstance_ (const Embeddable *instance) throw ()
Size countInstances_ (const std::type_info &type) throw ()
 Return the number of instances of a certain type.
EmbeddablegetInstance_ (const std::type_info &type, Position index) throw ()
 Return an instance of a registered type by its index.
EmbeddablegetInstance_ (const std::type_info &type, const String &identifier) throw ()
 Return an instance of a registered type by its 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


Member Function Documentation

virtual void Embeddable::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw () [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 VIEW::MainControl, VIEW::ModularWidget, VIEW::Server, VIEW::PyWidget, and VIEW::Scene.

Embeddable* Embeddable::getInstance_ const std::type_info &  type,
const String identifier
throw () [static, protected]
 

Return an instance of a registered type by its identifier.

If the identifier does not exist, a null pointer is returned

Embeddable* Embeddable::getInstance_ const std::type_info &  type,
Position  index
throw () [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

virtual void Embeddable::registerThis  )  throw () [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

void Embeddable::unregisterThis  )  throw ()
 

Unregister the instance.