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

Collection implementation. More...

#include <RootCollection.h>

Inheritance diagram for pool::RootCollection:
Collaboration diagram for pool::RootCollection:

Public Types

enum  OpenMode { CREATE_AND_OVERWRITE , READ }
 Enumeration of the possible open modes of the collection. More...

Public Member Functions

 RootCollection (const pool::CollectionDescription *description, pool::ICollection::OpenMode mode)
 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 CollectionDescriptiondescription () const final override
 Returns an object used to describe the collection properties.
virtual std::unique_ptr< ICollectionCursorcursor () final override
 Returns a cursor for the collection.
virtual void initNewRow (pool::CollectionRowBuffer &row) const
 Initialize a new RowBuffer by adding all Attributes adn 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.
RootCollectionoperator= (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.
ICollection::OpenMode m_mode
bool m_open
std::unique_ptr< IStorageSvcm_storageSvc
pool::FileDescriptor m_fileDescr
ContainerMap m_containerMap
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.

  • Suppoerts a single Token plus meta data attributes

Definition at line 37 of file RootCollection.h.

Member Enumeration Documentation

◆ OpenMode

Enumeration of the possible open modes of the collection.

Enumerator
CREATE_AND_OVERWRITE 
READ 

Definition at line 27 of file ICollection.h.

OpenMode
Enumeration of the possible open modes of the collection.
Definition ICollection.h:27

Constructor & Destructor Documentation

◆ RootCollection() [1/2]

pool::RootCollection::RootCollection ( const pool::CollectionDescription * description,
pool::ICollection::OpenMode mode )

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)

◆ initNewRow()

virtual void pool::ICollection::initNewRow ( pool::CollectionRowBuffer & row) const
virtualinherited

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

◆ 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

Definition at line 90 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 83 of file RootCollection.h.

◆ m_description

CollectionDescription pool::RootCollection::m_description
private

Definition at line 78 of file RootCollection.h.

◆ m_fileDescr

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

Definition at line 89 of file RootCollection.h.

◆ m_fileName

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

Definition at line 81 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

ICollection::OpenMode pool::RootCollection::m_mode
private

Definition at line 84 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 80 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 86 of file RootCollection.h.

◆ m_storageSvc

std::unique_ptr<IStorageSvc> pool::RootCollection::m_storageSvc
private

Definition at line 88 of file RootCollection.h.


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