|
SmartSoft Component-Developer API
|
A template class providing an interface for a universal identifier. More...
#include <smartIUniversalId_T.h>
Public Member Functions | |
| IUniversalId () | |
| Default constructor. More... | |
| IUniversalId (const std::string &s_id) | |
| String constructor. More... | |
| virtual | ~IUniversalId ()=default |
| Default destructor. More... | |
| virtual | operator std::string () const |
| conversion operator to std::string More... | |
| virtual IUniversalId & | operator= (const std::string &id) |
| assignment operator from std::string More... | |
| virtual bool | operator== (const IUniversalId &id) const |
| equality comparison operator More... | |
| virtual bool | operator!= (const IUniversalId &id) const |
| inequality comparison operator More... | |
| virtual bool | operator< (const IUniversalId &id) const |
| smaller comparison operator More... | |
| virtual bool | operator> (const IUniversalId &id) const |
| greater comparison operator More... | |
| virtual bool | operator<= (const IUniversalId &id) const |
| smaller-or-equals comparison operator More... | |
| virtual bool | operator>= (const IUniversalId &id) const |
| greater-or-equals comparison operator More... | |
Protected Member Functions | |
| virtual IdType | generateNewId ()=0 |
| generate a new identifier More... | |
| virtual std::string | to_string (const IdType &id) const =0 |
| convert the plaform-specific identifier into a std::string More... | |
| virtual IdType | from_string (const std::string &s_id) const =0 |
| convert an std::string into the platform-specific id representation. More... | |
Protected Attributes | |
| IdType | _id |
| internal (platform-specific) identifier More... | |
A template class providing an interface for a universal identifier.
Universal identifiers are typically platform-specific and need to be implemented for each middleware individually. This template class defines the required interface for a wrapper class of an unique identifier.
|
inline |
Default constructor.
In your derived constructor, please call _id = generateNewId();. This ensures that each new instance of IUniversalId gets a new id.
|
inline |
String constructor.
This constructor used the string representation to create a new id. Please call _id = from_string(s_id); in your derived constructor to convert the string into the id.
| s_id | string representation of the id |
|
virtualdefault |
Default destructor.
|
protectedpure virtual |
convert an std::string into the platform-specific id representation.
Provide a platform-specific implementation of converting string into the platform-specific id representation. This conversion method should not change the internal value of this class.
| s_id | the platform-specific id representation |
|
protectedpure virtual |
generate a new identifier
Provide a platform-specific implementation of generating a new identifier. Typical implementations are incrementing an identifier or generating a random number. This method is only used internally.
|
inlinevirtual |
conversion operator to std::string
|
inlinevirtual |
inequality comparison operator
|
inlinevirtual |
smaller comparison operator
|
inlinevirtual |
smaller-or-equals comparison operator
|
inlinevirtual |
assignment operator from std::string
|
inlinevirtual |
equality comparison operator
|
inlinevirtual |
greater comparison operator
|
inlinevirtual |
greater-or-equals comparison operator
|
protectedpure virtual |
convert the plaform-specific identifier into a std::string
Provide a platform-specific implementation of converting the identifier into a string. This conversion method should not change the internal value of this class.
| id | the platform-specific id representation |
|
protected |
internal (platform-specific) identifier
1.8.13