Belle II Software  release-08-01-10
DBImportObjPtr< T > Class Template Reference

Class for importing a single object to the database. More...

#include <DBImportObjPtr.h>

Inheritance diagram for DBImportObjPtr< T >:
Collaboration diagram for DBImportObjPtr< T >:

Public Member Functions

 DBImportObjPtr (const std::string &name="")
 Constructor: the object itself is not allocated here, but in construct(...) function. More...
 
 ~DBImportObjPtr ()
 Destructor.
 
template<class ... Args>
void construct (Args &&... params)
 Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
 
T * operator-> () const
 Imitate pointer functionality.
 
const std::string & getName () const
 Returns the name under which the object will be stored in the database. More...
 
virtual void addEventDependency (unsigned int eventNumber)
 add event dependency More...
 
virtual void addTimeStampDependency (unsigned long long int timeStamp)
 add time stamp dependency More...
 
virtual void addSubrunDependency (int subrun)
 add subrun dependency More...
 
bool import (const IntervalOfValidity &iov)
 Import the object to database. More...
 
virtual void clear ()
 Clear the content, e.g. More...
 

Protected Types

enum  EIntraRunDependency {
  c_None = 0 ,
  c_Event = 1 ,
  c_TimeStamp = 2 ,
  c_Subrun = 3
}
 Intra run dependency types (used only internaly)
 

Protected Member Functions

void addIntraRunDependency (unsigned long long int tag, EIntraRunDependency type)
 add intra run dependency More...
 

Protected Attributes

std::string m_name
 object or array name in database
 
TObject * m_object = 0
 pointer to allocated object or array
 

Private Member Functions

template<class IntraRun >
bool import (const IntervalOfValidity &iov)
 Import intra run dependent object to database. More...
 
bool storeData (TObject *intraRun, const IntervalOfValidity &iov)
 Store intra run dependent objects. More...
 

Private Attributes

EIntraRunDependency m_dependency = c_None
 dependency type
 
std::vector< TObject * > m_objects
 container for intra run dependency objects
 
std::vector< unsigned long long int > m_tags
 container for intra run dep. More...
 

Detailed Description

template<class T>
class Belle2::DBImportObjPtr< T >

Class for importing a single object to the database.

Note that the object is NOT parked at DBStore, but allocated internally.

Definition at line 23 of file DBImportObjPtr.h.

Constructor & Destructor Documentation

◆ DBImportObjPtr()

DBImportObjPtr ( const std::string &  name = "")
inlineexplicit

Constructor: the object itself is not allocated here, but in construct(...) function.

Parameters
nameName under which the object will be stored in the database

Definition at line 31 of file DBImportObjPtr.h.

31  :
32  DBImportBase(DBStore::objectName<T>(name))
33  {}
DBImportBase(const std::string &name)
Constructor.
Definition: DBImportBase.h:30

Member Function Documentation

◆ addEventDependency()

virtual void addEventDependency ( unsigned int  eventNumber)
inlinevirtualinherited

add event dependency

Parameters
eventNumberevent number

Reimplemented in DBImportArray< T >.

Definition at line 47 of file DBImportBase.h.

◆ addIntraRunDependency()

void addIntraRunDependency ( unsigned long long int  tag,
EIntraRunDependency  type 
)
protectedinherited

add intra run dependency

Parameters
tagaccording to type: event number or time stamp or subrun number
typeintra run dependency type

Definition at line 17 of file DBImportBase.cc.

◆ addSubrunDependency()

virtual void addSubrunDependency ( int  subrun)
inlinevirtualinherited

add subrun dependency

Parameters
subrunsubrun number

Reimplemented in DBImportArray< T >.

Definition at line 65 of file DBImportBase.h.

◆ addTimeStampDependency()

virtual void addTimeStampDependency ( unsigned long long int  timeStamp)
inlinevirtualinherited

add time stamp dependency

Parameters
timeStamptime stamp

Reimplemented in DBImportArray< T >.

Definition at line 56 of file DBImportBase.h.

◆ clear()

void clear ( void  )
virtualinherited

Clear the content, e.g.

destroy allocated objects and prepare for the new DB import.

Reimplemented in DBImportArray< T >.

Definition at line 58 of file DBImportBase.cc.

◆ getName()

const std::string& getName ( ) const
inlineinherited

Returns the name under which the object will be stored in the database.

Returns
name

Definition at line 41 of file DBImportBase.h.

◆ import() [1/2]

bool import ( const IntervalOfValidity iov)
inherited

Import the object to database.

Parameters
iovinterval of validity

Definition at line 36 of file DBImportBase.cc.

◆ import() [2/2]

bool import ( const IntervalOfValidity iov)
inlineprivateinherited

Import intra run dependent object to database.

Parameters
iovinterval of validity

Definition at line 114 of file DBImportBase.h.

◆ storeData()

bool storeData ( TObject *  intraRun,
const IntervalOfValidity iov 
)
privateinherited

Store intra run dependent objects.

This is an extra function to hide implementation details of Database.h

Parameters
intraRunpointer to the Intra Run implementation which has to inherit from TObject
iovinterval of validity

Definition at line 71 of file DBImportBase.cc.

Member Data Documentation

◆ m_tags

std::vector<unsigned long long int> m_tags
privateinherited

container for intra run dep.

tags

Definition at line 139 of file DBImportBase.h.


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