DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Public Attributes | List of all members
dd4hep::ObjectExtensions Class Reference

Implementation of an object supporting arbitrary user extensions. More...

#include <ObjectExtensions.h>

Inheritance diagram for dd4hep::ObjectExtensions:
dd4hep::cond::Manager_Type1 dd4hep::DetElementObject dd4hep::SensitiveDetectorObject dd4hep::sim::Geant4Event dd4hep::sim::Geant4Run dd4hep::WorldObject

Public Member Functions

 ObjectExtensions (const std::type_info &parent_type)
 Default constructor. More...
 
 ObjectExtensions (const ObjectExtensions &copy)=delete
 Copy constructor. More...
 
virtual ~ObjectExtensions ()
 Default destructor. More...
 
ObjectExtensionsoperator= (const ObjectExtensions &copy)=delete
 Assignment operator. More...
 
void initialize ()
 Initialize non-persistent object containers (e.g. after loading from ROOT file) More...
 
void move (ObjectExtensions &copy)
 Move extensions to target object. More...
 
void clear (bool destroy=true)
 Clear all extensions. More...
 
void copyFrom (const std::map< unsigned long long int, ExtensionEntry * > &ext, void *arg)
 Copy object extensions from another object. Hosting type must be identical! More...
 
void * addExtension (unsigned long long int key, ExtensionEntry *entry)
 Add an extension object to the detector element. More...
 
void * removeExtension (unsigned long long int key, bool destroy)
 Remove an existing extension object from the instance. More...
 
void * extension (unsigned long long int key, bool alert) const
 Access an existing extension object from the detector element. More...
 
void * extension (unsigned long long int key) const
 Access an existing extension object from the detector element. More...
 

Public Attributes

std::map< unsigned long long int, ExtensionEntry * > extensions
 The extensions object. More...
 

Detailed Description

Implementation of an object supporting arbitrary user extensions.

Usage by inheritance of the client supporting the functionality

Author
M.Frank
Version
1.0

Definition at line 33 of file ObjectExtensions.h.

Constructor & Destructor Documentation

◆ ObjectExtensions() [1/2]

ObjectExtensions::ObjectExtensions ( const std::type_info &  parent_type)

Default constructor.

Definition at line 32 of file ObjectExtensions.cpp.

◆ ObjectExtensions() [2/2]

dd4hep::ObjectExtensions::ObjectExtensions ( const ObjectExtensions copy)
delete

Copy constructor.

◆ ~ObjectExtensions()

ObjectExtensions::~ObjectExtensions ( )
virtual

Default destructor.

Definition at line 37 of file ObjectExtensions.cpp.

Member Function Documentation

◆ addExtension()

void * ObjectExtensions::addExtension ( unsigned long long int  key,
ExtensionEntry entry 
)

Add an extension object to the detector element.

Definition at line 67 of file ObjectExtensions.cpp.

◆ clear()

void ObjectExtensions::clear ( bool  destroy = true)

Clear all extensions.

Internal object destructor: release extension object(s)

Definition at line 49 of file ObjectExtensions.cpp.

◆ copyFrom()

void ObjectExtensions::copyFrom ( const std::map< unsigned long long int, ExtensionEntry * > &  ext,
void *  arg 
)

Copy object extensions from another object. Hosting type must be identical!

Copy object extensions from another object.

Definition at line 60 of file ObjectExtensions.cpp.

◆ extension() [1/2]

void * ObjectExtensions::extension ( unsigned long long int  key) const

Access an existing extension object from the detector element.

Definition at line 106 of file ObjectExtensions.cpp.

◆ extension() [2/2]

void * ObjectExtensions::extension ( unsigned long long int  key,
bool  alert 
) const

Access an existing extension object from the detector element.

Definition at line 119 of file ObjectExtensions.cpp.

◆ initialize()

void dd4hep::ObjectExtensions::initialize ( )

Initialize non-persistent object containers (e.g. after loading from ROOT file)

◆ move()

void ObjectExtensions::move ( ObjectExtensions copy)

Move extensions to target object.

Definition at line 43 of file ObjectExtensions.cpp.

◆ operator=()

ObjectExtensions& dd4hep::ObjectExtensions::operator= ( const ObjectExtensions copy)
delete

Assignment operator.

◆ removeExtension()

void * ObjectExtensions::removeExtension ( unsigned long long int  key,
bool  destroy 
)

Remove an existing extension object from the instance.

Definition at line 90 of file ObjectExtensions.cpp.

Member Data Documentation

◆ extensions

std::map<unsigned long long int, ExtensionEntry*> dd4hep::ObjectExtensions::extensions

The extensions object.

Definition at line 36 of file ObjectExtensions.h.


The documentation for this class was generated from the following files: