CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB::Indexed< _Base > Class Template Reference

#include <Named.hh>

+ Inheritance diagram for CASM::DB::Indexed< _Base >:

Detailed Description

template<typename _Base>
class CASM::DB::Indexed< _Base >

Similar to 'Named', but includes an incrementing 'id' string

  • Setting id should be done through Database<Derived> implementations of insert or emplace.
  • Use one of Indexed or Named

Definition at line 57 of file Named.hh.

Public Types

typedef Named< _Base > Base
 
typedef Base::MostDerived MostDerived
 

Public Member Functions

 Indexed ()
 
std::string id () const
 
std::string name () const
 
std::string alias () const
 Return "alias" if object stored in database and alias exists, return empty string otherwise. More...
 

Protected Member Functions

void clear_name () const
 Unset "id" and "name", if object is modified. More...
 
void set_id (Index _id) const
 Set id. More...
 
void set_id (std::string _id) const
 Set id. More...
 
void regenerate_name () const
 Regenerate "name". More...
 
void set_name (std::string _name) const
 Set "name", explicity. More...
 

Private Attributes

friend ValDatabase< MostDerived >
 
std::string m_id
 
std::string m_name
 

Member Typedef Documentation

◆ Base

template<typename _Base >
typedef Named<_Base> CASM::DB::Indexed< _Base >::Base

Definition at line 59 of file Named.hh.

◆ MostDerived

template<typename _Base >
typedef Base::MostDerived CASM::DB::Indexed< _Base >::MostDerived

Definition at line 60 of file Named.hh.

Constructor & Destructor Documentation

◆ Indexed()

template<typename _Base >
CASM::DB::Indexed< _Base >::Indexed

Definition at line 47 of file Named_impl.hh.

Member Function Documentation

◆ alias()

std::string CASM::DB::Named< _Base >::alias
inherited

Return "alias" if object stored in database and alias exists, return empty string otherwise.

Definition at line 34 of file Named_impl.hh.

◆ clear_name()

template<typename _Base >
void CASM::DB::Indexed< _Base >::clear_name
protected

Unset "id" and "name", if object is modified.

Definition at line 65 of file Named_impl.hh.

◆ id()

template<typename _Base >
std::string CASM::DB::Indexed< _Base >::id

Definition at line 50 of file Named_impl.hh.

◆ name()

template<typename _Base >
std::string CASM::DB::Indexed< _Base >::name

Definition at line 56 of file Named_impl.hh.

◆ regenerate_name()

void CASM::DB::Named< _Base >::regenerate_name
protectedinherited

Regenerate "name".

Definition at line 41 of file Named_impl.hh.

◆ set_id() [1/2]

template<typename _Base >
void CASM::DB::Indexed< _Base >::set_id ( Index  _id) const
protected

Set id.

Setting id should be done through Database<Derived> implementations

  • protected, to allow reading Derived from database and setting id

Definition at line 76 of file Named_impl.hh.

◆ set_id() [2/2]

template<typename _Base >
void CASM::DB::Indexed< _Base >::set_id ( std::string  _id) const
protected

Set id.

Setting id should be done through Database<Derived> implementations

  • protected, to allow reading Derived from database and setting id

Definition at line 86 of file Named_impl.hh.

◆ set_name()

void CASM::DB::Named< _Base >::set_name ( std::string  _name) const
protectedinherited

Set "name", explicity.

Set "name", explicity modified.

Definition at line 44 of file Named_impl.hh.

Member Data Documentation

◆ m_id

template<typename _Base >
std::string CASM::DB::Indexed< _Base >::m_id
mutableprivate

Definition at line 93 of file Named.hh.

◆ m_name

std::string CASM::DB::Named< _Base >::m_name
mutableprivateinherited

Definition at line 47 of file Named.hh.

◆ ValDatabase< MostDerived >

template<typename _Base >
friend CASM::DB::Indexed< _Base >::ValDatabase< MostDerived >
private

Definition at line 91 of file Named.hh.


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