| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions | List of all members
Containers::traits< CONTAINER, DATATYPE > Struct Template Reference

Container traits class. More...

`#include <GaudiKernel/KeyedTraits.h>`

Inheritance diagram for Containers::traits< CONTAINER, DATATYPE >:
[legend]
Collaboration diagram for Containers::traits< CONTAINER, DATATYPE >:
[legend]

## Static Public Member Functions
static bool | checkBounds (const std::vector< DATATYPE * > *cnt, const typename DATATYPE::key_type &k)
| Allow to check the access to container elements for consistency. More...
Static Public Member Functions inherited from Containers::key_traits< DATATYPE::key_type >
static key_type | makeKey (long k)
| Create key from its full integer representation. More...
static key_type | makeKey (int k)
static long | identifier (const key_type &k)
| Full unhashed key identifier. More...
static long | hash (const key_type &key_value)
| Hash function for this key. More...
static void | setKey (obj_type *v, const key_type &k)
| Set object key when inserted into the container. More...
static bool | checkKey (obj_type *v, const key_type &k)
| Check the validity of the object's key. More...
static long | addRef (obj_type *v)
| Add reference counter to object when inserted into the container. More...
static long | release (obj_type *v)
| Release reference to object. More...

## Additional Inherited Members
Public Types inherited from Containers::key_traits< DATATYPE::key_type >
typedef DATATYPE::key_type | key_type
| Declaration of key-type. More...
typedef KeyedObject< key_type > | obj_type
| Declaration of keyed object type. More...

## Detailed Description

### template<class CONTAINER, class DATATYPE>
struct Containers::traits< CONTAINER, DATATYPE >

Container traits class.

Definition of the container traits class.

Select if container-checks should be performed by switching on/off the macro CHECK_KEYED_CONTAINER.

Author
  M.Frank CERN/LHCb

Version
  1.0

Definition at line 35 of file KeyedTraits.h.

## Member Function Documentation

template<class CONTAINER , class DATATYPE >

static bool Containers::traits< CONTAINER, DATATYPE >::checkBounds | ( | const std::vector< DATATYPE * > * | cnt,
|  | const typename DATATYPE::key_type & | k
| ) |  |
| inline static

Allow to check the access to container elements for consistency.

Definition at line 120 of file KeyedTraits.h.

121 {
122 #ifdef CHECK_KEYED_CONTAINER
123 return size_t( cnt->size() ) > size_t( traits::hash( k ) );
124 #else
125 return true;
126 #endif
127 }
Containers::key_traits< DATATYPE::key_type >::hash
static long hash(const key_type &key_value)
Hash function for this key.
Definition: KeyedTraits.h:85
std::vector::size
T size(T...args)

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

- GaudiKernel/GaudiKernel/KeyedTraits.h