ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
active::utility::NameID Class Reference

#include <NameID.h>

Inheritance diagram for active::utility::NameID:
Inheritance graph
[legend]
Collaboration diagram for active::utility::NameID:
Collaboration graph
[legend]

Public Types

using Option = std::optional<NameID>
 Optional.
 

Public Member Functions

 NameID ()
 
 NameID (const String &str, const Guid &guid=Guid{})
 
 NameID (const char *str, const Guid &guid=Guid{})
 
 NameID (const Guid &guid, const String &str=String{})
 
bool operator== (const NameID &ref) const
 
bool operator!= (const NameID &ref) const
 
bool operator< (const NameID &ref) const
 
 operator bool () const
 
void clear ()
 

Public Attributes

String name
 
Guid id
 

Detailed Description

A utility class for a form of identity combining a name and guid

Any combination of name and guid can be used, i.e. just name, just guid or both (depending on context). The intention is to provide a single container that can be used in a variety of contexts where names or IDs might both come into play in different combinations

Constructor & Destructor Documentation

◆ NameID() [1/4]

active::utility::NameID::NameID ( )
inline

Default constructor

◆ NameID() [2/4]

active::utility::NameID::NameID ( const String & str,
const Guid & guid = Guid{} )
inline

Constructor

Parameters
strThe identifying name
guidThe guid

◆ NameID() [3/4]

active::utility::NameID::NameID ( const char * str,
const Guid & guid = Guid{} )
inline

Constructor

Parameters
strThe identifying name
guidThe guid

◆ NameID() [4/4]

active::utility::NameID::NameID ( const Guid & guid,
const String & str = String{} )
inline

Constructor

Parameters
guidThe guid
strThe identifying name

Member Function Documentation

◆ clear()

void active::utility::NameID::clear ( )
inline

Clear the guid value

◆ operator bool()

active::utility::NameID::operator bool ( ) const
inline

Conversion operator

Returns
True if the guid has a value (non-nil)

◆ operator!=()

bool active::utility::NameID::operator!= ( const NameID & ref) const
inline

Inequality operator

Parameters
refThe object to compare with this
Returns
True if ref is not equal to this

◆ operator<()

bool active::utility::NameID::operator< ( const NameID & ref) const
inline

Less-than operator

Parameters
refThe object to compare with this
Returns
True if this is less than ref

◆ operator==()

bool active::utility::NameID::operator== ( const NameID & ref) const
inline

Equality operator

Parameters
refThe object to compare with this
Returns
True if ref is equal to this
Here is the caller graph for this function:

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