matador::basic_identifier Class Referenceabstract

#include <basic_identifier.hpp>

Public Member Functions

basic_identifieroperator= (const basic_identifier &)=default
 Default copy assignment constructor.
 
basic_identifieroperator= (basic_identifier &&)=default
 Default move assignment constructor.
 
 basic_identifier (const basic_identifier &)=default
 Default copy constructor.
 
 basic_identifier (basic_identifier &&)=default
 Default move constructor.
 
bool operator== (const basic_identifier &x) const
 
bool operator!= (const basic_identifier &x) const
 
bool operator< (const basic_identifier &x) const
 
virtual bool less (const basic_identifier &x) const =0
 
virtual bool equal_to (const basic_identifier &x) const =0
 
virtual void serialize (const char *id, serializer &s)=0
 
virtual size_t hash () const =0
 
virtual bool is_same_type (const basic_identifier &x) const =0
 
virtual basic_identifierclone () const =0
 
virtual std::ostream & print (std::ostream &out) const =0
 
virtual bool is_valid () const =0
 
bool as_value () const
 
void as_value (bool asvalue)
 

Protected Member Functions

virtual const std::type_index & type_index () const =0
 

Friends

class basic_identifier_serializer
 
template<typename T , class Enable >
class identifier
 
OOS_UTILS_API std::ostream & operator<< (std::ostream &os, const basic_identifier &x)
 

Detailed Description

This is the base class for any identifier class It supports interfaces for comparing, sharing and cloning It also implements the output operator to streams and a generic method to retrieve the value of the concrete identifier.

Member Function Documentation

◆ as_value() [1/2]

bool matador::basic_identifier::as_value ( ) const

Returns true if identifier should be treated as plain value (default)

Returns
True if treated as plain value

◆ as_value() [2/2]

void matador::basic_identifier::as_value ( bool  asvalue)

Sets flag indicating that identifier id treated as plain value (default)

Parameters
asvalueTrue if identifier should be treated as plain value.

◆ clone()

virtual basic_identifier * matador::basic_identifier::clone ( ) const
pure virtual

Clone this identifier

Returns
The cloned identifier

◆ equal_to()

virtual bool matador::basic_identifier::equal_to ( const basic_identifier x) const
pure virtual

Interface for the equal to operator

Parameters
xThe identifier to compare to
Returns
True if both identifiers are equal

◆ hash()

virtual size_t matador::basic_identifier::hash ( ) const
pure virtual

Returns a unique hash number

Returns
A unique hash number

◆ is_same_type()

virtual bool matador::basic_identifier::is_same_type ( const basic_identifier x) const
pure virtual

Returns true if the given identifier is of the same type as this identifier

Parameters
xIdentifier to compare the type with
Returns
True if their types are equal

◆ is_valid()

virtual bool matador::basic_identifier::is_valid ( ) const
pure virtual

Returns true if the identifier has a valid value.

Returns
True id identifier is valid.

◆ less()

virtual bool matador::basic_identifier::less ( const basic_identifier x) const
pure virtual

Interface for the less than operator

Parameters
xThe identifier to compare to
Returns
True if this identifier is less than another identifier

◆ operator!=()

bool matador::basic_identifier::operator!= ( const basic_identifier x) const

Checks if two identifiers are not equal

Parameters
xThe identifier to compare with
Returns
True if identifiers are not equal

◆ operator<()

bool matador::basic_identifier::operator< ( const basic_identifier x) const

Checks if this identifier is less than another identifier.

Parameters
xThe identifier to compare with
Returns
True this identifier is less than another identifier

◆ operator=() [1/2]

basic_identifier & matador::basic_identifier::operator= ( basic_identifier &&  )
default

Default move assignment constructor.

Returns
The moved identifier object

◆ operator=() [2/2]

basic_identifier & matador::basic_identifier::operator= ( const basic_identifier )
default

Default copy assignment constructor.

Returns
The copied identifier object

◆ operator==()

bool matador::basic_identifier::operator== ( const basic_identifier x) const

Checks if two identifiers are equal

Parameters
xThe identifier to compare with
Returns
True if identifiers are equal

◆ print()

virtual std::ostream & matador::basic_identifier::print ( std::ostream &  out) const
pure virtual

Prints the identifier to the given stream.

Parameters
outThe stream to write to

◆ serialize()

virtual void matador::basic_identifier::serialize ( const char *  id,
serializer s 
)
pure virtual

Serializes the underlying identifier value

Parameters
idThe id of the identifier value
sThe serializer to be used

◆ type_index()

virtual const std::type_index & matador::basic_identifier::type_index ( ) const
protectedpure virtual

The returns the type_index of a specific type

Returns
The specific type_index

Friends And Related Symbol Documentation

◆ operator<<

OOS_UTILS_API std::ostream & operator<< ( std::ostream &  os,
const basic_identifier x 
)
friend

Writes the given identifier to the given ostream.

Parameters
osThe ostream to write to.
xThe identifier to write.
Returns
Reference to the ostream.

The documentation for this class was generated from the following file:
  • matador/utils/basic_identifier.hpp