5#ifndef COLLECTIONSVC_COLLECTIONDESCRIPTION_H
6#define COLLECTIONSVC_COLLECTIONDESCRIPTION_H
92 const std::string& columnName,
93 const std::string& columnType );
96 const std::string&
name()
const;
An implementation for retrieving a description of a column of a collection.
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.
const CollectionColumn & attributeColumn(int columnId) const
Returns a description object for an Attribute column of the collection, given the position of the col...
static const CollectionColumn & tokenColumn()
Returns a description object for the default Token column of the collection.
void setConnection(const std::string &connection)
Sets the connection to the database containing the collection.
const std::string & name() const
Returns the name of the collection and the top level collection fragment.
ColumnByName m_attributeColumnForColumnName
Map of Attribute CollectionColumn objects using column names as keys.
DbType m_type
Storage technology type of collection.
void checkNewColumnName(const std::string &name) const
std::string m_name
Name of the collection.
int numberOfAttributeColumns() const
Returns the number of Attribute columns in the collection.
void copyFrom(const CollectionDescription &rhs)
make this description a copy of 'rhs'
int setColumnId(const std::string &columnName, int id)
static const pool::CollectionColumn m_tokenColumn
std::map< std::string, int > m_columnIdForColumnName
Map of column ID numbers for column names IDs are unique in the collection.
void setName(const std::string &name)
Sets the name of the collection.
CollectionDescription(CollectionDescription &&)=default
void setType(const DbType &type)
Sets the storage technology type of the collection.
std::vector< pool::CollectionColumn * > m_attributeColumns
Attribute column description objects.
const DbType & type() const
Returns the storage technology type of the collection.
std::string m_connection
Connection to database containing collection.
std::map< std::string, CollectionColumn * > ColumnByName
const CollectionColumn & insertColumn(const std::string &columnName, const std::string &columnType)
Adds a new column to the collection.
int setColumnId(pool::CollectionColumn *column, int id=-1)
CollectionDescription(const CollectionDescription &rhs)
Copy constructor.
CollectionDescription & operator=(const CollectionDescription &rhs)
Assignment operator.
~CollectionDescription()
Default destructor.
const std::string & connection() const
Returns the connection to the database containing the collection.