Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
CDPL::Grid::AttributedGrid Class Referenceabstract

Abstract base class for grid types that also carry generic key/value properties. More...

#include <AttributedGrid.hpp>

+ Inheritance diagram for CDPL::Grid::AttributedGrid:

Public Types

typedef std::shared_ptr< AttributedGridSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated AttributedGrid instances. More...
 
- Public Types inherited from CDPL::Base::PropertyContainer
typedef PropertyMap::value_type PropertyEntry
 A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More...
 
typedef PropertyMap::const_iterator ConstPropertyIterator
 A constant iterator used to iterate over the property entries. More...
 

Public Member Functions

virtual ~AttributedGrid ()
 Virtual destructor. More...
 
virtual std::size_t getNumElements () const =0
 Returns the total number of grid elements. More...
 
virtual bool isEmpty () const =0
 Tells whether the grid is empty. More...
 
- Public Member Functions inherited from CDPL::Base::PropertyContainer
std::size_t getNumProperties () const
 Returns the number of property entries. More...
 
template<typename T >
void setProperty (const LookupKey &key, T &&val)
 Sets the value of the property specified by key to val. More...
 
template<typename T >
const T & getProperty (const LookupKey &key) const
 Returns the value of the property specified by key as a const reference to an object of type T. More...
 
template<typename T >
const T & getPropertyOrDefault (const LookupKey &key, const T &def_val) const
 Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More...
 
const AnygetProperty (const LookupKey &key, bool throw_=false) const
 Returns the value of the property specified by key. More...
 
bool isPropertySet (const LookupKey &key) const
 Tells whether or not a value has been assigned to the property specified by key. More...
 
ConstPropertyIterator getPropertiesBegin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator getPropertiesEnd () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
ConstPropertyIterator begin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator end () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
bool removeProperty (const LookupKey &key)
 Clears the value of the property specified by key. More...
 
void clearProperties ()
 Clears all property values. More...
 
void addProperties (const PropertyContainer &cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
void copyProperties (const PropertyContainer &cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
void swap (PropertyContainer &cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
const PropertyContainergetProperties () const
 Returns a const reference to itself. More...
 

Protected Member Functions

AttributedGridoperator= (const AttributedGrid &grid)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Base::PropertyContainer
 PropertyContainer ()
 Constructs an empty PropertyContainer instance. More...
 
 PropertyContainer (const PropertyContainer &cntnr)
 Constructs a copy of the PropertyContainer instance cntnr. More...
 
virtual ~PropertyContainer ()
 Virtual destructor. More...
 
PropertyContaineroperator= (const PropertyContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

Abstract base class for grid types that also carry generic key/value properties.

AttributedGrid combines the property-bag interface from Base::PropertyContainer with the minimal grid interface required to know the number of grid elements and whether the grid is empty. Concrete grid types (e.g. Grid::RegularGrid) implement the pure virtual member functions.

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated AttributedGrid instances.

Constructor & Destructor Documentation

◆ ~AttributedGrid()

virtual CDPL::Grid::AttributedGrid::~AttributedGrid ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ getNumElements()

virtual std::size_t CDPL::Grid::AttributedGrid::getNumElements ( ) const
pure virtual

Returns the total number of grid elements.

Returns
The number of grid elements.

Implemented in CDPL::Grid::RegularGrid< T, CVT >.

◆ isEmpty()

virtual bool CDPL::Grid::AttributedGrid::isEmpty ( ) const
pure virtual

Tells whether the grid is empty.

Returns
true if the grid is empty, and false otherwise.

Implemented in CDPL::Grid::RegularGrid< T, CVT >.

◆ operator=()

AttributedGrid& CDPL::Grid::AttributedGrid::operator= ( const AttributedGrid grid)
inlineprotected

Assignment operator.

Parameters
gridThe other AttributedGrid instance.
Returns
A reference to itself.

The documentation for this class was generated from the following file: