|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef COLLECTIONBASE_COLLECTIONDESCRIPTION_H
6 #define COLLECTIONBASE_COLLECTIONDESCRIPTION_H
16 class CollectionColumn;
17 class CollectionIndex;
43 const std::string&
type,
139 const std::string& columnName,
140 const std::string& columnType,
141 const std::string& annotation =
"",
143 bool sizeIsFixed =
true );
154 const std::string& columnName,
155 const std::type_info& columnType,
156 const std::string& annotation =
"",
158 bool sizeIsFixed =
true );
166 const std::string& columnName,
167 const std::string& annotation =
"");
172 const std::string& columnName,
173 const std::string& annotation );
201 const std::string& newType,
203 bool sizeIsFixed =
true );
215 const std::type_info& newType,
217 bool sizeIsFixed =
true );
226 virtual void createIndex( std::string indexName,
const std::string& columnName,
bool isUnique =
false );
235 virtual void createIndex( std::string indexName,
const std::vector< std::string >& columnNames,
bool isUnique =
false );
243 virtual void dropIndex(
const std::string& columnName );
251 virtual void dropIndex(
const std::vector<std::string>& columnNames );
255 virtual const std::string&
name()
const;
258 virtual const std::string&
type()
const;
370 virtual int setColumnId(
const std::string& columnName,
int id,
const std::string& methodName );
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.
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.
std::vector< pool::CollectionColumn * > m_tokenColumns
std::vector< CollectionIndex * > m_indices
Vector of CollectionIndex objects.
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 ...
virtual void setConnection(const std::string &connection)
Sets the connection to the database containing the collection.
virtual const ICollectionColumn & insertTokenColumn(const std::string &columnName, const std::string &annotation="")
Adds a new column of type pool::Token to the collection.
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 th...
std::string m_connection
Connection to database containing collection.
virtual void dropColumn(const std::string &columnName)
Removes a column from the collection description.
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.
virtual const ICollectionIndex & index(int indexId) const
Returns a description object for an index of the collection, given the ID number of the index.
virtual void createIndex(std::string indexName, const std::string &columnName, bool isUnique=false)
Creates an index on a column of the collection description.
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.
virtual const std::string & name() const
Returns the name of the collection and the top level collection fragment.
std::string m_name
Name of the collection.
virtual bool hasEventReferenceColumn() const
Indicates whether the top level collection fragment contains the event reference column and is theref...
virtual const pool::CollectionColumn * column(const std::string &columnName, const std::string &methodName) const
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.
CollectionDescription & operator=(const ICollectionDescription &rhs)
Assignment operator.
std::map< std::string, int > m_columnIdForColumnName
Map of column ID numbers for column names IDs are unique in the collection.
virtual void setEventReferenceColumnName(const std::string &columnName)
Sets the name of the event reference Token column.
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.
virtual bool isTokenColumn(const std::string &columnName, const std::string &method) const
virtual const ICollectionColumn & annotateColumn(const std::string &columnName, const std::string &annotation)
add annotation to column
const std::vector< pool::CollectionColumn * > & tokenColumns() const
Returns the Token column description objects.
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.
std::vector< pool::CollectionColumn * > m_attributeColumns
Attribute column description objects.
virtual int numberOfColumns() const
Returns the number of columns (including the event reference column if it is used) in the collection.
virtual const std::string & eventReferenceColumnName() const
Returns the name reserved for the event reference Token column.
CollectionDescription & operator=(const CollectionDescription &rhs)
Assignment operator.
virtual int setColumnId(const std::string &columnName, int id, const std::string &methodName)
ColumnByName m_tokenColumnForColumnName
Map of Token CollectionColumn objects using column names as keys.
bool operator!=(const CollectionDescription &rhs) const
Inequality operator.
CollectionDescription(const CollectionDescription &rhs)
virtual int numberOfIndices() const
Returns the number of indices used by the collection.
virtual const ICollectionColumn & attributeColumn(int columnId) const
Returns a description object for an Attribute column of the collection, given the position of the col...
virtual void printOut() const
print out the description (debugging)
virtual const std::string & connection() const
Returns the connection to the database containing the collection.
virtual void checkNewColumnName(const std::string &name, const std::string &method) const
virtual void setType(const std::string &type)
Sets the storage technology type of the collection.
virtual const ICollectionColumn * columnPtr(const std::string &columnName) const
return pointer to Column or NULL if it's not found (will not throw exceptions)
std::string m_eventReferenceColumnName
Name of event reference column.
const std::vector< pool::CollectionColumn * > & attributeColumns() const
Returns the Attribute column description objects.
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 ...
virtual int numberOfTokenColumns() const
Returns the number of Token columns (including the event reference column if it is used)
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.
virtual pool::CollectionColumn * column(const std::string &columnName, const std::string &methodName)
ColumnByName m_attributeColumnForColumnName
Map of Attribute CollectionColumn objects using column names as keys.
virtual void setName(const std::string &name)
Sets the name of the collection.
virtual const ICollectionColumn & tokenColumn(int columnId) const
Returns a description object for a Token column of the collection, given the position of the column.
virtual int numberOfAttributeColumns() const
Returns the number of Attribute columns in the collection.
virtual void copyFrom(const ICollectionDescription &rhs)
make this description a copy of 'rhs'
virtual bool equals(const ICollectionDescription &rhs) const
Check if both Descriptions have the same columns.
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.
virtual const std::string & type() const
Returns the storage technology type of the collection.
bool operator==(const CollectionDescription &rhs) const
Equality operator.
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 sa...
virtual void renameColumn(const std::string &oldName, const std::string &newName)
Renames a column of the collection description.
std::map< std::string, CollectionColumn * > ColumnByName
virtual ~CollectionDescription()
Default destructor.
std::string m_type
Storage technology type of collection.
CollectionDescription(const ICollectionDescription &rhs)
Copy constructor.
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...
virtual int setColumnId(pool::CollectionColumn *column, int id=-1)