Rosetta Utilities  2014.35
Classes | Namespaces | Functions
AutoKey.hh File Reference

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

#include <utility/keys/AutoKey.fwd.hh>
#include <utility/down_cast.hh>
#include <utility/keys/Key.hh>
#include <utility/keys/KeyLookup.hh>
#include <utility/keys/NoClient.hh>
#include <cassert>

Classes

class  utility::keys::AutoKey< O, S, C >
 Automatic hidden index key abstract base class. More...
 

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 1.
 
 utility::keys
 

Functions

template<typename O , typename S , typename C >
bool utility::keys::operator== (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey == AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::operator!= (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey != AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::operator< (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey < AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::operator<= (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey <= AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::operator>= (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey >= AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::operator> (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKey > AutoKey. More...
 
template<typename O , typename S , typename C >
bool utility::keys::sequential (AutoKey< O, S, C > const &a, AutoKey< O, S, C > const &b)
 AutoKeys are sequential? More...
 

Detailed Description

Automatic hidden index key abstract base class.

Author
Stuart G. Mentzer (Stuar.nosp@m.t_Me.nosp@m.ntzer.nosp@m.@obj.nosp@m.exx.c.nosp@m.om)
Note
  • Object (O) parameter: The type of object being keyed
  • Super (S) parameter: The super Key class (== or derived from Key)
  • Client (C) parameter: The client (user) of these keys
  • There is a distinct Key type for each Object+Super+Client combination
  • Hidden index is set automatically at construction in the order keys are constructed
  • Default-constructed keys are assigned a hidden index of zero: Use indentifier argument(s) when constructing keys meant for collections
  • Key-constructed keys copy the index of the source key so they compare as equal
  • Can derive privately from an AutoKey to share the index set of another Key type without allowing convertibility (for type safety)
  • Designed for collections of keys of a common abstract or concrete Key type