Fawkes API  Fawkes Development Version
InterfaceEnumConstant Class Reference

Interface generator internal representation of a enum constant as parsed from the XML template file. More...

#include <interfaces/generator/enum_constant.h>

Classes

struct  EnumItem
 Enumeration item. More...
 

Public Member Functions

 InterfaceEnumConstant (const std::string &name, const std::string &comment)
 Constructor. More...
 
const std::string & get_name () const
 Get name of enum constant. More...
 
const std::string & get_comment () const
 Get comment of enum constant. More...
 
const std::vector< EnumItem > & get_items () const
 Get enumeration items. More...
 
void add_item (std::string name, std::string comment)
 Add an item without custom value. More...
 
void add_item (std::string name, std::string comment, int value)
 Add an item with custom value. More...
 

Detailed Description

Interface generator internal representation of a enum constant as parsed from the XML template file.

Definition at line 30 of file enum_constant.h.

Constructor & Destructor Documentation

◆ InterfaceEnumConstant()

InterfaceEnumConstant::InterfaceEnumConstant ( const std::string &  name,
const std::string &  comment 
)

Constructor.

Parameters
namename of enumeration constant
commentcomment of enumeration constant.

Definition at line 36 of file enum_constant.cpp.

Member Function Documentation

◆ add_item() [1/2]

void InterfaceEnumConstant::add_item ( std::string  name,
std::string  comment 
)

Add an item without custom value.

Parameters
namename of item
commentcomment of item.

Definition at line 81 of file enum_constant.cpp.

Referenced by InterfaceParser::parse().

◆ add_item() [2/2]

void InterfaceEnumConstant::add_item ( std::string  name,
std::string  comment,
int  value 
)

Add an item with custom value.

Parameters
namename of item
commentcomment of item.
valuecustom value

Definition at line 100 of file enum_constant.cpp.

◆ get_comment()

const std::string & InterfaceEnumConstant::get_comment ( ) const

Get comment of enum constant.

Returns
comment of enum constant.

Definition at line 59 of file enum_constant.cpp.

◆ get_items()

const std::vector< InterfaceEnumConstant::EnumItem > & InterfaceEnumConstant::get_items ( ) const

Get enumeration items.

Returns
vector of enum items. First item in pair contains item name, second item the comment.

Definition at line 70 of file enum_constant.cpp.

◆ get_name()

const std::string & InterfaceEnumConstant::get_name ( void  ) const

Get name of enum constant.

Returns
name of enum constant.

Definition at line 49 of file enum_constant.cpp.


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