Jpp test-rotations-old
the software that should make you happy
|
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys. More...
#include <JManager.hh>
Public Types | |
typedef JPointer< JValue_t > | ptr_type |
typedef std::map< JKey_t, ptr_type > | map_type |
Public Member Functions | |
JManager () | |
Default constructor. | |
JManager (JValue_t *master, char wildcard='%', JFormat_t format=JFormat_t()) | |
Constructor. | |
JManager (JValue_t *master, const std::string &name, char wildcard='%', std::ios::fmtflags format=std::ios::fmtflags()) | |
Constructor. | |
JManager (const JManager &manager) | |
Copy constructor. | |
void | clear () |
Clear client objects. | |
JValue_t * | operator[] (JKey_t key) |
Get pointer to object for given key. | |
void | Read (TDirectory &in) |
Read objects from file. | |
void | Write (TDirectory &out, const bool wm=false) |
Write objects to file. | |
void | Write (const char *file_name, const bool wm=false) |
Write objects to file. | |
virtual JClass_t * | get () const override |
Get pointer. | |
virtual void | set (JClass_t *p) override |
Set pointer. | |
template<class T > | |
void | set (const JPointer< T > &pointer) |
Set pointer. | |
virtual void | reset () override |
Reset pointer. | |
template<class T > | |
void | reset (const JPointer< T > &pointer) |
Reset pointer. | |
void | reset (JClass_t *p) |
Reset pointer. | |
JClass_t *const & | getReference () const |
Get rereference to internal pointer. | |
JClass_t *& | getReference () |
Get rereference to internal pointer. | |
virtual bool | equals (const JAbstractPointer &object) const |
Equals. | |
bool | is_valid () const |
Check validity of pointer. | |
JClass_t * | operator-> () const |
Smart pointer operator. | |
operator JClass_t * () const | |
Type conversion operator. | |
Static Public Member Functions | |
static JManager | Read (TDirectory &in, const char *const master, const char wildcard) |
Read objects from file into manager. | |
Public Attributes | |
char | wc |
JFormat_t | fmt |
Protected Attributes | |
JClass_t * | __p |
pointer to object | |
Static Private Member Functions | |
static void | detach (...) |
Fall back for detaching object pointed to from ROOT I/O. | |
static void | detach (TH1 *p) |
Implementation for detaching of object pointed to from ROOT I/O. | |
Friends | |
TFile & | operator>> (TFile &file, JManager &object) |
Read manager from file. | |
TFile & | operator<< (TFile &file, JManager &object) |
Write manager to file. | |
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
For each use of the map operator []
, it is checked whether the corresponding client object exists.
If the corresponding client object does not yet exists, a clone is made of the master object (i.e. the 'client').
The name of the newly created object is derived from the name of the master object by replacing the wild card character with the value of the key according the optional format specifier.
Definition at line 44 of file JManager.hh.
JPointer<JValue_t> JROOT::JManager< JKey_t, JValue_t >::ptr_type |
Definition at line 50 of file JManager.hh.
std::map<JKey_t, ptr_type> JROOT::JManager< JKey_t, JValue_t >::map_type |
Definition at line 51 of file JManager.hh.
|
inline |
|
inline |
Constructor.
Note that the manager owns the master object pointed to.
For saving the objects to file, use method JManager::Write (all objects are detached from the current ROOT directory).
master | master object |
wildcard | wild card character |
format | format specifier for replacement of wildcard character by value of key |
Definition at line 71 of file JManager.hh.
|
inline |
Constructor.
Note that the manager owns the master object pointed to.
For saving the objects to file, use method JManager::Write (all objects are detached from the current ROOT directory).
master | master object |
name | name of master |
wildcard | wild card character |
format | format specifier for replacement of wildcard character by value of key |
Definition at line 108 of file JManager.hh.
|
inline |
Copy constructor.
Note that the master object of the given manager is cloned and the wildcard copied.
The client objects are not copied.
manager | manager |
Definition at line 144 of file JManager.hh.
|
inline |
Clear client objects.
Definition at line 166 of file JManager.hh.
|
inline |
Get pointer to object for given key.
key | key |
Definition at line 182 of file JManager.hh.
|
inlinestatic |
Read objects from file into manager.
in | input file or directory |
master | master name |
wildcard | wild card character |
Definition at line 227 of file JManager.hh.
|
inline |
Read objects from file.
in | input file or directory |
Definition at line 287 of file JManager.hh.
|
inline |
Write objects to file.
out | output file or directory |
wm | write master |
Definition at line 304 of file JManager.hh.
|
inline |
Write objects to file.
file_name | file name |
wm | write master |
Definition at line 322 of file JManager.hh.
|
inlinestaticprivate |
Fall back for detaching object pointed to from ROOT I/O.
Definition at line 369 of file JManager.hh.
|
inlinestaticprivate |
Implementation for detaching of object pointed to from ROOT I/O.
p | pointer to object |
Definition at line 378 of file JManager.hh.
|
inlineoverridevirtualinherited |
Get pointer.
Implements JLANG::JAbstractPointer< JClass_t >.
Reimplemented in JLANG::JMultiPointer< JClass_t >, JLANG::JMultiPointer< JHead_t >, JLANG::JMultiPointer< JTail_t >, JLANG::JMultiPointer< JTypeList< JDAQEvent, JNullType > >, JLANG::JMultiPointer< JTypeList< JHead_t, JTail_t > >, and JLANG::JMultiPointer< T >.
Definition at line 64 of file JPointer.hh.
|
inlineoverridevirtualinherited |
Set pointer.
p | pointer to object |
Implements JLANG::JAbstractPointer< JClass_t >.
Reimplemented in JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< Evt > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JDAQSummaryslice > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JHead_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTail_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTypeList< JDAQEvent, JNullType > > >, JLANG::JSharedPointer< JAccessibleObjectIterator< KM3NETDAQ::JDAQEvent > >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< JObjectOutput< JHead_t > >, JLANG::JSharedPointer< JObjectOutput< JTail_t > >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JRadiation >, JLANG::JSharedPointer< JRewindableObjectIterator< const event_type > >, JLANG::JSharedPointer< JRewindableObjectIterator< JHead_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JTail_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< JTRIGGER::JMatch >, and JLANG::JSharedPointer< match_type >.
Definition at line 75 of file JPointer.hh.
|
inlineinherited |
|
inlineoverridevirtualinherited |
Reset pointer.
Implements JLANG::JAbstractPointer< JClass_t >.
Reimplemented in JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< Evt > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JDAQSummaryslice > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JHead_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTail_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTypeList< JDAQEvent, JNullType > > >, JLANG::JSharedPointer< JAccessibleObjectIterator< KM3NETDAQ::JDAQEvent > >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< JObjectOutput< JHead_t > >, JLANG::JSharedPointer< JObjectOutput< JTail_t > >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JRadiation >, JLANG::JSharedPointer< JRewindableObjectIterator< const event_type > >, JLANG::JSharedPointer< JRewindableObjectIterator< JHead_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JTail_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< match_type >, JLANG::JStorage< JClass_t, JMemory_t >, JLANG::JStorage< JAbstractAutoPointer< JBase_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< Evt >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JDAQSummaryslice >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JHead_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JTail_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JTypeList< JDAQEvent, JNullType > >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< KM3NETDAQ::JDAQEvent >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< T >, JNew >, JLANG::JStorage< JAccessibleObjectOutput< T >, JNew >, JLANG::JStorage< JBase_t, JNew >, JLANG::JStorage< JClass_t, JNew >, JLANG::JStorage< JDETECTOR::JCLBDefaultSimulatorInterface::JStateMachine, JNew >, JLANG::JStorage< JDETECTOR::JCLBDefaultSimulatorInterface::JTDC, JNew >, JLANG::JStorage< JDETECTOR::JCLBSimulator, JNew >, JLANG::JStorage< JDETECTOR::JK40Simulator, JNew >, JLANG::JStorage< JDETECTOR::JModuleRouter, JNew >, JLANG::JStorage< JDETECTOR::JPMTSimulator, JNew >, JLANG::JStorage< JFIT::JMEstimator, JNew >, JLANG::JStorage< JIO::JReader, JNew >, JLANG::JStorage< JIO::JWriter, JNew >, JLANG::JStorage< JLANG::JMultiPipe< T, N >, JNew >, JLANG::JStorage< JLOGGER::JLogger, JNew >, JLANG::JStorage< JNET::JControlHost, JNew >, JLANG::JStorage< JNET::JControlHostObjectOutput, JNew >, JLANG::JStorage< JNET::JServerSocket, JNew >, JLANG::JStorage< JObjectIterator< T >, JNew >, JLANG::JStorage< JObjectOutput< JHead_t >, JNew >, JLANG::JStorage< JObjectOutput< JTail_t >, JNew >, JLANG::JStorage< JObjectOutput< T >, JNew >, JLANG::JStorage< JParserElementInterface, JNew >, JLANG::JStorage< JPropertiesElementInterface, JNew >, JLANG::JStorage< JRadiation, JNew >, JLANG::JStorage< JRewindableObjectIterator< const event_type >, JNew >, JLANG::JStorage< JRewindableObjectIterator< JHead_t >, JNew >, JLANG::JStorage< JRewindableObjectIterator< JTail_t >, JNew >, JLANG::JStorage< JRewindableObjectIterator< T >, JNew >, JLANG::JStorage< JTOOLS::JFunction1D, JNew >, JLANG::JStorage< JTOOLS::JMultiMapTransformer, JNew >, JLANG::JStorage< JTRIGGER::JBuildL1, JNew >, JLANG::JStorage< JTRIGGER::JBuildL2, JNew >, JLANG::JStorage< JTRIGGER::JDAQHitSelector, JNew >, JLANG::JStorage< JTRIGGER::JMatch, JNew >, JLANG::JStorage< JTRIGGER::JTimesliceRouter, JNew >, JLANG::JStorage< JTRIGGER::JTrigger3DMuon, JNew >, JLANG::JStorage< JTRIGGER::JTrigger3DShower, JNew >, JLANG::JStorage< JTRIGGER::JTriggerMXShower, JNew >, JLANG::JStorage< JTRIGGER::JTriggerNB, JNew >, JLANG::JStorage< match_type, JNew >, and JLANG::JStorage< TFile >.
Definition at line 84 of file JPointer.hh.
|
inlineinherited |
Reset pointer.
pointer | pointer to object |
Definition at line 108 of file JPointer.hh.
|
inlineinherited |
Reset pointer.
p | pointer to object |
Definition at line 94 of file JAbstractPointer.hh.
|
inlineinherited |
Get rereference to internal pointer.
Definition at line 119 of file JPointer.hh.
|
inlineinherited |
Get rereference to internal pointer.
Definition at line 130 of file JPointer.hh.
|
inlinevirtualinherited |
Equals.
The equality is evaluated by comparison of the internal pointers.
object | abstract pointer |
Definition at line 50 of file JAbstractPointer.hh.
|
inlineinherited |
Check validity of pointer.
Definition at line 83 of file JAbstractPointer.hh.
|
inlineinherited |
Smart pointer operator.
Definition at line 112 of file JAbstractPointer.hh.
|
inlineinherited |
Type conversion operator.
Definition at line 126 of file JAbstractPointer.hh.
|
friend |
Read manager from file.
file | file |
object | manager |
Definition at line 340 of file JManager.hh.
|
friend |
Write manager to file.
file | file |
object | manager |
Definition at line 355 of file JManager.hh.
char JROOT::JManager< JKey_t, JValue_t >::wc |
Definition at line 362 of file JManager.hh.
JFormat_t JROOT::JManager< JKey_t, JValue_t >::fmt |
Definition at line 363 of file JManager.hh.
|
protectedinherited |
pointer to object
Definition at line 136 of file JPointer.hh.