ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
pool::RootCollection::RNTCollection Class Reference

Collection (and CollectionProxy) implementation based on RNTuple. More...

#include <RNTCollection.h>

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

Public Types

typedef Gaudi::PluginService::Factory< ICollection *(const ICollectionDescription *, ICollection::OpenMode, ISession *)> Factory
 
enum  OpenMode { CREATE, CREATE_AND_OVERWRITE, UPDATE, READ }
 Enumeration of the possible open modes of the collection. More...
 

Public Member Functions

 RNTCollection (const pool::ICollectionDescription *description, pool::ICollection::OpenMode mode, pool::ISession *)
 Constructor. More...
 
 ~RNTCollection ()
 Destructor. More...
 
virtual ICollection::OpenMode openMode () const
 Return openMode. More...
 
virtual void open ()
 Explicitly re-opens the collection after it has been closed. More...
 
virtual bool isOpen () const
 Checks if the collection is open. More...
 
virtual void commit (bool restartTransaction=false)
 Commits the last changes made to the collection. More...
 
virtual void close ()
 Explicitly closes the collection. More...
 
virtual const ICollectionDescriptiondescription () const
 Returns an object used to describe the collection properties. More...
 
virtual ICollectionSchemaEditorschemaEditor ()
 Returns an object used to modify the collection schema. More...
 
virtual ICollectionDataEditordataEditor ()
 Returns an object used to add, update or delete rows of the collection. More...
 
virtual ICollectionQuerynewQuery ()
 Returns an object used to query the collection. More...
 

Private Member Functions

 RNTCollection (const RNTCollection &)=delete
 copying unimplemented in this class. More...
 
RNTCollectionoperator= (const RNTCollection &)=delete
 
void delayedFileOpen (const std::string &method)
 
std::unique_ptr< RNTupleReadergetCollectionRNTuple ()
 
bool fileCatalogRequired () const
 
std::string retrievePFN () const
 
std::string retrieveFID ()
 
std::string retrieveUniquePFN (const FileCatalog::FileID &fid)
 
std::string retrieveBestPFN (const FileCatalog::FileID &fid) const
 
void retrieveFileCatalog () const
 
void cleanup ()
 

Private Attributes

std::unique_ptr< RNTupleReaderm_reader
 
CollectionDescription m_description
 
std::string m_name
 
std::string m_fileName
 
ICollection::OpenMode m_mode
 
TFile * m_file
 
ISessionm_session
 
bool m_open
 
bool m_readOnly
 
std::unique_ptr< pool::IFileCatalogm_fileCatalog
 
coral::MessageStream m_poolOut
 
std::unique_ptr< RNTCollectionSchemaEditorm_schemaEditor
 
ICollectionDataEditorm_dataEditor
 
IFileMgr * m_fileMgr
 

Detailed Description

Collection (and CollectionProxy) implementation based on RNTuple.

Definition at line 46 of file RNTCollection.h.

Member Typedef Documentation

◆ Factory

Definition at line 49 of file RNTCollection.h.

Member Enumeration Documentation

◆ OpenMode

Enumeration of the possible open modes of the collection.

Enumerator
CREATE 
CREATE_AND_OVERWRITE 
UPDATE 
READ 

Definition at line 27 of file ICollection.h.

Constructor & Destructor Documentation

◆ RNTCollection() [1/2]

pool::RootCollection::RNTCollection::RNTCollection ( const pool::ICollectionDescription description,
pool::ICollection::OpenMode  mode,
pool::ISession  
)

Constructor.

