ATLAS Offline Software
Loading...
Searching...
No Matches
pool::RootCollection Class Reference

Collection implementation. More...

#include <RootCollection.h>

Inheritance diagram for pool::RootCollection:

Public Member Functions

 RootCollection (const pool::CollectionDescription &description, Io::IoFlag mode, ISession *session)
 Constructor.
 ~RootCollection ()
 Destructor.
virtual void open () final override
 Explicitly re-opens the collection after it has been closed.
virtual void insertRow (const pool::CollectionRowBuffer &inputRowBuffer) final override
 Adds a new row of data to the collection.
virtual void commit (bool restartTransaction=false) final override
 Commits the last changes made to the collection.
virtual void close () final override
 Explicitly closes the collection.
virtual const CollectionDescription & description () const final override
 Returns an object used to describe the collection properties.
virtual std::unique_ptr< ICollectionCursor > cursor () final override
 Returns a cursor for the collection.
virtual void initNewRow (CollectionRowBuffer &rowBuffer) const final override
 Initialize a new RowBuffer by adding all Attributes and Tokens of this collection to it.
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.

Private Member Functions

 RootCollection (const RootCollection &)=delete
 copying unimplemented in this class.
RootCollection & operator= (const RootCollection &)=delete
void writeColumn (const std::string &columnName, const void *data, const std::type_info &typeInfo)
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

CollectionDescription m_description
std::string m_name
std::string m_fileName
std::string m_containerPrefix
 The common prefix for branch container names for attributes.
Io::IoFlag m_mode
bool m_open
ISession * m_session = nullptr
IStorageSvc * m_storageSvc = nullptr
bool m_ownStorageSvc = false
pool::FileDescriptor m_fileDescr
ContainerMap m_containerMap
 Map of container names to container handles for all EventTag attributes in the file.
DbContainer m_dhCont
 The DataHeader container, if present, in the file.
std::unique_ptr< pool::IDatabase > m_database
 Handle to the file itself.
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

Collection implementation.

  • Supports a single Token plus meta data attributes

Definition at line 34 of file RootCollection.h.

Constructor & Destructor Documentation

◆ RootCollection() [1/2]

pool::RootCollection::RootCollection ( const pool::CollectionDescription & description,
Io::IoFlag mode,
ISession * session )

Constructor.

Parameters
descriptionThe description of the collection, including name and connection
modeThe open mode of the collection
sessionIf you want to access the referenced objects you have to provide an ISession

◆ ~RootCollection()

pool::RootCollection::~RootCollection ( )

Destructor.

◆ RootCollection() [2/2]

pool::RootCollection::RootCollection ( const RootCollection & )
privatedelete

copying unimplemented in this class.

Member Function Documentation

◆ close()

virtual void pool::RootCollection::close ( )
finaloverridevirtual

Explicitly closes the collection.

Implements pool::ICollection.

◆ commit()

virtual void pool::RootCollection::commit ( bool restartTransaction = false)
finaloverridevirtual

Commits the last changes made to the collection.

Implements pool::ICollection.

◆ cursor()

virtual std::unique_ptr< ICollectionCursor > pool::RootCollection::cursor ( )
finaloverridevirtual

Returns a cursor for the collection.

Implements pool::ICollection.

◆ description()

virtual const CollectionDescription & pool::RootCollection::description ( ) const
finaloverridevirtual

Returns an object used to describe the collection properties.

Implements pool::ICollection.

◆ 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)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ initNewRow()

virtual void pool::RootCollection::initNewRow ( CollectionRowBuffer & rowBuffer) const
finaloverridevirtual

Initialize a new RowBuffer by adding all Attributes and Tokens of this collection to it.

Implements pool::ICollection.

◆ insertRow()

virtual void pool::RootCollection::insertRow ( const pool::CollectionRowBuffer & inputRowBuffer)
finaloverridevirtual

Adds a new row of data to the collection.

Implements pool::ICollection.

◆ 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}

◆ open()

virtual void pool::RootCollection::open ( )
finaloverridevirtual

Explicitly re-opens the collection after it has been closed.

Implements pool::ICollection.

◆ operator=()

RootCollection & pool::RootCollection::operator= ( const RootCollection & )
privatedelete

◆ 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}

◆ writeColumn()

void pool::RootCollection::writeColumn ( const std::string & columnName,
const void * data,
const std::type_info & typeInfo )
private

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_containerMap

ContainerMap pool::RootCollection::m_containerMap
private

Map of container names to container handles for all EventTag attributes in the file.

Definition at line 94 of file RootCollection.h.

◆ m_containerPrefix

std::string pool::RootCollection::m_containerPrefix
private

The common prefix for branch container names for attributes.

Definition at line 84 of file RootCollection.h.

◆ m_database

std::unique_ptr<pool::IDatabase> pool::RootCollection::m_database
private

Handle to the file itself.

Definition at line 98 of file RootCollection.h.

◆ m_description

CollectionDescription pool::RootCollection::m_description
private

Definition at line 79 of file RootCollection.h.

◆ m_dhCont

DbContainer pool::RootCollection::m_dhCont
private

The DataHeader container, if present, in the file.

Definition at line 96 of file RootCollection.h.

◆ m_fileDescr

pool::FileDescriptor pool::RootCollection::m_fileDescr
private

Definition at line 92 of file RootCollection.h.

◆ m_fileName

std::string pool::RootCollection::m_fileName
private

Definition at line 82 of file RootCollection.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ 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_mode

Io::IoFlag pool::RootCollection::m_mode
private

Definition at line 85 of file RootCollection.h.

◆ 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::RootCollection::m_name
private

Definition at line 81 of file RootCollection.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_open

bool pool::RootCollection::m_open
private

Definition at line 87 of file RootCollection.h.

◆ m_ownStorageSvc

bool pool::RootCollection::m_ownStorageSvc = false
private

Definition at line 91 of file RootCollection.h.

◆ m_session

ISession* pool::RootCollection::m_session = nullptr
private

Definition at line 89 of file RootCollection.h.

◆ m_storageSvc

IStorageSvc* pool::RootCollection::m_storageSvc = nullptr
private

Definition at line 90 of file RootCollection.h.


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