Chemical Data Processing Library Python API - Version 1.1.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
CDPL.Base.LookupKey Class Reference

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

+ Inheritance diagram for CDPL.Base.LookupKey:

Public Member Functions

None __init__ (LookupKey key)
 Initializes a copy of the LookupKey instance key. More...
 
int getID ()
 Returns the unique numeric identifier associated with the LookupKey instance. More...
 
LookupKey assign (LookupKey key)
 Replaces the current state of self with a copy of the state of the LookupKey instance key. More...
 
str getName ()
 Returns the name of the LookupKey instance. More...
 
None setName (str name)
 Sets the name of the LookupKey instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
bool __lt__ (LookupKey key)
 Less than comparison operator. More...
 
bool __eq__ (LookupKey key)
 Equality comparison operator. More...
 
bool __ne__ (LookupKey key)
 Inequality comparison operator. More...
 
str __str__ ()
 Returns a string representation of the LookupKey instance. More...
 

Static Public Member Functions

LookupKey create (str name)
 Creates a new unique LookupKey instance and registers it under the specified name. More...
 

Static Public Attributes

 NONE = LookupKey('NONE')
 Used to denote an invalid, unused or unspecified key.
 

Properties

 objectID = property(getObjectID)
 
 numericID = property(getID)
 
 name = property(getName, setName)
 

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.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Base.LookupKey.__init__ ( LookupKey  key)

Initializes a copy of the LookupKey instance key.

Parameters
keyThe LookupKey instance to copy.

Member Function Documentation

◆ create()

LookupKey CDPL.Base.LookupKey.create ( str  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.

◆ getID()

int CDPL.Base.LookupKey.getID ( )

Returns the unique numeric identifier associated with the LookupKey instance.

Returns
The unique numeric identifier of the LookupKey instance.

◆ assign()

LookupKey CDPL.Base.LookupKey.assign ( LookupKey  key)

Replaces the current state of self with a copy of the state of the LookupKey instance key.

Parameters
keyThe LookupKey instance to copy.
Returns
self

◆ getName()

str CDPL.Base.LookupKey.getName ( )

Returns the name of the LookupKey instance.

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

◆ setName()

None CDPL.Base.LookupKey.setName ( str  name)

Sets the name of the LookupKey instance.

Parameters
nameThe new name of the LookupKey instance.

◆ getObjectID()

int CDPL.Base.LookupKey.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python LookupKey instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two LookupKey instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ __lt__()

bool CDPL.Base.LookupKey.__lt__ ( LookupKey  key)

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.

◆ __eq__()

bool CDPL.Base.LookupKey.__eq__ ( LookupKey  key)

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.

◆ __ne__()

bool CDPL.Base.LookupKey.__ne__ ( LookupKey  key)

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.

◆ __str__()

str CDPL.Base.LookupKey.__str__ ( )

Returns a string representation of the LookupKey instance.

Returns
The generated string representation.