![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Data structure for the storage of imported MMCIF data (see [MMCIF]). More...
#include <MMCIFData.hpp>
Classes | |
| class | Category |
| A single mmCIF data category, holding an ordered list of data items (columns). More... | |
| class | Item |
| A single data item (column) of an mmCIF category, holding an ordered list of string values. More... | |
Public Types | |
| typedef std::shared_ptr< MMCIFData > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated MMCIFData instances. More... | |
| typedef CategoryList::const_iterator | ConstCategoryIterator |
| A constant iterator over the categories of the data record. More... | |
| typedef CategoryList::iterator | CategoryIterator |
| A mutable iterator over the categories of the data record. More... | |
Public Member Functions | |
| MMCIFData ()=default | |
Constructs an empty MMCIFData instance with an empty data-block ID. More... | |
| MMCIFData (const std::string &id) | |
Constructs an empty MMCIFData instance with the data-block ID id. More... | |
| void | setID (const std::string &id) |
| Sets the mmCIF data-block ID to id. More... | |
| const std::string & | getID () const |
| Returns the mmCIF data-block ID. More... | |
| void | clear () |
| Removes all categories from the data record (without changing the data-block ID). More... | |
| std::size_t | getNumCategories () const |
| Returns the number of categories in the data record. More... | |
| Category & | getCategory (std::size_t index) |
| Returns a mutable reference to the category at the zero-based index index. More... | |
| const Category & | getCategory (std::size_t index) const |
Returns a const reference to the category at the zero-based index index. More... | |
| Category & | getCategory (const std::string &name) |
| Returns a mutable reference to the category with name name. More... | |
| const Category & | getCategory (const std::string &name) const |
Returns a const reference to the category with name name. More... | |
| const Category * | findCategory (const std::string &name) const |
Returns a pointer to the category with name name, or nullptr if no matching category exists. More... | |
| Category * | findCategory (const std::string &name) |
Returns a mutable pointer to the category with name name, or nullptr if no matching category exists. More... | |
| const Category & | lastCategory () const |
Returns a const reference to the last category of the data record. More... | |
| Category & | lastCategory () |
| Returns a mutable reference to the last category of the data record. More... | |
| Category & | addCategory (const std::string &name, bool front=false) |
| Adds a new (empty) category with name name to the data record. More... | |
| CategoryIterator | removeCategory (const CategoryIterator &it) |
| Removes the category pointed to by the iterator it. More... | |
| bool | removeCategory (const std::string &name) |
| Removes the category with name name. More... | |
| void | removeCategory (std::size_t index) |
| Removes the category at the zero-based index index. More... | |
| void | swap (MMCIFData &data) |
| Swaps the contents of this data record with those of data. More... | |
| ConstCategoryIterator | getCategoriesBegin () const |
| Returns a constant iterator pointing to the beginning of the category list. More... | |
| CategoryIterator | getCategoriesBegin () |
| Returns a mutable iterator pointing to the beginning of the category list. More... | |
| ConstCategoryIterator | getCategoriesEnd () const |
| Returns a constant iterator pointing one past the last category. More... | |
| CategoryIterator | getCategoriesEnd () |
| Returns a mutable iterator pointing one past the last category. More... | |
| ConstCategoryIterator | begin () const |
| Returns a constant iterator pointing to the beginning of the category list (alias of getCategoriesBegin()). More... | |
| CategoryIterator | begin () |
| Returns a mutable iterator pointing to the beginning of the category list (alias of getCategoriesBegin()). More... | |
| ConstCategoryIterator | end () const |
| Returns a constant iterator pointing one past the last category (alias of getCategoriesEnd()). More... | |
| CategoryIterator | end () |
| Returns a mutable iterator pointing one past the last category (alias of getCategoriesEnd()). More... | |
Data structure for the storage of imported MMCIF data (see [MMCIF]).
| typedef std::shared_ptr<MMCIFData> CDPL::Biomol::MMCIFData::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated MMCIFData instances.
| typedef CategoryList::const_iterator CDPL::Biomol::MMCIFData::ConstCategoryIterator |
A constant iterator over the categories of the data record.
| typedef CategoryList::iterator CDPL::Biomol::MMCIFData::CategoryIterator |
A mutable iterator over the categories of the data record.
|
default |
Constructs an empty MMCIFData instance with an empty data-block ID.
| CDPL::Biomol::MMCIFData::MMCIFData | ( | const std::string & | id | ) |
Constructs an empty MMCIFData instance with the data-block ID id.
| id | The mmCIF data-block ID. |
| void CDPL::Biomol::MMCIFData::setID | ( | const std::string & | id | ) |
Sets the mmCIF data-block ID to id.
| id | The new data-block ID. |
| const std::string& CDPL::Biomol::MMCIFData::getID | ( | ) | const |
Returns the mmCIF data-block ID.
const reference to the data-block ID. | void CDPL::Biomol::MMCIFData::clear | ( | ) |
Removes all categories from the data record (without changing the data-block ID).
| std::size_t CDPL::Biomol::MMCIFData::getNumCategories | ( | ) | const |
Returns the number of categories in the data record.
| Category& CDPL::Biomol::MMCIFData::getCategory | ( | std::size_t | index | ) |
Returns a mutable reference to the category at the zero-based index index.
| index | The zero-based category index. |
| Base::IndexError | if the number of categories is zero or index is not in the range [0, getNumCategories() - 1]. |
| const Category& CDPL::Biomol::MMCIFData::getCategory | ( | std::size_t | index | ) | const |
Returns a const reference to the category at the zero-based index index.
| index | The zero-based category index. |
const reference to the category. | Base::IndexError | if the number of categories is zero or index is not in the range [0, getNumCategories() - 1]. |
| Category& CDPL::Biomol::MMCIFData::getCategory | ( | const std::string & | name | ) |
Returns a mutable reference to the category with name name.
| name | The mmCIF category name (without the leading underscore). |
| Base::ItemNotFound | if no matching category exists. |
| const Category& CDPL::Biomol::MMCIFData::getCategory | ( | const std::string & | name | ) | const |
Returns a const reference to the category with name name.
| name | The mmCIF category name (without the leading underscore). |
const reference to the matching category. | Base::ItemNotFound | if no matching category exists. |
| const Category* CDPL::Biomol::MMCIFData::findCategory | ( | const std::string & | name | ) | const |
Returns a pointer to the category with name name, or nullptr if no matching category exists.
| name | The mmCIF category name (without the leading underscore). |
const pointer to the matching category, or nullptr. | Category* CDPL::Biomol::MMCIFData::findCategory | ( | const std::string & | name | ) |
Returns a mutable pointer to the category with name name, or nullptr if no matching category exists.
| name | The mmCIF category name (without the leading underscore). |
nullptr. | const Category& CDPL::Biomol::MMCIFData::lastCategory | ( | ) | const |
Returns a const reference to the last category of the data record.
const reference to the last category. | Base::OperationFailed | if the data record is empty. |
| Category& CDPL::Biomol::MMCIFData::lastCategory | ( | ) |
Returns a mutable reference to the last category of the data record.
| Base::OperationFailed | if the data record is empty. |
Adds a new (empty) category with name name to the data record.
If a category with the given name already exists, no new category is added and a reference to the existing category is returned.
| name | The mmCIF category name (without the leading underscore). |
| front | If true, the new category is inserted at the front of the category list; if false, it is appended. |
| CategoryIterator CDPL::Biomol::MMCIFData::removeCategory | ( | const CategoryIterator & | it | ) |
Removes the category pointed to by the iterator it.
| it | An iterator pointing to the category to remove. |
| bool CDPL::Biomol::MMCIFData::removeCategory | ( | const std::string & | name | ) |
Removes the category with name name.
| name | The mmCIF category name (without the leading underscore). |
true if a matching category was removed, and false if no such category existed. | void CDPL::Biomol::MMCIFData::removeCategory | ( | std::size_t | index | ) |
Removes the category at the zero-based index index.
| index | The zero-based category index. |
| Base::IndexError | if the number of categories is zero or index is not in the range [0, getNumCategories() - 1]. |
| void CDPL::Biomol::MMCIFData::swap | ( | MMCIFData & | data | ) |
Swaps the contents of this data record with those of data.
| data | The other data record to swap with. |
| ConstCategoryIterator CDPL::Biomol::MMCIFData::getCategoriesBegin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the category list.
| CategoryIterator CDPL::Biomol::MMCIFData::getCategoriesBegin | ( | ) |
Returns a mutable iterator pointing to the beginning of the category list.
| ConstCategoryIterator CDPL::Biomol::MMCIFData::getCategoriesEnd | ( | ) | const |
Returns a constant iterator pointing one past the last category.
| CategoryIterator CDPL::Biomol::MMCIFData::getCategoriesEnd | ( | ) |
Returns a mutable iterator pointing one past the last category.
| ConstCategoryIterator CDPL::Biomol::MMCIFData::begin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the category list (alias of getCategoriesBegin()).
| CategoryIterator CDPL::Biomol::MMCIFData::begin | ( | ) |
Returns a mutable iterator pointing to the beginning of the category list (alias of getCategoriesBegin()).
| ConstCategoryIterator CDPL::Biomol::MMCIFData::end | ( | ) | const |
Returns a constant iterator pointing one past the last category (alias of getCategoriesEnd()).
| CategoryIterator CDPL::Biomol::MMCIFData::end | ( | ) |
Returns a mutable iterator pointing one past the last category (alias of getCategoriesEnd()).