Rosetta  2019.40
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes | Friends | List of all members
utility::keys::AutoKey< O, S, C > Class Template Referenceabstract

Automatic hidden index key abstract base class. More...

#include <AutoKey.hh>

Inheritance diagram for utility::keys::AutoKey< O, S, C >:
Inheritance graph
[legend]

Public Types

typedef utility::keys::Key Key
 
typedefobject_type
 
typedef std::size_t index_type
 
typedef std::size_t size_type
 
typedefObject
 
typedef std::size_t Index
 
typedef std::size_t Size
 

Public Member Functions

AutoKeyclone () const override=0
 Clone this. More...
 
 ~AutoKey () override
 Destructor. More...
 
AutoKeyoperator= (AutoKey const &key)
 Copy assignment. More...
 
AutoKeyoperator= (Key const &key)
 Key assignment. More...
 
std::string const & id () const override
 ID. More...
 
std::string & id () override
 ID. More...
 
AutoKeyid (std::string const &id_a) override
 ID assignment. More...
 
std::string const & identifier () const override
 Identifier. More...
 
std::string & identifier () override
 Identifier. More...
 
AutoKeyidentifier (std::string const &identifier_a) override
 Identifier assignment. More...
 
std::string const & code () const override
 Code. More...
 
std::string & code () override
 Code. More...
 
AutoKeycode (std::string const &code_a) override
 Code assignment. More...
 
Index private_index () const override
 Index. More...
 

Static Public Member Functions

static Size n_key ()
 Number of keys with distinct indexes. More...
 

Protected Member Functions

 AutoKey ()
 Default constructor. More...
 
 AutoKey (AutoKey const &key)
 Copy constructor. More...
 
 AutoKey (AutoKey const &key, std::string const &id_a, std::string const &identifier_a=std::string(), std::string const &code_a=std::string())
 Copy + identifier constructor. More...
 
 AutoKey (Key const &key)
 Key constructor. More...
 
 AutoKey (Key const &key, std::string const &id_a, std::string const &identifier_a=std::string(), std::string const &code_a=std::string())
 Key + identifier constructor. More...
 
 AutoKey (std::string const &id_a, std::string const &identifier_a=std::string(), std::string const &code_a=std::string())
 Identifier constructor. More...
 
void assign_Key (Key const &key) override
 Key assignment. More...
 
 operator Index () const
 Index value conversion. More...
 
Index index () const override
 Index. More...
 
Indexindex () override
 Index. More...
 
AutoKeyindex (Index const index_a) override
 Index assignment. More...
 
bool equals (Key const &key) const override
 Equal to a Key? More...
 
bool less_than (Key const &key) const override
 Less than a Key? More...
 
bool comparable (Key const &key) const override
 Comparable to a Key? More...
 

Private Types

typedef S Super
 

Static Private Member Functions

static Sizen_key_ ()
 Number of keys with distinct indexes. More...
 
static Size next_index ()
 Increment the index counter and return it. More...
 

Private Attributes

Index index_
 Index. More...
 
std::string id_
 ID: Short identifier. More...
 
std::string identifier_
 Identifier: Long identifier. More...
 
std::string code_
 Code: Coded identifier. More...
 

Friends

bool operator== (AutoKey const &a, AutoKey const &b)
 AutoKey == AutoKey. More...
 
bool operator!= (AutoKey const &a, AutoKey const &b)
 AutoKey != AutoKey. More...
 
bool operator< (AutoKey const &a, AutoKey const &b)
 AutoKey < AutoKey. More...
 
bool operator<= (AutoKey const &a, AutoKey const &b)
 AutoKey <= AutoKey. More...
 
bool operator>= (AutoKey const &a, AutoKey const &b)
 AutoKey >= AutoKey. More...
 
bool operator> (AutoKey const &a, AutoKey const &b)
 AutoKey > AutoKey. More...
 
