FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
VOM::enum_base< T > Class Template Reference

A template base class for all enum types. More...

Public Member Functions

const std::stringto_string () const
 convert to string format for debug purposes More...
 
bool operator== (const enum_base &e) const
 Comparison operator. More...
 
enum_baseoperator= (const enum_base &e)
 Assignment. More...
 
enum_baseoperator|= (const enum_base &e)
 bitwise or assignemnt More...
 
enum_base operator| (const enum_base &e1) const
 bitwise or More...
 
bool operator!= (const enum_base &e) const
 Comparison operator. More...
 
 operator int () const
 integer conversion operator More...
 
int value () const
 Return the value of the enum - same as integer conversion. More...
 

Protected Member Functions

 enum_base (int value, const std::string desc)
 Constructor of an enum - takes value and string description. More...
 
virtual ~enum_base ()
 Constructor. More...
 

Detailed Description

template<typename T>
class VOM::enum_base< T >

A template base class for all enum types.

This enum type exists to associate an enum value with a string for display/debug purposes. Concrete enum types use the CRTP. Derived classes thus inherit this base's function, but are not polymorphic.

Definition at line 30 of file enum_base.hpp.

Constructor & Destructor Documentation

◆ enum_base()

template<typename T >
VOM::enum_base< T >::enum_base ( int  value,
const std::string  desc 
)
inlineprotected

Constructor of an enum - takes value and string description.

Definition at line 94 of file enum_base.hpp.

◆ ~enum_base()

template<typename T >
virtual VOM::enum_base< T >::~enum_base ( )
inlineprotectedvirtual

Constructor.

Definition at line 103 of file enum_base.hpp.

Member Function Documentation

◆ operator int()

template<typename T >
VOM::enum_base< T >::operator int ( ) const
inline

integer conversion operator

Definition at line 83 of file enum_base.hpp.

◆ operator!=()

template<typename T >
bool VOM::enum_base< T >::operator!= ( const enum_base< T > &  e) const
inline

Comparison operator.

Definition at line 78 of file enum_base.hpp.

◆ operator=()

template<typename T >
enum_base& VOM::enum_base< T >::operator= ( const enum_base< T > &  e)
inline

Assignment.

Definition at line 46 of file enum_base.hpp.

◆ operator==()

template<typename T >
bool VOM::enum_base< T >::operator== ( const enum_base< T > &  e) const
inline

Comparison operator.

Definition at line 41 of file enum_base.hpp.

◆ operator|()

template<typename T >
enum_base VOM::enum_base< T >::operator| ( const enum_base< T > &  e1) const
inline

bitwise or

Definition at line 68 of file enum_base.hpp.

◆ operator|=()

template<typename T >
enum_base& VOM::enum_base< T >::operator|= ( const enum_base< T > &  e)
inline

bitwise or assignemnt

Definition at line 57 of file enum_base.hpp.

◆ to_string()

template<typename T >
const std::string& VOM::enum_base< T >::to_string ( ) const
inline

convert to string format for debug purposes

Definition at line 36 of file enum_base.hpp.

+ Here is the caller graph for this function:

◆ value()

template<typename T >
int VOM::enum_base< T >::value ( ) const
inline

Return the value of the enum - same as integer conversion.

Definition at line 88 of file enum_base.hpp.

+ Here is the caller graph for this function:

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