Fawkes API  Fawkes Development Version
enum_constant.h
1 
2 /***************************************************************************
3  * enum_constant.h - Interface generator enum constant representation
4  *
5  * Generated: Wed Oct 11 19:40:37 2006
6  * Copyright 2006 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __INTERFACES_GENERATOR_ENUM_CONSTANT_H_
24 #define __INTERFACES_GENERATOR_ENUM_CONSTANT_H_
25 
26 #include <string>
27 #include <vector>
28 #include <utility>
29 
31 {
32  public:
33  /** Enumeration item. */
34  typedef struct {
35  std::string name; ///< Name of item.
36  std::string comment; ///< Comment for item.
37  bool has_custom_value; ///< True if custom value set.
38  int custom_value; ///< Custom value.
39  } EnumItem;
40 
41  InterfaceEnumConstant(const std::string &name, const std::string &comment);
42 
43  const std::string & get_name() const;
44  const std::string & get_comment() const;
45  const std::vector<EnumItem> & get_items() const;
46  void add_item(std::string name, std::string comment);
47  void add_item(std::string name, std::string comment, int value);
48 
49  private:
50 
51  std::string __name;
52  std::string __comment;
53  std::vector<EnumItem> __items;
54 };
55 
56 #endif
std::string name
Name of item.
Definition: enum_constant.h:35
const std::string & get_comment() const
Get comment of enum constant.
Interface generator internal representation of a enum constant as parsed from the XML template file...
Definition: enum_constant.h:30
std::string comment
Comment for item.
Definition: enum_constant.h:36
bool has_custom_value
True if custom value set.
Definition: enum_constant.h:37
const std::vector< EnumItem > & get_items() const
Get enumeration items.
InterfaceEnumConstant(const std::string &name, const std::string &comment)
Constructor.
void add_item(std::string name, std::string comment)
Add an item without custom value.
const std::string & get_name() const
Get name of enum constant.
int custom_value
Custom value.
Definition: enum_constant.h:38