template<typename UO , typename US , typename UC >
bool sequential (AutoKey< UO, US, UC > const &a, AutoKey< UO, US, UC > const &b)
 AutoKeys are sequential? More...
 

Detailed Description

template<typename O, typename S = Key, typename C = NoClient>
class utility::keys::AutoKey< O, S, C >

Automatic hidden index key abstract base class.

Member Typedef Documentation

template<typename O, typename S = Key, typename C = NoClient>
typedef std::size_t utility::keys::AutoKey< O, S, C >::Index
template<typename O, typename S = Key, typename C = NoClient>
typedef std::size_t utility::keys::AutoKey< O, S, C >::index_type
template<typename O, typename S = Key, typename C = NoClient>
typedef utility::keys::Key utility::keys::AutoKey< O, S, C >::Key
template<typename O, typename S = Key, typename C = NoClient>
typedef O utility::keys::AutoKey< O, S, C >::Object
template<typename O, typename S = Key, typename C = NoClient>
typedef O utility::keys::AutoKey< O, S, C >::object_type
template<typename O, typename S = Key, typename C = NoClient>
typedef std::size_t utility::keys::AutoKey< O, S, C >::Size
template<typename O, typename S = Key, typename C = NoClient>
typedef std::size_t utility::keys::AutoKey< O, S, C >::size_type
template<typename O, typename S = Key, typename C = NoClient>
typedef S utility::keys::AutoKey< O, S, C >::Super
private

Constructor & Destructor Documentation

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( )
inlineprotected

Default constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( AutoKey< O, S, C > const &  key)
inlineprotected

Copy constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( AutoKey< O, S, C > const &  key,
std::string const &  id_a,
std::string const &  identifier_a = std::string(),
std::string const &  code_a = std::string() 
)
inlineprotected

Copy + identifier constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( Key const &  key)
inlineexplicitprotected

Key constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( Key const &  key,
std::string const &  id_a,
std::string const &  identifier_a = std::string(),
std::string const &  code_a = std::string() 
)
inlineprotected

Key + identifier constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::AutoKey ( std::string const &  id_a,
std::string const &  identifier_a = std::string(),
std::string const &  code_a = std::string() 
)
inlineexplicitprotected

Identifier constructor.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::~AutoKey ( )
inlineoverride

Destructor.

Member Function Documentation

template<typename O, typename S = Key, typename C = NoClient>
void utility::keys::AutoKey< O, S, C >::assign_Key ( Key const &  key)
inlineoverrideprotected
template<typename O, typename S = Key, typename C = NoClient>
AutoKey* utility::keys::AutoKey< O, S, C >::clone ( ) const
overridepure virtual
template<typename O, typename S = Key, typename C = NoClient>
std::string const& utility::keys::AutoKey< O, S, C >::code ( ) const
inlineoverride
template<typename O, typename S = Key, typename C = NoClient>
std::string& utility::keys::AutoKey< O, S, C >::code ( )
inlineoverride

Code.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::code ( std::string const &  code_a)
inlineoverride

Code assignment.

template<typename O, typename S = Key, typename C = NoClient>
bool utility::keys::AutoKey< O, S, C >::comparable ( Key const &  key) const
inlineoverrideprotected

Comparable to a Key?

Referenced by utility::keys::AutoKey< Option >::assign_Key().

template<typename O, typename S = Key, typename C = NoClient>
bool utility::keys::AutoKey< O, S, C >::equals ( Key const &  key) const
inlineoverrideprotected

Equal to a Key?

template<typename O, typename S = Key, typename C = NoClient>
std::string const& utility::keys::AutoKey< O, S, C >::id ( ) const
inlineoverride
template<typename O, typename S = Key, typename C = NoClient>
std::string& utility::keys::AutoKey< O, S, C >::id ( )
inlineoverride

ID.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::id ( std::string const &  id_a)
inlineoverride

ID assignment.

