ATLAS Offline Software
Loading...
Searching...
No Matches
RNTupleContainer Class Reference

Description: RNTUPLE specific implementation of Database Container. More...

#include <src/RNTupleContainer.h>

Inheritance diagram for RNTupleContainer:
Collaboration diagram for RNTupleContainer:

Classes

struct  FieldDesc
 Definition of a field info structure. More...

Public Member Functions

 RNTupleContainer (const std::string &name)
virtual ~RNTupleContainer ()
virtual StatusCode close () override final
 Close the container and deallocate resources.
virtual StatusCode open (pool::DbDatabase &dbH, const std::string &nam, const pool::DbTypeInfo *info, pool::DbAccessMode mod) override final
 Open the container for object access.
virtual StatusCode checkAccess (pool::DbDatabase &dbH, const std::string &nam) const override final
 Check if we can access the container for reading with the given type.
virtual StatusCode getOption (pool::DbOption &opt) override final
 Access options.
virtual StatusCode setOption (const pool::DbOption &opt) override final
 Set options.
virtual uint64_t size () override final
 Number of entries within the container.
const std::string & getName () const
 Return the name of the container.
bool isDirty () const
 Return true if this branch container was updated and it's TTree needs to be Filled.
void clearDirty ()
 Clear the dirty status (used after containing TTree was Filled)
virtual StatusCode loadObject (void **ptr, pool::ShapeH shape, Token::OID_t &oid) override final
 Find object by object identifier and load it into memory.
virtual StatusCode writeObject (ActionList::value_type &) override final
 Commit single entry to container.
virtual uint64_t nextRecordId () override final
 Number of next record in the container (=size if no delete is allowed)
virtual void useNextRecordId (uint64_t nextID) override final
 Suggest next Record ID for tbe next object written - used only with synced indexes.
virtual StatusCode transAct (pool::Transaction::Action action) override final
 Execute transaction action.
virtual StatusCode store (const void *object, pool::DbContainer &cntH, pool::ShapeH shape) override final
 Store object in location.
virtual void release () override
 Release instance (Abstract interfaces do not expose destructor!)
virtual std::string name () const override
 Get container name.
virtual StatusCode allocate (DbContainer &cntH, const void *object, ShapeH shape, Token::OID_t &oid) override
 In place allocation of object location.
virtual StatusCode next (Token::OID_t &linkH) override
 Fetch next object address to set token.
virtual StatusCode load (void **ptr, ShapeH shape, const Token::OID_t &lnkH, Token::OID_t &oid, bool any_next) override
 Find object within the container and load it into memory.
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Types

typedef std::vector< DbActionActionList

Protected Member Functions

virtual StatusCode commitTransaction ()
 Execute object modification requests during a transaction.

Protected Attributes

std::string m_name
 Container name.

Private Member Functions

StatusCode initObjectFieldDesc (FieldDesc &dsc)
 Init a field description for an object (i.e. find TClass etc.)
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

const pool::DbTypeInfom_type {}
 reference to exact type description
std::vector< FieldDescm_fieldDescs
 List of field descriptors.
pool::DbDatabase m_dbH
 Parent Database handle.
pool::RootDatabasem_rootDb
 Root database file reference.
int m_ioBytes
 Number of bytes written/read during last operation. Set to -1 if it failed.
bool m_isDirty
 flag set on writing to prevent double writes in the same commit
uint64_t m_index
uint64_t m_indexSize
int64_t m_indexBump
const uint32_t m_indexMulti
RootStorageSvc::RNTupleWriterHelperm_ntupleWriter = nullptr
 Internal cache of the RNTupleWriterHelper.
ROOT::RNTupleReader * m_ntupleReader {}
 Internal cache of the native RNTupleReader.
std::unique_ptr< RootAuxDynIO::IFactoryToolm_auxDynTool
 Factory object from AuxDynIO plugin that creates AuxDyn readers and writers.
ActionList m_writeStack
 Transaction fifo storage for writing.
size_t m_size
 Current size of the transaction stack.
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Description: RNTUPLE specific implementation of Database Container.

Definition at line 39 of file RNTupleContainer.h.

Member Typedef Documentation

◆ ActionList

typedef std::vector< DbAction > pool::DbContainerImp::ActionList
protectedinherited

Definition at line 64 of file DbContainerImp.h.

Constructor & Destructor Documentation

