Chemical Data Processing Library C++ API - Version 1.1.1
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
CDPL::Base::LookupKey Class Reference

An unique lookup key for control-parameter and property values. More...

#include <LookupKey.hpp>

Classes

struct  HashFunc
 A functor class implementing the generation of hash codes for LookupKey instances. More...
 

Public Member Functions

void setName (const std::string &name) const
 Sets the name of the LookupKey instance. More...
 
const std::string & getName () const
 Returns the name of the LookupKey instance. More...
 
std::size_t getID () const
 Returns the unique numeric identifier associated with the LookupKey instance. More...
 
bool operator< (const LookupKey &key) const
 Less than comparison operator. More...
 
bool operator== (const LookupKey &key) const
 Equality comparison operator. More...
 
bool operator!= (const LookupKey &key) const
 Inequality comparison operator. More...
 

Static Public Member Functions

static LookupKey create (const std::string &name)
 Creates a new unique LookupKey instance and registers it under the specified name. More...
 

Static Public Attributes

static const LookupKey NONE
 Used to denote an invalid, unused or unspecified key. More...
 

Detailed Description

An unique lookup key for control-parameter and property values.

LookupKey has a private default constructor and a public copy constructor. The creation of not copy constructed new instances is only possible by the method create(const std::string& name). LookupKey instances created by this method are guaranteed to be unique (given that the internal instance counter of type std::size_t does not overflow), i.e. the created instance is not a copy of an existing key and does not compare equal to any instance created before or afterwards.

Member Function Documentation

◆ create()

static LookupKey CDPL::Base::LookupKey::create ( const std::string &  name)
static

Creates a new unique LookupKey instance and registers it under the specified name.

LookupKey instances created by this method are guaranteed to be unique (given that the internal instance counter of type std::size_t does not overflow), i.e. the instance is not a copy of an existing key and does not compare equal to any instance created before or afterwards.

Parameters
nameThe name of the LookupKey instance.
Returns
A new unique LookupKey instance.

◆ setName()

void CDPL::Base::LookupKey::setName ( const std::string &  name) const

Sets the name of the LookupKey instance.

Parameters
nameThe new name of the LookupKey instance.

◆ getName()

const std::string& CDPL::Base::LookupKey::getName ( ) const

Returns the name of the LookupKey instance.

Returns
The name of the LookupKey instance.
Exceptions
Base::ItemNotFoundif the requested name could not be found.

◆ getID()

std::size_t CDPL::Base::LookupKey::getID ( ) const
inline

Returns the unique numeric identifier associated with the LookupKey instance.

Returns
The unique numeric identifier of the LookupKey instance.

◆ operator<()

bool CDPL::Base::LookupKey::operator< ( const LookupKey key) const
inline

Less than comparison operator.

Parameters
keyThe other LookupKey instance to be compared with.
Returns
true if the numeric identifier of this instance is smaller than the identifier of key, and false otherwise.

◆ operator==()

bool CDPL::Base::LookupKey::operator== ( const LookupKey key) const
inline

Equality comparison operator.

Parameters
keyThe other LookupKey instance to be compared with.
Returns
true if the numeric identifiers of the keys are equal, and false otherwise.

◆ operator!=()

bool CDPL::Base::LookupKey::operator!= ( const LookupKey key) const
inline

Inequality comparison operator.

Parameters
keyThe other LookupKey instance to be compared with.
Returns
true if the numeric identifiers of the keys are not equal, and false otherwise.

Member Data Documentation

◆ NONE

const LookupKey CDPL::Base::LookupKey::NONE
static

Used to denote an invalid, unused or unspecified key.


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