ATLAS Offline Software
|
#include <CollectionBase/CollectionDescription.h>
Public Member Functions | |
CollectionDescription (const std::string &name, const std::string &type, const std::string &connection="", const std::string &eventReferenceColumnName="") | |
Constructor that takes as input the minimum amount of properties needed to describe the collection. More... | |
CollectionDescription (const ICollectionDescription &rhs) | |
Copy constructor. More... | |
CollectionDescription (const CollectionDescription &rhs) | |
virtual | ~CollectionDescription () |
Default destructor. More... | |
CollectionDescription & | operator= (const ICollectionDescription &rhs) |
Assignment operator. More... | |
CollectionDescription & | operator= (const CollectionDescription &rhs) |
Assignment operator. More... | |
bool | operator== (const CollectionDescription &rhs) const |
Equality operator. More... | |
bool | operator!= (const CollectionDescription &rhs) const |
Inequality operator. More... | |
virtual bool | equals (const ICollectionDescription &rhs) const |
Check if both Descriptions have the same columns. More... | |
virtual bool | isSubsetOf (const ICollectionDescription &rhs) const |
Check if all columns from this Description are present in the rhs Description and if they have the same type. More... | |
virtual void | setName (const std::string &name) |
Sets the name of the collection. More... | |
virtual void | setType (const std::string &type) |
Sets the storage technology type of the collection. More... | |
virtual void | setConnection (const std::string &connection) |
Sets the connection to the database containing the collection. More... | |
virtual void | setEventReferenceColumnName (const std::string &columnName) |
Sets the name of the event reference Token column. More... | |
virtual const ICollectionColumn & | insertColumn (const std::string &columnName, const std::string &columnType, const std::string &annotation="", int maxSize=0, bool sizeIsFixed=true) |
Adds a new column to the collection. More... | |
virtual const ICollectionColumn & | insertColumn (const std::string &columnName, const std::type_info &columnType, const std::string &annotation="", int maxSize=0, bool sizeIsFixed=true) |
Adds a new column to the collection. More... | |
virtual const ICollectionColumn & | insertTokenColumn (const std::string &columnName, const std::string &annotation="") |
Adds a new column of type pool::Token to the collection. More... | |
virtual const ICollectionColumn & | annotateColumn (const std::string &columnName, const std::string &annotation) |
add annotation to column More... | |
virtual void | dropColumn (const std::string &columnName) |
Removes a column from the collection description. More... | |
virtual void | renameColumn (const std::string &oldName, const std::string &newName) |
Renames a column of the collection description. More... | |
virtual void | changeColumnType (const std::string &columnName, const std::string &newType, int maxSize=0, bool sizeIsFixed=true) |
Changes the data type of a column in the collection description. More... | |
virtual void | changeColumnType (const std::string &columnName, const std::type_info &newType, int maxSize=0, bool sizeIsFixed=true) |
Changes the data type of a column in the collection description. More... | |
virtual void | createIndex (std::string indexName, const std::string &columnName, bool isUnique=false) |
Creates an index on a column of the collection description. More... | |
virtual void | createIndex (std::string indexName, const std::vector< std::string > &columnNames, bool isUnique=false) |
Creates an index on one or more columns of the collection description. More... | |
virtual void | dropIndex (const std::string &columnName) |
Removes an index from the collection description, given the name of the column on which the index to be removed is applied. More... | |
virtual void | dropIndex (const std::vector< std::string > &columnNames) |
Removes an index from a column of the collection description, given the names of the columns on which the index to be removed is applied. More... | |
virtual const std::string & | name () const |
Returns the name of the collection and the top level collection fragment. More... | |
virtual const std::string & | type () const |
Returns the storage technology type of the collection. More... | |
virtual const std::string & | connection () const |
Returns the connection to the database containing the collection. More... | |
virtual const std::string & | eventReferenceColumnName () const |
Returns the name reserved for the event reference Token column. More... | |
virtual bool | hasEventReferenceColumn () const |
Indicates whether the top level collection fragment contains the event reference column and is therefore defined as a collection. More... | |
virtual int | numberOfColumns () const |
Returns the number of columns (including the event reference column if it is used) in the collection. More... | |
virtual const ICollectionColumn & | column (const std::string &columnName) const |
Returns a description object for a column of the collection, given the name of the column. More... | |
virtual const ICollectionColumn * | columnPtr (const std::string &columnName) const |
return pointer to Column or NULL if it's not found (will not throw exceptions) More... | |
virtual int | numberOfTokenColumns () const |
Returns the number of Token columns (including the event reference column if it is used) More... | |
virtual const ICollectionColumn & | tokenColumn (const std::string &columnName) const |
Returns a description object for a Token column of the collection, given the name of the column. More... | |
virtual const ICollectionColumn & | tokenColumn (int columnId) const |
Returns a description object for a Token column of the collection, given the position of the column. More... | |
virtual int | numberOfAttributeColumns () const |
Returns the number of Attribute columns in the collection. More... | |
virtual const ICollectionColumn & | attributeColumn (const std::string &columnName) const |
Returns a description object for an Attribute column of the collection, given the name of the column. More... | |
virtual const ICollectionColumn & | attributeColumn (int columnId) const |
Returns a description object for an Attribute column of the collection, given the position of the column. More... | |
const std::vector< pool::CollectionColumn * > & | tokenColumns () const |
Returns the Token column description objects. More... | |
const std::vector< pool::CollectionColumn * > & | attributeColumns () const |
Returns the Attribute column description objects. More... | |
virtual int | numberOfIndices () const |
Returns the number of indices used by the collection. More... | |
virtual const ICollectionIndex & | index (const std::string &columnName) const |
Returns a description object for an index of the collection, given the name of the column on which the index is applied. More... | |
virtual const ICollectionIndex & | index (const std::vector< std::string > &columnNames) const |
Returns a description object for an index of the collection, given the names of the columns on which the index is applied. More... | |
virtual const ICollectionIndex & | index (int indexId) const |
Returns a description object for an index of the collection, given the ID number of the index. More... | |
virtual int | setColumnId (const std::string &columnName, int id, const std::string &methodName) |
virtual void | printOut () const |
print out the description (debugging) More... | |
Protected Member Functions | |
virtual void | copyFrom (const ICollectionDescription &rhs) |
make this description a copy of 'rhs' More... | |
virtual void | clearAll () |
virtual int | setColumnId (pool::CollectionColumn *column, int id=-1) |
virtual void | checkNewColumnName (const std::string &name, const std::string &method) const |
virtual bool | isTokenColumn (const std::string &columnName, const std::string &method) const |
virtual pool::CollectionColumn * | column (const std::string &columnName, const std::string &methodName) |
virtual const pool::CollectionColumn * | column (const std::string &columnName, const std::string &methodName) const |
Private Types | |
typedef std::map< std::string, CollectionColumn * > | ColumnByName |
Private Attributes | |
std::string | m_name |
Name of the collection. More... | |
std::string | m_type |
Storage technology type of collection. More... | |
std::string | m_connection |
Connection to database containing collection. More... | |
std::string | m_eventReferenceColumnName |
Name of event reference column. More... | |
std::vector< pool::CollectionColumn * > | m_tokenColumns |
std::vector< pool::CollectionColumn * > | m_attributeColumns |
Attribute column description objects. More... | |
std::map< std::string, int > | m_columnIdForColumnName |
Map of column ID numbers for column names IDs are unique in the collection. More... | |
ColumnByName | m_tokenColumnForColumnName |
Map of Token CollectionColumn objects using column names as keys. More... | |
ColumnByName | m_attributeColumnForColumnName |
Map of Attribute CollectionColumn objects using column names as keys. More... | |
std::vector< CollectionIndex * > | m_indices |
Vector of CollectionIndex objects. More... | |
An implementation of the ICollectionDescription interface used to define the properties of a collection to be constructed and to retrieve these properties after construction. The schema editor of the collection should be used for any modifications to these properties after construction.
Definition at line 27 of file CollectionDescription.h.
|
private |
Definition at line 423 of file CollectionDescription.h.
pool::CollectionDescription::CollectionDescription | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | connection = "" , |
||
const std::string & | eventReferenceColumnName = "" |
||
) |
Constructor that takes as input the minimum amount of properties needed to describe the collection.
An event reference Token column is inserted by default but may be renamed via a call to ‘setEventReferenceColumnName’ or ‘renameColumn()’ or removed via a call to ‘dropColumn()’ after the collection description object has been constructed.
name | Name of collection. |
type | Storage technology type of collection. |
connection | Connection to database containing collection. |
eventReferenceColumnName | Name of event reference column. |
pool::CollectionDescription::CollectionDescription | ( | const ICollectionDescription & | rhs | ) |
Copy constructor.
rhs | Collection description object to copy. |
pool::CollectionDescription::CollectionDescription | ( | const CollectionDescription & | rhs | ) |
|
virtual |
Default destructor.
|
virtual |
add annotation to column
Implements pool::ICollectionSchemaEditor.
|
virtual |
Returns a description object for an Attribute column of the collection, given the name of the column.
columnName | Name of column. |
Implements pool::ICollectionDescription.
|
virtual |
Returns a description object for an Attribute column of the collection, given the position of the column.
columnId | Position of column in associated collection fragment. |
Implements pool::ICollectionDescription.
|
inline |
Returns the Attribute column description objects.
Definition at line 338 of file CollectionDescription.h.
|
virtual |
Changes the data type of a column in the collection description.
Throws and exception if an attempt is made to change the data type of the event reference Token column.
columnName | Name of column whose type is to be changed. |
newType | New data type assigned to column. |
maxSize | Maximum size of new data type (useful for string and blob types). |
sizeIsFixed | Flag indicating whether size of new data type is fixed (useful for string and blob types). |
|
virtual |
Changes the data type of a column in the collection description.
Throws and exception if an attempt is made to change the data type of the event reference Token column.
columnName | Name of column whose type is to be changed. |
newType | New data type assigned to column. |
maxSize | Maximum size of new data type (useful for string and blob types). |
sizeIsFixed | Flag indicating whether size of new data type is fixed (useful for string and blob types). |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Returns a description object for a column of the collection, given the name of the column.
columnName | Name of column. |
Implements pool::ICollectionDescription.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
return pointer to Column or NULL if it's not found (will not throw exceptions)
Implements pool::ICollectionDescription.
|
virtual |
Returns the connection to the database containing the collection.
Implements pool::ICollectionDescription.
|
protectedvirtual |
make this description a copy of 'rhs'
|
virtual |
Creates an index on a column of the collection description.
Automatically generates a unique name for the index.
columnName | Name of column for which index is created. |
isUnique | Flag to indicate whether indexed column values must be unique. |
|
virtual |
Creates an index on one or more columns of the collection description.
Automatically generates a unique name for the index.
columnNames | Names of columns for which index is to be created. |
isUnique | Flag to indicates whether combination of indexed column values must be unique. |
|
virtual |
Removes a column from the collection description.
columnName | Name of column to be removed. |
Implements pool::ICollectionSchemaEditor.
|
virtual |
Removes an index from the collection description, given the name of the column on which the index to be removed is applied.
columnName | Name of column on which index to be removed is applied. |
|
virtual |
Removes an index from a column of the collection description, given the names of the columns on which the index to be removed is applied.
columnNames | Names of columns on which index to be removed is applied. |
|
virtual |
Check if both Descriptions have the same columns.
rhs | Collection description object to compare. |
Implements pool::ICollectionDescription.
|
virtual |
Returns the name reserved for the event reference Token column.
If the name has not been set by the user a default name is returned.
Implements pool::ICollectionDescription.
|
virtual |
Indicates whether the top level collection fragment contains the event reference column and is therefore defined as a collection.
Implements pool::ICollectionDescription.
|
virtual |
Returns a description object for an index of the collection, given the name of the column on which the index is applied.
columnName | Name of column on which index is applied. |
Implements pool::ICollectionDescription.
|
virtual |
Returns a description object for an index of the collection, given the names of the columns on which the index is applied.
columnNames | Names of columns on which index is applied. |
Implements pool::ICollectionDescription.
|
virtual |
Returns a description object for an index of the collection, given the ID number of the index.
indexId | ID of index. |
Implements pool::ICollectionDescription.
|
virtual |
Adds a new column to the collection.
columnName | Name of new column. |
columnType | Data type of new column. |
maxSize | Maximum size of column data type (useful for string or blob data types). |
sizeIsFixed | Flag indicating whether size of column data type is fixed (useful for string or blob data types). |
Implements pool::ICollectionSchemaEditor.
|
virtual |
Adds a new column to the collection.
columnName | Name of new column. |
columnType | Data type of new column. |
maxSize | Maximum size of column data type (useful for string or blob data types). |
sizeIsFixed | Flag indicating whether size of column data type is fixed (useful for string or blob data types). |
Implements pool::ICollectionSchemaEditor.
|
virtual |
Adds a new column of type pool::Token to the collection.
columnName | Name of new column. |
Implements pool::ICollectionSchemaEditor.
|
virtual |
Check if all columns from this Description are present in the rhs Description and if they have the same type.
rhs | Collection description object to compare. |
Implements pool::ICollectionDescription.
|
protectedvirtual |
|
virtual |
Returns the name of the collection and the top level collection fragment.
Implements pool::ICollectionDescription.
|
virtual |
Returns the number of Attribute columns in the collection.
Implements pool::ICollectionDescription.
|
virtual |
Returns the number of columns (including the event reference column if it is used) in the collection.
Implements pool::ICollectionDescription.
|
virtual |
Returns the number of indices used by the collection.
Implements pool::ICollectionDescription.
|
virtual |
Returns the number of Token columns (including the event reference column if it is used)
Implements pool::ICollectionDescription.
bool pool::CollectionDescription::operator!= | ( | const CollectionDescription & | rhs | ) | const |
Inequality operator.
rhs | Collection description object to compare. |
|
inline |
Assignment operator.
rhs | source CollectionDescription object to copy. |
Definition at line 70 of file CollectionDescription.h.
CollectionDescription& pool::CollectionDescription::operator= | ( | const ICollectionDescription & | rhs | ) |
Assignment operator.
rhs | source ICollectionDescription object to copy. |
bool pool::CollectionDescription::operator== | ( | const CollectionDescription & | rhs | ) | const |
Equality operator.
rhs | Collection description object to compare. |
|
virtual |
print out the description (debugging)
Reimplemented from pool::ICollectionDescription.
|
virtual |
Renames a column of the collection description.
oldName | Old name of column. |
newName | New name of column. |
Implements pool::ICollectionSchemaEditor.
|
virtual |
|
protectedvirtual |
|
virtual |
Sets the connection to the database containing the collection.
connection | Connection to database where collection is stored. |
|
virtual |
Sets the name of the event reference Token column.
Otherwise a default name is used.
columnName | Name of event reference Token column. |
Implements pool::ICollectionSchemaEditor.
|
virtual |
Sets the name of the collection.
name | Name of collection. |
|
virtual |
Sets the storage technology type of the collection.
type | Storage technology type of collection. |
|
virtual |
Returns a description object for a Token column of the collection, given the name of the column.
columnName | Name of column. |
Implements pool::ICollectionDescription.
|
virtual |
Returns a description object for a Token column of the collection, given the position of the column.
columnId | Position of column in associated collection fragment. |
Implements pool::ICollectionDescription.
|
inline |
Returns the Token column description objects.
Definition at line 335 of file CollectionDescription.h.
|
virtual |
Returns the storage technology type of the collection.
Implements pool::ICollectionDescription.
|
private |
Map of Attribute CollectionColumn objects using column names as keys.
Definition at line 428 of file CollectionDescription.h.
|
private |
Attribute column description objects.
Definition at line 417 of file CollectionDescription.h.
|
private |
Map of column ID numbers for column names IDs are unique in the collection.
Definition at line 421 of file CollectionDescription.h.
|
private |
Connection to database containing collection.
Definition at line 408 of file CollectionDescription.h.
|
private |
Name of event reference column.
Definition at line 411 of file CollectionDescription.h.
|
private |
Vector of CollectionIndex objects.
Definition at line 431 of file CollectionDescription.h.
|
private |
Name of the collection.
Definition at line 402 of file CollectionDescription.h.
|
private |
Map of Token CollectionColumn objects using column names as keys.
Definition at line 425 of file CollectionDescription.h.
|
private |
Definition at line 414 of file CollectionDescription.h.
|
private |
Storage technology type of collection.
Definition at line 405 of file CollectionDescription.h.