◆ RNTupleContainer()

RNTupleContainer::RNTupleContainer ( const std::string & name)
explicit

◆ ~RNTupleContainer()

virtual RNTupleContainer::~RNTupleContainer ( )
virtual

Member Function Documentation

◆ allocate()

virtual StatusCode pool::DbContainerImp::allocate ( DbContainer & cntH,
const void * object,
ShapeH shape,
Token::OID_t & oid )
overridevirtualinherited

In place allocation of object location.

Implements pool::IDbContainer.

◆ checkAccess()

virtual StatusCode RNTupleContainer::checkAccess ( pool::DbDatabase & dbH,
const std::string & nam ) const
finaloverridevirtual

Check if we can access the container for reading with the given type.

Implements pool::IDbContainer.

◆ clearDirty()

void RNTupleContainer::clearDirty ( )
inline

Clear the dirty status (used after containing TTree was Filled)

Definition at line 143 of file RNTupleContainer.h.

143{ m_isDirty = false; }
bool m_isDirty
flag set on writing to prevent double writes in the same commit

◆ close()

virtual StatusCode RNTupleContainer::close ( )
finaloverridevirtual

Close the container and deallocate resources.

Reimplemented from pool::DbContainerImp.

◆ commitTransaction()

virtual StatusCode pool::DbContainerImp::commitTransaction ( )
protectedvirtualinherited

Execute object modification requests during a transaction.

◆ getName()

const std::string & RNTupleContainer::getName ( ) const
inline

Return the name of the container.

Definition at line 136 of file RNTupleContainer.h.

136{ return m_name; }
std::string m_name
Container name.

◆ getOption()

virtual StatusCode RNTupleContainer::getOption ( pool::DbOption & opt)
finaloverridevirtual

Access options.

Parameters
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Reimplemented from pool::DbContainerImp.

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ initObjectFieldDesc()

StatusCode RNTupleContainer::initObjectFieldDesc ( FieldDesc & dsc)
private

Init a field description for an object (i.e. find TClass etc.)

◆ isDirty()

bool RNTupleContainer::isDirty ( ) const
inline

Return true if this branch container was updated and it's TTree needs to be Filled.

Definition at line 140 of file RNTupleContainer.h.

140{ return m_isDirty; }

◆ load()

virtual StatusCode pool::DbContainerImp::load ( void ** ptr,
ShapeH shape,
const Token::OID_t & lnkH,
Token::OID_t & oid,
bool any_next )
overridevirtualinherited

Find object within the container and load it into memory.

Parameters
ptr[IN/OUT] ROOT-style address of the pointer to object
shape[IN] Object type
linkH[IN] Preferred object OID
oid[OUT] Actual object OID
any_next[IN] On selection, objects may be skipped. If objects are skipped, the actual oid will differ from the preferred oid.
Returns
Status code indicating success or failure.

Implements pool::IDbContainer.

Reimplemented in pool::RootKeyContainer.

◆ loadObject()

virtual StatusCode RNTupleContainer::loadObject ( void ** ptr,
pool::ShapeH shape,
Token::OID_t & oid )
finaloverridevirtual

Find object by object identifier and load it into memory.

Parameters
ptr[IN/OUT] address of the pointer to object
shape[IN] Object Shape
oid[OUT] Object OID
Returns
Status code indicating success or failure.

Implements pool::DbContainerImp.

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ name()

virtual std::string pool::DbContainerImp::name ( ) const
inlineoverridevirtualinherited

Get container name.

Implements pool::IDbContainer.

Definition at line 90 of file DbContainerImp.h.

91 { return m_name; }

◆ next()

virtual StatusCode pool::DbContainerImp::next ( Token::OID_t & linkH)
overridevirtualinherited

Fetch next object address to set token.

Implements pool::IDbContainer.

Reimplemented in pool::RootKeyContainer.

◆ nextRecordId()

virtual uint64_t RNTupleContainer::nextRecordId ( )
finaloverridevirtual

Number of next record in the container (=size if no delete is allowed)

Reimplemented from pool::DbContainerImp.

◆ open()

virtual StatusCode RNTupleContainer::open ( pool::DbDatabase & dbH,
const std::string & nam,
const pool::DbTypeInfo * info,
pool::DbAccessMode mod )
finaloverridevirtual

Open the container for object access.

Implements pool::IDbContainer.

◆ release()

