ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
pool::RootCollection::RootCollectionDataEditor Class Reference

#include <RootCollectionDataEditor.h>

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

Public Member Functions

 RootCollectionDataEditor (const pool::ICollectionDescription &description, TTree *tree, coral::MessageStream &log)
 
virtual ~RootCollectionDataEditor ()
 
virtual void setRowCacheSize (int)
 Sets the number of rows to cache before insertion into the collection. More...
 
virtual CollectionRowBufferrowBuffer ()
 Returns a reference to a collection row buffer for adding rows of data to the collection. More...
 
virtual CollectionRowBufferemptyRowBuffer ()
 Returns a reference to an empty collection row buffer for adding rows of data to the collection. More...
 
virtual void clearRowBuffers ()
 Clears all row buffers. More...
 
virtual void insertRow (const pool::CollectionRowBuffer &inputRowBuffer, bool updateRecordsCounter=false)
 Adds a new row of data to the collection. More...
 
virtual int updateRows (coral::AttributeList *attributeSetList=0, TokenList *tokenSetList=0, const std::string &whereClause="", coral::AttributeList *attributeBindData=0, pool::TokenList *tokenBindData=0)
 Updates the rows of the collection that satisfy a query. More...
 
virtual int deleteRows (const std::string &whereClause, coral::AttributeList *attributeBindData=0, pool::TokenList *tokenBindData=0, bool updateRecordsCounter=true)
 Deletes the rows of the collection that satisfy a query. More...
 

Protected Attributes

const ICollectionDescriptionm_description
 Specification of collection properties. More...
 
CollectionRowBuffer m_collectionRowBuffer
 Collection row buffer containing all Tokens and Attributes defined by collection. More...
 
TTree * m_tree
 
coral::MessageStream * m_poolOut
 

Detailed Description

Definition at line 29 of file RootCollectionDataEditor.h.

Constructor & Destructor Documentation

◆ RootCollectionDataEditor()

pool::RootCollection::RootCollectionDataEditor::RootCollectionDataEditor ( const pool::ICollectionDescription description,
TTree *  tree,
coral::MessageStream &  log 
)

◆ ~RootCollectionDataEditor()

virtual pool::RootCollection::RootCollectionDataEditor::~RootCollectionDataEditor ( )
inlinevirtual

Definition at line 37 of file RootCollectionDataEditor.h.

37 {}

Member Function Documentation

◆ clearRowBuffers()

virtual void pool::RootCollection::RootCollectionDataEditor::clearRowBuffers ( )
virtual

Clears all row buffers.

Should be applied before inserting rows for which some columns are expected to have null values.

Implements pool::ICollectionDataEditor.

◆ deleteRows()

virtual int pool::RootCollection::RootCollectionDataEditor::deleteRows ( const std::string &  whereClause,
coral::AttributeList *  attributeBindData = 0,
pool::TokenList tokenBindData = 0,
bool  updateRecordsCounter = true 
)
virtual

Deletes the rows of the collection that satisfy a query.

Returns the number of rows deleted. Throws an exception if no where clause is provided as input. An option is provided to turn off the written and deleted records counters if the written records counter was turned off during record insertion to improve performance.

Parameters
whereClausePredicates of query.
attributeBindDataAttribute bind data for where clause.
tokenBindDataToken bind data for where clause.
updateRecordsCounterFlag indicating whether to decrement written records counter and increment deleted records counter.

Implements pool::ICollectionDataEditor.

◆ emptyRowBuffer()

virtual CollectionRowBuffer& pool::RootCollection::RootCollectionDataEditor::emptyRowBuffer ( )
virtual

Returns a reference to an empty collection row buffer for adding rows of data to the collection.

If data will be provided for all columns use the method ‘rowBuffer’ instead since buffers do not need to be cleared in this case.

Implements pool::ICollectionDataEditor.

◆ insertRow()

virtual void pool::RootCollection::RootCollectionDataEditor::insertRow ( const pool::CollectionRowBuffer inputRowBuffer,
bool  updateRecordsCounter = false 
)
virtual

Adds a new row of data to the collection.

An option is provided to turn off the written records counter to improve performance.

Parameters
inputRowBufferBuffer containing data for row to be added.
updateRecordsCounterFlag indicating whether to increment written records counter.

Implements pool::ICollectionDataEditor.

◆ rowBuffer()

virtual CollectionRowBuffer& pool::RootCollection::RootCollectionDataEditor::rowBuffer ( )
virtual

Returns a reference to a collection row buffer for adding rows of data to the collection.

If data for one or more columns will not be provided use the method ‘emptyRowBuffer’ instead.

Implements pool::ICollectionDataEditor.

◆ setRowCacheSize()

virtual void pool::RootCollection::RootCollectionDataEditor::setRowCacheSize ( int  )
inlinevirtual

Sets the number of rows to cache before insertion into the collection.

If the input argument is 0 (the default) bulk row insertion will not be applied.

Parameters
rowCacheSizeNumber of rows to cache before insertion into collection.

Implements pool::ICollectionDataEditor.

Definition at line 46 of file RootCollectionDataEditor.h.

46 {}

◆ updateRows()

virtual int pool::RootCollection::RootCollectionDataEditor::updateRows ( coral::AttributeList *  attributeSetList = 0,
TokenList tokenSetList = 0,
const std::string &  whereClause = "",
coral::AttributeList *  attributeBindData = 0,
pool::TokenList tokenBindData = 0 
)
virtual

Updates the rows of the collection that satisfy a query.

Returns the number of rows updated. Throws an exception if both the Attribute and Token set lists provided as input are empty.

Parameters
tokenSetListList of Tokens to set with associated values.
attributeSetListList of Attributes to set with associated values.
whereClausePredicates of query.
attributeBindDataAttribute bind data for where clause.
tokenBindDataToken bind data for where clause.

Implements pool::ICollectionDataEditor.

Member Data Documentation

◆ m_collectionRowBuffer

CollectionRowBuffer pool::RootCollection::RootCollectionDataEditor::m_collectionRowBuffer
protected

Collection row buffer containing all Tokens and Attributes defined by collection.

Definition at line 116 of file RootCollectionDataEditor.h.

◆ m_description

const ICollectionDescription& pool::RootCollection::RootCollectionDataEditor::m_description
protected

Specification of collection properties.

Definition at line 113 of file RootCollectionDataEditor.h.

◆ m_poolOut

coral::MessageStream* pool::RootCollection::RootCollectionDataEditor::m_poolOut
protected

Definition at line 120 of file RootCollectionDataEditor.h.

◆ m_tree

TTree* pool::RootCollection::RootCollectionDataEditor::m_tree
protected

Definition at line 118 of file RootCollectionDataEditor.h.


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