Rosetta  2020.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
utility::keys::Key Class Referenceabstract

Hidden index key interface class. More...

#include <Key.hh>

Public Types

typedef std::size_t index_type
 
typedef std::size_t size_type
 
typedef std::size_t Index
 
typedef std::size_t Size
 

Public Member Functions

virtual Keyclone () const =0
 Clone this. More...
 
virtual ~Key ()
 Destructor. More...
 
Keyoperator= (Key const &key)
 Copy assignment. More...
 
virtual std::string const & id () const =0
 ID. More...
 
virtual std::string & id ()=0
 ID. More...
 
virtual Keyid (std::string const &id_a)=0
 ID assignment. More...
 
virtual std::string const & identifier () const =0
 Identifier. More...
 
virtual std::string & identifier ()=0
 Identifier. More...
 
virtual Keyidentifier (std::string const &identifier_a)=0
 Identifier assignment. More...
 
virtual std::string const & code () const =0
 Code. More...
 
virtual std::string & code ()=0
 Code. More...
 
virtual Keycode (std::string const &code_a)=0
 Code assignment. More...
 
virtual Index private_index () const =0
 Index. More...
 

Protected Member Functions

 Key ()=default
 Default constructor. More...
 
 Key (Key const &)=default
 Copy constructor. More...
 
virtual void assign_Key (Key const &key)=0
 Key assignment. More...
 
 operator Index () const
 Index value conversion. More...
 
virtual Index index () const =0
 Index. More...
 
virtual Indexindex ()=0
 Index. More...
 
virtual Keyindex (Index const index_a)=0
 Index assignment. More...
 
virtual bool equals (Key const &key) const =0
 Equal to a Key? More...
 
virtual bool less_than (Key const &key) const =0
 Less than a Key? More...
 
virtual bool comparable (Key const &key) const =0
 Comparable to a Key? More...
 

Friends

template<typename O , typename S , typename C >
class AutoKey
 
template<typename O , typename S , typename C >
class UserKey
 
template<typename T , typename U >
class KeyLess
 
template<typename T , typename U >
class PointerKeyLess
 
bool operator== (Key const &a, Key const &b)
 Key == Key. More...
 
bool operator!= (Key const &a, Key const &b)
 Key != Key. More...
 
bool operator< (Key const &a, Key const &b)
 Key < Key. More...
 
bool operator<= (Key const &a, Key const &b)
 Key <= Key. More...
 
bool operator>= (Key const &a, Key const &b)
 Key >= Key. More...
 
bool operator> (Key const &a, Key const &b)
 Key > Key. More...
 
bool comparable (Key const &a, Key const &b)
 Are Keys of Comparable Types? More...
 

Detailed Description

Hidden index key interface class.

Member Typedef Documentation

Constructor & Destructor Documentation

utility::keys::Key::Key ( )
inlineprotecteddefault

Default constructor.

utility::keys::Key::Key ( Key const &  )
inlineprotecteddefault

Copy constructor.

virtual utility::keys::Key::~Key ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void utility::keys::Key::assign_Key ( Key const &  key)
protectedpure virtual

Key assignment.

Referenced by operator=().

virtual Key* utility::keys::Key::clone ( ) const
pure virtual

Clone this.

virtual std::string const& utility::keys::Key::code ( ) const
pure virtual
virtual std::string& utility::keys::Key::code ( )
pure virtual

Code.

virtual Key& utility::keys::Key::code ( std::string const &  code_a)
pure virtual

Code assignment.

virtual bool utility::keys::Key::comparable ( Key const &  key) const
protectedpure virtual

Comparable to a Key?

virtual bool utility::keys::Key::equals ( Key const &  key) const
protectedpure virtual
virtual std::string const& utility::keys::Key::id ( ) const
pure virtual
virtual std::string& utility::keys::Key::id ( )
pure virtual

ID.

virtual Key& utility::keys::Key::id ( std::string const &  id_a)
pure virtual

ID assignment.

virtual std::string const& utility::keys::Key::identifier ( ) const
pure virtual
virtual std::string& utility::keys::Key::identifier ( )
pure virtual

Identifier.

virtual Key& utility::keys::Key::identifier ( std::string const &  identifier_a)
pure virtual

Identifier assignment.

virtual Index utility::keys::Key::index ( ) const
protectedpure virtual
virtual Index& utility::keys::Key::index ( )
protectedpure virtual

Index.

virtual Key& utility::keys::Key::index ( Index const  index_a)
protectedpure virtual

Index assignment.

virtual bool utility::keys::Key::less_than ( Key const &  key) const
protectedpure virtual
utility::keys::Key::operator Index ( ) const
inlineprotected

Index value conversion.

Note
A pure virtual version of this slows down key lookup operations because it prevents inlining for derived key types

References index().

Key& utility::keys::Key::operator= ( Key const &  key)
inline

Copy assignment.

References assign_Key().

virtual Index utility::keys::Key::private_index ( ) const
pure virtual

Index.

Note
Only for use as an optimization: DO NOT WRITE CODE DEPENDING ON THE SPECIFIC INDEX VALUE!

Friends And Related Function Documentation

template<typename O , typename S , typename C >
friend class AutoKey
friend
bool comparable ( Key const &  a,
Key const &  b 
)
friend

Are Keys of Comparable Types?

Referenced by utility::keys::comparable().

template<typename T , typename U >
friend class KeyLess
friend
bool operator!= ( Key const &  a,
Key const &  b 
)
friend

Key != Key.

Note
TYpe and index-based polymorphic equality
bool operator< ( Key const &  a,
Key const &  b 
)
friend

Key < Key.

Note
Index-based ordering
Needed for use as key in associative containers
bool operator<= ( Key const &  a,
Key const &  b 
)
friend

Key <= Key.

Note
Index-based ordering
Needed for use as key in associative containers
bool operator== ( Key const &  a,
Key const &  b 
)
friend

Key == Key.

Note
TYpe and index-based polymorphic equality
bool operator> ( Key const &  a,
Key const &  b 
)
friend

Key > Key.

Note
Index-based ordering
Needed for use as key in associative containers
bool operator>= ( Key const &  a,
Key const &  b 
)
friend

Key >= Key.

Note
Index-based ordering
Needed for use as key in associative containers
template<typename T , typename U >
friend class PointerKeyLess
friend
template<typename O , typename S , typename C >
friend class UserKey
friend

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