BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
BALL::Embeddable Class Reference

#include <BALL/CONCEPT/embeddable.h>

Inheritance diagram for BALL::Embeddable:
BALL::Peptides::NameConverter BALL::VIEW::DatasetController BALL::VIEW::MainControl BALL::VIEW::ModularWidget BALL::VIEW::ShortcutRegistry BALL::VIEW::DockResultController BALL::VIEW::RaytraceableGridController BALL::VIEW::RegularData3DController BALL::VIEW::TrajectoryController BALL::VIEW::VectorGridController BALL::Mainframe BALL::VIEW::AssignBondOrderConfigurationDialog BALL::VIEW::AssignBondOrderResultsDialog BALL::VIEW::DemoTutorialDialog BALL::VIEW::DisplayProperties BALL::VIEW::DockingController BALL::VIEW::DockWidget BALL::VIEW::DownloadElectronDensity BALL::VIEW::DownloadPDBFile BALL::VIEW::EditOperationDialog BALL::VIEW::FDPBDialog BALL::VIEW::LabelDialog BALL::VIEW::ModifyRepresentationDialog BALL::VIEW::MolecularFileDialog BALL::VIEW::MolecularStructure BALL::VIEW::OpenBruker1DFile BALL::VIEW::OpenBruker2DFile BALL::VIEW::PluginDialog BALL::VIEW::PubChemDialog BALL::VIEW::RaytraceableContourSurfaceDialog BALL::VIEW::RegularData1DWidget BALL::VIEW::RegularData2DWidget BALL::VIEW::Scene BALL::VIEW::ServerWidget BALL::VIEW::ShortcutDialog BALL::VIEW::SnapshotVisualisationDialog BALL::VIEW::StereoSettingsDialog BALL::VIEW::TestFramework BALL::VIEW::UndoManagerDialog

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 StringgetIdentifier () 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 EmbeddablegetInstance_ (const std::type_info &type, Position index)
 
static EmbeddablegetInstance_ (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_
 

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

Definition at line 88 of file embeddable.h.

Constructor & Destructor Documentation

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

Default constructor

BALL::Embeddable::Embeddable ( const Embeddable embeddable)

Copy constructor

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

Member Function Documentation

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

Return the number of instances of a certain type

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
soutput stream where to output the state
depththe 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

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

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

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

static void BALL::Embeddable::registerInstance_ ( const std::type_info &  type,
const Embeddable instance 
)
staticprotected
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
void BALL::Embeddable::setIdentifier ( const String identifier)

Return the instance identifier

static void BALL::Embeddable::unregisterInstance_ ( const Embeddable instance)
staticprotected
void BALL::Embeddable::unregisterThis ( )

Unregister the instance.

Member Data Documentation

String BALL::Embeddable::identifier_
private

An identifier for the class

Definition at line 183 of file embeddable.h.

HashMap<Embeddable*, string> BALL::Embeddable::instance_to_type_map_
staticprivate

A hash map to retrieve the class ID for each instance.

Definition at line 191 of file embeddable.h.

StringHashMap<EmbeddableVector> BALL::Embeddable::instance_vectors_
staticprivate

The instance vectors

Definition at line 187 of file embeddable.h.