5#ifndef COLLECTIONSVC_COLLECTIONDESCRIPTION_H
6#define COLLECTIONSVC_COLLECTIONDESCRIPTION_H
95 const std::string& columnName,
96 const std::string& columnType );
104 const std::string& columnName);
108 virtual const std::string&
name()
const;
An implementation for retrieving a description of a column of a collection.
virtual const std::string & name() const
Returns the name of the collection and the top level collection fragment.
virtual int setColumnId(pool::CollectionColumn *column, int id=-1)
virtual int numberOfTokenColumns() const
Returns the number of Token columns (including the event reference column if it is used)
CollectionDescription(const std::string &name, const DbType &type, const std::string &connection="")
Constructor that takes as input the minimum amount of properties needed to describe the collection.
virtual const std::string & connection() const
Returns the connection to the database containing the collection.
virtual const std::string & eventReferenceColumnName() const
Returns the name reserved for the event reference Token column.
ColumnByName m_attributeColumnForColumnName
Map of Attribute CollectionColumn objects using column names as keys.
DbType m_type
Storage technology type of collection.
std::string m_name
Name of the collection.
virtual int numberOfAttributeColumns() const
Returns the number of Attribute columns in the collection.
virtual const CollectionColumn & tokenColumn(int columnId) const
Returns a description object for a Token column of the collection, given the position of the column.
virtual const CollectionColumn & insertColumn(const std::string &columnName, const std::string &columnType)
Adds a new column to the collection.
virtual void setConnection(const std::string &connection)
Sets the connection to the database containing the collection.
virtual int setColumnId(const std::string &columnName, int id)
virtual ~CollectionDescription()
Default destructor.
std::map< std::string, int > m_columnIdForColumnName
Map of column ID numbers for column names IDs are unique in the collection.
virtual const DbType & type() const
Returns the storage technology type of the collection.
CollectionDescription(CollectionDescription &&)=default
virtual const CollectionColumn & insertTokenColumn(const std::string &columnName)
Adds a new column of type pool::Token to the collection.
std::vector< pool::CollectionColumn * > m_attributeColumns
Attribute column description objects.
virtual const CollectionColumn & attributeColumn(int columnId) const
Returns a description object for an Attribute column of the collection, given the position of the col...
std::string m_connection
Connection to database containing collection.
std::map< std::string, CollectionColumn * > ColumnByName
ColumnByName m_tokenColumnForColumnName
Map of Token CollectionColumn objects using column names as keys.
virtual void setName(const std::string &name)
Sets the name of the collection.
virtual void setType(const DbType &type)
Sets the storage technology type of the collection.
CollectionDescription(const CollectionDescription &rhs)
Copy constructor.
CollectionDescription & operator=(const CollectionDescription &rhs)
Assignment operator.
std::vector< pool::CollectionColumn * > m_tokenColumns
virtual void copyFrom(const CollectionDescription &rhs)
make this description a copy of 'rhs'
virtual pool::CollectionColumn * column(const std::string &columnName)
virtual void checkNewColumnName(const std::string &name) const
std::string m_eventReferenceColumnName
Name of event reference column.