FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
VOM::enum_base< T > Class Template Reference

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

Public Member Functions

const std::string & to_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...
 
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

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 73 of file enum_base.hpp.

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

Constructor.

Definition at line 82 of file enum_base.hpp.

Member Function Documentation

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

integer conversion operator

Definition at line 62 of file enum_base.hpp.

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

Comparison operator.

Definition at line 57 of file enum_base.hpp.

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.

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.

template<typename T>
const std::string& VOM::enum_base< T >::to_string ( void  ) 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:

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

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

Definition at line 67 of file enum_base.hpp.

+ Here is the caller graph for this function:


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