virtual void pool::DbContainerImp::release ( )
inlineoverridevirtualinherited

Release instance (Abstract interfaces do not expose destructor!)

Implements pool::IDbContainer.

Definition at line 86 of file DbContainerImp.h.

86{ delete this; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setOption()

virtual StatusCode RNTupleContainer::setOption ( const pool::DbOption & opt)
finaloverridevirtual

Set options.

Parameters
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Reimplemented from pool::DbContainerImp.

◆ size()

virtual uint64_t RNTupleContainer::size ( )
finaloverridevirtual

Number of entries within the container.

Reimplemented from pool::DbContainerImp.

◆ store()

virtual StatusCode RNTupleContainer::store ( const void * object,
pool::DbContainer & cntH,
pool::ShapeH shape )
finaloverridevirtual

Store object in location.

Reimplemented from pool::DbContainerImp.

◆ transAct()

virtual StatusCode RNTupleContainer::transAct ( pool::Transaction::Action action)
finaloverridevirtual

Execute transaction action.

Reimplemented from pool::DbContainerImp.

◆ useNextRecordId()

virtual void RNTupleContainer::useNextRecordId ( uint64_t )
finaloverridevirtual

Suggest next Record ID for tbe next object written - used only with synced indexes.

Reimplemented from pool::DbContainerImp.

◆ writeObject()

virtual StatusCode RNTupleContainer::writeObject ( ActionList::value_type & )
finaloverridevirtual

Commit single entry to container.

Reimplemented from pool::DbContainerImp.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_auxDynTool

std::unique_ptr<RootAuxDynIO::IFactoryTool> RNTupleContainer::m_auxDynTool
private

Factory object from AuxDynIO plugin that creates AuxDyn readers and writers.

Definition at line 100 of file RNTupleContainer.h.

◆ m_dbH

pool::DbDatabase RNTupleContainer::m_dbH
private

Parent Database handle.

Definition at line 80 of file RNTupleContainer.h.

◆ m_fieldDescs

std::vector<FieldDesc> RNTupleContainer::m_fieldDescs
private

List of field descriptors.

Definition at line 78 of file RNTupleContainer.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_index

uint64_t RNTupleContainer::m_index
private

Definition at line 88 of file RNTupleContainer.h.

◆ m_indexBump

int64_t RNTupleContainer::m_indexBump
private

Definition at line 90 of file RNTupleContainer.h.

◆ m_indexMulti

const uint32_t RNTupleContainer::m_indexMulti
private

Definition at line 91 of file RNTupleContainer.h.

◆ m_indexSize

uint64_t RNTupleContainer::m_indexSize
private

Definition at line 89 of file RNTupleContainer.h.

◆ m_ioBytes

int RNTupleContainer::m_ioBytes
private

Number of bytes written/read during last operation. Set to -1 if it failed.

Definition at line 84 of file RNTupleContainer.h.

◆ m_isDirty

bool RNTupleContainer::m_isDirty
private

flag set on writing to prevent double writes in the same commit

Definition at line 86 of file RNTupleContainer.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_name

std::string pool::DbContainerImp::m_name
protectedinherited

Container name.

Definition at line 73 of file DbContainerImp.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_ntupleReader

ROOT::RNTupleReader* RNTupleContainer::m_ntupleReader {}
private

Internal cache of the native RNTupleReader.

Definition at line 97 of file RNTupleContainer.h.

97{};

◆ m_ntupleWriter

RootStorageSvc::RNTupleWriterHelper* RNTupleContainer::m_ntupleWriter = nullptr
private

Internal cache of the RNTupleWriterHelper.

Definition at line 94 of file RNTupleContainer.h.

◆ m_rootDb

pool::RootDatabase* RNTupleContainer::m_rootDb
private

Root database file reference.

Definition at line 82 of file RNTupleContainer.h.

◆ m_size

size_t pool::DbContainerImp::m_size
privateinherited

Current size of the transaction stack.

Definition at line 70 of file DbContainerImp.h.

◆ m_type

const pool::DbTypeInfo* RNTupleContainer::m_type {}
private

reference to exact type description

Definition at line 76 of file RNTupleContainer.h.

76{};

◆ m_writeStack

ActionList pool::DbContainerImp::m_writeStack
privateinherited

Transaction fifo storage for writing.

Definition at line 68 of file DbContainerImp.h.


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