Rosetta
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
 
typedef O object_type
 
typedef std::size_t index_type
 
typedef std::size_t size_type
 
typedef O Object
 
typedef std::size_t Index
 
typedef std::size_t Size
 
- Public Types inherited from S
typedef struct S::_D D
 

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...
 

Additional Inherited Members

- Public Attributes inherited from S
int a
 
struct {
   int   b
 
}; 
 
FL_not_binded fl
 
struct {
   float   b4
 
B_not_binded [4]
 
struct {
   int   c
 
C_not_binded
 

Detailed Description

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

Automatic hidden index key abstract base class.

Member Typedef Documentation

◆ Index

template<typename O , typename S , typename C >
typedef std::size_t utility::keys::AutoKey< O, S, C >::Index

◆ index_type

template<typename O , typename S , typename C >
typedef std::size_t utility::keys::AutoKey< O, S, C >::index_type

◆ Key

template<typename O , typename S , typename C >
typedef utility::keys::Key utility::keys::AutoKey< O, S, C >::Key

◆ Object

template<typename O , typename S , typename C >
typedef O utility::keys::AutoKey< O, S, C >::Object

◆ object_type

template<typename O , typename S , typename C >
typedef O utility::keys::AutoKey< O, S, C >::object_type

◆ Size

template<typename O , typename S , typename C >
typedef std::size_t utility::keys::AutoKey< O, S, C >::Size

◆ size_type

template<typename O , typename S , typename C >
typedef std::size_t utility::keys::AutoKey< O, S, C >::size_type

◆ Super

template<typename O , typename S , typename C >
typedef S utility::keys::AutoKey< O, S, C >::Super
private

Constructor & Destructor Documentation

◆ AutoKey() [1/6]

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

Default constructor.

◆ AutoKey() [2/6]

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

Copy constructor.

◆ AutoKey() [3/6]

template<typename O , typename S , typename C >
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.

◆ AutoKey() [4/6]

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

Key constructor.

References debug_assert, and subloop_histogram::key.

◆ AutoKey() [5/6]

template<typename O , typename S , typename C >
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.

References debug_assert, and subloop_histogram::key.

◆ AutoKey() [6/6]

template<typename O , typename S , typename C >
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.

◆ ~AutoKey()

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

Destructor.

Member Function Documentation

◆ assign_Key()

template<typename O , typename S , typename C >
void utility::keys::AutoKey< O, S, C >::assign_Key ( Key const &  key)
inlineoverrideprotected

◆ clone()

template<typename O , typename S , typename C >
AutoKey* utility::keys::AutoKey< O, S, C >::clone ( ) const
overridepure virtual

◆ code() [1/3]

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

◆ code() [2/3]

template<typename O , typename S , typename C >
std::string& utility::keys::AutoKey< O, S, C >::code ( )
inlineoverride

◆ code() [3/3]

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

Code assignment.

References utility::keys::AutoKey< O, S, C >::code_.

◆ comparable()

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

Comparable to a Key?

References subloop_histogram::key.

Referenced by utility::keys::AutoKey< O, S, C >::assign_Key().

◆ equals()

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

◆ id() [1/3]

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

◆ id() [2/3]

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

◆ id() [3/3]

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

ID assignment.

References utility::keys::AutoKey< O, S, C >::id_.

Referenced by schema.Job::__repr__().

◆ identifier() [1/3]

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

◆ identifier() [2/3]

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

◆ identifier() [3/3]

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

Identifier assignment.

References utility::keys::AutoKey< O, S, C >::identifier_.

◆ index() [1/3]

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

◆ index() [2/3]

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

◆ index() [3/3]

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

Index assignment.

References utility::keys::AutoKey< O, S, C >::index_.

◆ less_than()

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

◆ n_key()

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

Number of keys with distinct indexes.

References utility::keys::AutoKey< O, S, C >::n_key_().

◆ n_key_()

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

Number of keys with distinct indexes.

Referenced by utility::keys::AutoKey< O, S, C >::n_key(), and utility::keys::AutoKey< O, S, C >::next_index().

◆ next_index()

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

Increment the index counter and return it.

References debug_assert, and utility::keys::AutoKey< O, S, C >::n_key_().

◆ operator Index()

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

Index value conversion.

References utility::keys::AutoKey< O, S, C >::index_.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ private_index()

template<typename O , typename S , typename C >
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!

References utility::keys::AutoKey< O, S, C >::index_.

Friends And Related Function Documentation

◆ operator!=

template<typename O , typename S , typename C >
bool operator!= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey != AutoKey.

Note
Index-based equality

◆ operator<

template<typename O , typename S , typename C >
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

◆ operator<=

template<typename O , typename S , typename C >
bool operator<= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey <= AutoKey.

Note
Index-based ordering

◆ operator==

template<typename O , typename S , typename C >
bool operator== ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey == AutoKey.

Note
Index-based equality

◆ operator>

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

AutoKey > AutoKey.

Note
Index-based ordering

◆ operator>=

template<typename O , typename S , typename C >
bool operator>= ( AutoKey< O, S, C > const &  a,
AutoKey< O, S, C > const &  b 
)
friend

AutoKey >= AutoKey.

Note
Index-based ordering

◆ sequential

template<typename O , typename S , typename C >
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

◆ code_

template<typename O , typename S , typename C >
std::string utility::keys::AutoKey< O, S, C >::code_
private

◆ id_

template<typename O , typename S , typename C >
std::string utility::keys::AutoKey< O, S, C >::id_
private

◆ identifier_

template<typename O , typename S , typename C >
std::string utility::keys::AutoKey< O, S, C >::identifier_
private

◆ index_

template<typename O , typename S , typename C >
Index utility::keys::AutoKey< O, S, C >::index_
private

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