The ChainCon Software (Release 0.03)
Public Types | Public Member Functions | Private Attributes | List of all members
tCellNames< CellT > Class Template Reference

A class whose instances can be used to generate names of cells with subsequent numbers, in each dimension separately. More...

#include <cellnames.h>

Public Types

typedef CellT CellType
 The type of a cell identifier. More...
 
typedef std::string NameType
 The type of the name of a cell. More...
 

Public Member Functions

 tCellNames ()
 The default constructor of an empty object. More...
 
 tCellNames (const tCellNames< CellT > &c)
 The copy constructor. More...
 
tCellNames< CellT > & operator= (const tCellNames< CellT > &s)
 The assignment operator. More...
 
 ~tCellNames ()
 The destructor. More...
 
void setPrefix (const std::string &s)
 Sets the prefix for cell names. More...
 
void setPostfix (const std::string &s)
 Sets the postfix for cell names. More...
 
std::string operator() (const CellT &c)
 Returns the name of the given cell. More...
 
int maxDim () const
 Returns the smallest strict upper bound for the dimensions of named cells. More...
 
bool operator== (const tCellNames< CellT > &s) const
 The equality operator. More...
 
void swap (tCellNames< CellT > &s)
 Swaps the data with another object. More...
 

Private Attributes

chomp::homology::multitable< chomp::homology::hashedset< CellT > > cells
 An array of sets of cells whose names have been requested. More...
 
std::string prefix
 A prefix for cell names (use none for alphabetic names). More...
 
std::string postfix
 A postfix for cell names. More...
 
int nSets
 The number of sets of encountered cells, indexed by their dimension. More...
 

Detailed Description

template<class CellT>
class tCellNames< CellT >

A class whose instances can be used to generate names of cells with subsequent numbers, in each dimension separately.

Definition at line 61 of file cellnames.h.

Member Typedef Documentation

◆ CellType

template<class CellT>
typedef CellT tCellNames< CellT >::CellType

The type of a cell identifier.

Definition at line 65 of file cellnames.h.

◆ NameType

template<class CellT>
typedef std::string tCellNames< CellT >::NameType

The type of the name of a cell.

Definition at line 68 of file cellnames.h.

Constructor & Destructor Documentation

◆ tCellNames() [1/2]

template<class CellT >
tCellNames< CellT >::tCellNames ( )
inline

The default constructor of an empty object.

Definition at line 126 of file cellnames.h.

◆ tCellNames() [2/2]

template<class CellT >
tCellNames< CellT >::tCellNames ( const tCellNames< CellT > &  c)
inline

The copy constructor.

Definition at line 132 of file cellnames.h.

◆ ~tCellNames()

template<class CellT >
tCellNames< CellT >::~tCellNames ( )
inline

The destructor.

Definition at line 151 of file cellnames.h.

Member Function Documentation

◆ maxDim()

template<class CellT >
int tCellNames< CellT >::maxDim ( ) const
inline

Returns the smallest strict upper bound for the dimensions of named cells.

Definition at line 171 of file cellnames.h.

References tCellNames< CellT >::nSets.

◆ operator()()

template<class CellT >
std::string tCellNames< CellT >::operator() ( const CellT &  c)
inline

Returns the name of the given cell.

Definition at line 177 of file cellnames.h.

References tCellNames< CellT >::cells, tCellNames< CellT >::nSets, tCellNames< CellT >::postfix, and tCellNames< CellT >::prefix.

◆ operator=()

template<class CellT >
tCellNames< CellT > & tCellNames< CellT >::operator= ( const tCellNames< CellT > &  s)
inline

◆ operator==()

template<class CellT >
bool tCellNames< CellT >::operator== ( const tCellNames< CellT > &  s) const
inline

The equality operator.

Definition at line 215 of file cellnames.h.

References tCellNames< CellT >::cells, tCellNames< CellT >::postfix, and tCellNames< CellT >::prefix.

◆ setPostfix()

template<class CellT >
void tCellNames< CellT >::setPostfix ( const std::string &  s)
inline

Sets the postfix for cell names.

This is a string that is appended at the end of every cell name.

Definition at line 164 of file cellnames.h.

References tCellNames< CellT >::postfix.

◆ setPrefix()

template<class CellT >
void tCellNames< CellT >::setPrefix ( const std::string &  s)
inline

Sets the prefix for cell names.

If the prefix is nonempty then the cell names are formed from this perfix with dimension indicator and a subsequent number.

Definition at line 157 of file cellnames.h.

References tCellNames< CellT >::prefix.

◆ swap()

template<class CellT >
void tCellNames< CellT >::swap ( tCellNames< CellT > &  s)
inline

Swaps the data with another object.

Definition at line 222 of file cellnames.h.

References tCellNames< CellT >::cells, tCellNames< CellT >::nSets, tCellNames< CellT >::postfix, and tCellNames< CellT >::prefix.

Member Data Documentation

◆ cells

template<class CellT>
chomp::homology::multitable<chomp::homology::hashedset<CellT> > tCellNames< CellT >::cells
private

An array of sets of cells whose names have been requested.

Definition at line 107 of file cellnames.h.

Referenced by tCellNames< CellT >::operator()(), tCellNames< CellT >::operator=(), tCellNames< CellT >::operator==(), and tCellNames< CellT >::swap().

◆ nSets

template<class CellT>
int tCellNames< CellT >::nSets
private

The number of sets of encountered cells, indexed by their dimension.

In other words, this is the minimal strict upper bound for the dimensions of cells.

Definition at line 119 of file cellnames.h.

Referenced by tCellNames< CellT >::maxDim(), tCellNames< CellT >::operator()(), tCellNames< CellT >::operator=(), and tCellNames< CellT >::swap().

◆ postfix

template<class CellT>
std::string tCellNames< CellT >::postfix
private

◆ prefix

template<class CellT>
std::string tCellNames< CellT >::prefix
private

A prefix for cell names (use none for alphabetic names).

Definition at line 110 of file cellnames.h.

Referenced by tCellNames< CellT >::operator()(), tCellNames< CellT >::operator=(), tCellNames< CellT >::operator==(), tCellNames< CellT >::setPrefix(), and tCellNames< CellT >::swap().


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