Public Member Functions | Private Attributes | List of all members
cet::map_vector_key Class Reference

#include <map_vector.h>

Public Member Functions

constexpr map_vector_key () noexcept
 
 map_vector_key (int key)
 
constexpr map_vector_key (unsigned const key) noexcept
 
constexpr map_vector_key (unsigned long key) noexcept
 
constexpr unsigned long asInt () const noexcept
 
constexpr unsigned long asUint () const noexcept
 
void ensure_valid () const
 

Private Attributes

unsigned long key_
 

Detailed Description

Definition at line 34 of file map_vector.h.

Constructor & Destructor Documentation

constexpr cet::map_vector_key::map_vector_key ( )
inlinenoexcept

Definition at line 37 of file map_vector.h.

37 : key_{-1ul} {}
unsigned long key_
Definition: map_vector.h:56
cet::map_vector_key::map_vector_key ( int  key)
inlineexplicit

Definition at line 60 of file map_vector.h.

60  : key_(key)
61 {
62  if (key < 0) {
63  throw cet::exception("InvalidKey")
64  << "Negative key " << key << " not valid for map_vector_key.";
65  }
66 }
def key(type, name=None)
Definition: graph.py:13
unsigned long key_
Definition: map_vector.h:56
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
constexpr cet::map_vector_key::map_vector_key ( unsigned const  key)
inlineexplicitnoexcept

Definition at line 39 of file map_vector.h.

39 : key_{key} {}
def key(type, name=None)
Definition: graph.py:13
unsigned long key_
Definition: map_vector.h:56
constexpr cet::map_vector_key::map_vector_key ( unsigned long  key)
explicitnoexcept

Definition at line 68 of file map_vector.h.

69  : key_{key}
70 {}
def key(type, name=None)
Definition: graph.py:13
unsigned long key_
Definition: map_vector.h:56

Member Function Documentation

constexpr unsigned long cet::map_vector_key::asInt ( ) const
inlinenoexcept

Definition at line 44 of file map_vector.h.

45  {
46  return key_;
47  }
unsigned long key_
Definition: map_vector.h:56
constexpr unsigned long cet::map_vector_key::asUint ( ) const
inlinenoexcept

Definition at line 49 of file map_vector.h.

50  {
51  return key_;
52  }
unsigned long key_
Definition: map_vector.h:56
void cet::map_vector_key::ensure_valid ( ) const
inline

Definition at line 73 of file map_vector.h.

74 {
75  if (key_ == static_cast<unsigned long>(-1)) { // Invalid key
76  throw cet::exception("InvalidKey")
77  << "Attempt to use an invalid cet::map_vector_key.";
78  }
79 }
unsigned long key_
Definition: map_vector.h:56
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

unsigned long cet::map_vector_key::key_
private

Definition at line 56 of file map_vector.h.


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