Drake
TypeSpecificIdentifier< T > Class Template Reference

TypeSpecificIdentifier<T> represents an identifier specifically identifying an entity of type T. More...

#include <drake/automotive/maliput/api/type_specific_identifier.h>

Public Types

typedef T identified_type
 The type whose instances are identified by this TypeSpecificIdentifier. More...
 

Public Member Functions

 TypeSpecificIdentifier (std::string string)
 Constructs a TypeSpecificIdentifier from the given string. More...
 
const std::string & string () const
 Returns the string representation of the TypeSpecificIdentifier. More...
 
bool operator== (const TypeSpecificIdentifier< T > &rhs) const
 Tests for equality with another TypeSpecificIdentifier. More...
 
bool operator!= (const TypeSpecificIdentifier< T > &rhs) const
 Tests for inequality with another TypeSpecificIdentifier, specifically returning the opposite of operator==(). More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 TypeSpecificIdentifier (const TypeSpecificIdentifier &)=default
 
TypeSpecificIdentifieroperator= (const TypeSpecificIdentifier &)=default
 
 TypeSpecificIdentifier (TypeSpecificIdentifier &&)=default
 
TypeSpecificIdentifieroperator= (TypeSpecificIdentifier &&)=default
 

Detailed Description

template<typename T>
class drake::maliput::api::TypeSpecificIdentifier< T >

TypeSpecificIdentifier<T> represents an identifier specifically identifying an entity of type T.

A new TypeSpecificIdentifier is constructed from a non-empty string; TypeSpecificIdentifiers constructed from equal strings are considered to be equal. There is currently no other semantic value attributed to the contents of the string.

Construction from empty strings is not allowed; there is no notion of an "unassigned" value for a TypeSpecificIdentifier. To represent a possibly-unassigned TypeSpecificIdentifier, use drake::optional<TypeSpecificIdentifier<T>>.

TypeSpecificIdentifier is EqualityComparable (and provides == and != operators), but it is not LessThanComparable; there is no particular ordering ascribed to TypeSpecificIdentifier instances. However, TypeSpecificIdentifier does provide a strict weak ordering via a specialization of std::less for use in ordered containers such as std::set and std::map. This ordering may change in future implementations of TypeSpecificIdentifier.

TypeSpecificIdentifier also provides a specialization of std::hash to make it easy to use with std::unordered_set and std::unordered_map.

Member Typedef Documentation

typedef T identified_type

The type whose instances are identified by this TypeSpecificIdentifier.

Constructor & Destructor Documentation

TypeSpecificIdentifier ( const TypeSpecificIdentifier< T > &  )
default
TypeSpecificIdentifier ( std::string  string)
inlineexplicit

Constructs a TypeSpecificIdentifier from the given string.

Exceptions
std::runtime_errorif string is empty.

Member Function Documentation

bool operator!= ( const TypeSpecificIdentifier< T > &  rhs) const
inline

Tests for inequality with another TypeSpecificIdentifier, specifically returning the opposite of operator==().

TypeSpecificIdentifier& operator= ( TypeSpecificIdentifier< T > &&  )
default
TypeSpecificIdentifier& operator= ( const TypeSpecificIdentifier< T > &  )
default
bool operator== ( const TypeSpecificIdentifier< T > &  rhs) const
inline

Tests for equality with another TypeSpecificIdentifier.

const std::string& string ( ) const
inline

Returns the string representation of the TypeSpecificIdentifier.

Here is the caller graph for this function:


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