template<typename O, typename S = Key, typename C = NoClient>
std::string const& utility::keys::AutoKey< O, S, C >::identifier ( ) const
inlineoverride
template<typename O, typename S = Key, typename C = NoClient>
std::string& utility::keys::AutoKey< O, S, C >::identifier ( )
inlineoverride

Identifier.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::identifier ( std::string const &  identifier_a)
inlineoverride

Identifier assignment.

template<typename O, typename S = Key, typename C = NoClient>
Index utility::keys::AutoKey< O, S, C >::index ( ) const
inlineoverrideprotected

Index.

template<typename O, typename S = Key, typename C = NoClient>
Index& utility::keys::AutoKey< O, S, C >::index ( )
inlineoverrideprotected

Index.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::index ( Index const  index_a)
inlineoverrideprotected

Index assignment.

template<typename O, typename S = Key, typename C = NoClient>
bool utility::keys::AutoKey< O, S, C >::less_than ( Key const &  key) const
inlineoverrideprotected

Less than a Key?

template<typename O, typename S = Key, typename C = NoClient>
static Size utility::keys::AutoKey< O, S, C >::n_key ( )
inlinestatic

Number of keys with distinct indexes.

template<typename O, typename S = Key, typename C = NoClient>
static Size& utility::keys::AutoKey< O, S, C >::n_key_ ( )
inlinestaticprivate

Number of keys with distinct indexes.

Referenced by utility::keys::AutoKey< Option >::n_key(), and utility::keys::AutoKey< Option >::next_index().

template<typename O, typename S = Key, typename C = NoClient>
static Size utility::keys::AutoKey< O, S, C >::next_index ( )
inlinestaticprivate

Increment the index counter and return it.

template<typename O, typename S = Key, typename C = NoClient>
utility::keys::AutoKey< O, S, C >::operator Index ( ) const
inlineprotected

Index value conversion.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::operator= ( AutoKey< O, S, C > const &  key)
inline

Copy assignment.

template<typename O, typename S = Key, typename C = NoClient>
AutoKey& utility::keys::AutoKey< O, S, C >::operator= ( Key const &  key)
inline

Key assignment.

template<typename O, typename S = Key, typename C = NoClient>
Index utility::keys::AutoKey< O, S, C >::private_index ( ) const
inlineoverride

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 = Key, typename C = NoClient>
bool operator!= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey != AutoKey.

Note
Index-based equality
template<typename O, typename S = Key, typename C = NoClient>
bool operator< ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey < AutoKey.

Note
Index-based ordering
Needed for use as key in associative containers
template<typename O, typename S = Key, typename C = NoClient>
bool operator<= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey <= AutoKey.

Note
Index-based ordering
template<typename O, typename S = Key, typename C = NoClient>
bool operator== ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey == AutoKey.

Note
Index-based equality
template<typename O, typename S = Key, typename C = NoClient>
bool operator> ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey > AutoKey.

Note
Index-based ordering
template<typename O, typename S = Key, typename C = NoClient>
bool operator>= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey >= AutoKey.

Note
Index-based ordering
template<typename O, typename S = Key, typename C = NoClient>
template<typename UO , typename US , typename UC >
bool sequential ( AutoKey< UO, US, UC > const &  a,
AutoKey< UO, US, UC > const &  b 
)
friend

AutoKeys are sequential?

Note
Index-based ordering

Member Data Documentation

template<typename O, typename S = Key, typename C = NoClient>
std::string utility::keys::AutoKey< O, S, C >::code_
private
template<typename O, typename S = Key, typename C = NoClient>
std::string utility::keys::AutoKey< O, S, C >::id_
private
template<typename O, typename S = Key, typename C = NoClient>
std::string utility::keys::AutoKey< O, S, C >::identifier_
private
template<typename O, typename S = Key, typename C = NoClient>
Index utility::keys::AutoKey< O, S, C >::index_
private

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