Parameters
sessionIf you want to access the referenced objects you have to provide an ISession
connectionThe location of the collection file is uniquely defined by the parameters name and connection
nameThe location of the collection file is uniquely defined by the parameters name and connection
modeThe open mode of the collection
  • Without use of FileCatalog:
    • The path to the collection file is simply created by the following concatenation:
      connection+name+".root"
    • name: Name of the collection file
    • connection:
      • It can be a relative or absolute path
      • In case of an empty connection string it is assumed that the file is located in the current directory
      • Remote access via rootd: e.g. "root://pcepsft02.cern.ch:9090//localdisk/
        Further documentation can be found in the class description of TNetFile (http://root.cern.ch/root/html/TNetFile.html)
  • Utilization of FileCatalog:
    • This mode is triggered if the name parameter starts with one of the following prefixes "PFN:", "FID:" or "LFN:".
    • According to the prefix the name is interpreted as Physical File Name, unique File ID or Logical File Name
    • The connection string is interpreted as URI of the FileCatalog. The collection retrieves the FileCatalog defined by the given URI from FileCatalogMap. A default file catalog (empty connection string) can be defined there.

◆ ~RNTCollection()

pool::RootCollection::RNTCollection::~RNTCollection ( )

Destructor.

◆ RNTCollection() [2/2]

pool::RootCollection::RNTCollection::RNTCollection ( const RNTCollection )
privatedelete

copying unimplemented in this class.

Member Function Documentation

◆ cleanup()

void pool::RootCollection::RNTCollection::cleanup ( )
private

◆ close()

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

Explicitly closes the collection.

Implements pool::ICollection.

◆ commit()

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

Commits the last changes made to the collection.

Implements pool::ICollection.

◆ dataEditor()

virtual ICollectionDataEditor& pool::RootCollection::RNTCollection::dataEditor ( )
virtual

Returns an object used to add, update or delete rows of the collection.

Implements pool::ICollection.

◆ delayedFileOpen()

void pool::RootCollection::RNTCollection::delayedFileOpen ( const std::string &  method)
private

◆ description()

virtual const ICollectionDescription& pool::RootCollection::RNTCollection::description ( ) const
virtual

Returns an object used to describe the collection properties.

Implements pool::ICollection.

◆ fileCatalogRequired()

bool pool::RootCollection::RNTCollection::fileCatalogRequired ( ) const
private

◆ getCollectionRNTuple()

std::unique_ptr< RNTupleReader > pool::RootCollection::RNTCollection::getCollectionRNTuple ( )
private

◆ isOpen()

virtual bool pool::RootCollection::RNTCollection::isOpen ( ) const
virtual

Checks if the collection is open.

Implements pool::ICollection.

◆ newQuery()

virtual ICollectionQuery* pool::RootCollection::RNTCollection::newQuery ( )
virtual

Returns an object used to query the collection.

Implements pool::ICollection.

◆ open()

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

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

Implements pool::ICollection.

◆ openMode()

virtual ICollection::OpenMode pool::RootCollection::RNTCollection::openMode ( ) const
virtual

Return openMode.

Implements pool::ICollection.

◆ operator=()

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

◆ retrieveBestPFN()

std::string pool::RootCollection::RNTCollection::retrieveBestPFN ( const FileCatalog::FileID fid) const
private

◆ retrieveFID()

std::string pool::RootCollection::RNTCollection::retrieveFID ( )
private

◆ retrieveFileCatalog()

void pool::RootCollection::RNTCollection::retrieveFileCatalog ( ) const
private

◆ retrievePFN()

std::string pool::RootCollection::RNTCollection::retrievePFN ( ) const
private

◆ retrieveUniquePFN()

std::string pool::RootCollection::RNTCollection::retrieveUniquePFN ( const FileCatalog::FileID fid)
private

◆ schemaEditor()

virtual ICollectionSchemaEditor& pool::RootCollection::RNTCollection::schemaEditor ( )
virtual

Returns an object used to modify the collection schema.

Implements pool::ICollection.

Member Data Documentation

◆ m_dataEditor

ICollectionDataEditor* pool::RootCollection::RNTCollection::m_dataEditor
private

Definition at line 145 of file RNTCollection.h.

◆ m_description

CollectionDescription pool::RootCollection::RNTCollection::m_description
private

Definition at line 131 of file RNTCollection.h.

◆ m_file

TFile* pool::RootCollection::RNTCollection::m_file
private

Definition at line 136 of file RNTCollection.h.

◆ m_fileCatalog

std::unique_ptr<pool::IFileCatalog> pool::RootCollection::RNTCollection::m_fileCatalog
private

Definition at line 141 of file RNTCollection.h.

◆ m_fileMgr

IFileMgr* pool::RootCollection::RNTCollection::m_fileMgr
private

Definition at line 147 of file RNTCollection.h.

◆ m_fileName

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

Definition at line 134 of file RNTCollection.h.

◆ m_mode

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

Definition at line 135 of file RNTCollection.h.

◆ m_name

std::string pool::RootCollection::RNTCollection::m_name
private

Definition at line 133 of file RNTCollection.h.

◆ m_open

bool pool::RootCollection::RNTCollection::m_open
private

Definition at line 138 of file RNTCollection.h.

◆ m_poolOut

coral::MessageStream pool::RootCollection::RNTCollection::m_poolOut
private

Definition at line 142 of file RNTCollection.h.

◆ m_reader

std::unique_ptr< RNTupleReader > pool::RootCollection::RNTCollection::m_reader
private

Definition at line 130 of file RNTCollection.h.

◆ m_readOnly

bool pool::RootCollection::RNTCollection::m_readOnly
private

Definition at line 139 of file RNTCollection.h.

◆ m_schemaEditor

std::unique_ptr<RNTCollectionSchemaEditor> pool::RootCollection::RNTCollection::m_schemaEditor
private

Definition at line 144 of file RNTCollection.h.

◆ m_session

ISession* pool::RootCollection::RNTCollection::m_session
private

Definition at line 137 of file RNTCollection.h.


The documentation for this class was generated from the following file:
pool::ICollection::CREATE
@ CREATE
Definition: ICollection.h:27
pool::ICollection::OpenMode
OpenMode
Enumeration of the possible open modes of the collection.
Definition: ICollection.h:27
pool::ICollection::CREATE_AND_OVERWRITE
@ CREATE_AND_OVERWRITE
Definition: ICollection.h:27
pool::ICollection::READ
@ READ
Definition: ICollection.h:27
pool::ICollection::UPDATE
@ UPDATE
Definition: ICollection.h:27