blob: 4b6fe362a8d5d09c8ae76671954691a4cc83c0f5 [file] [log] [blame]
Mark Slee31985722006-05-24 21:45:31 +00001#ifndef T_ENUM_H
2#define T_ENUM_H
3
4#include "t_constant.h"
5#include <vector>
6
Mark Sleef5377b32006-10-10 01:42:59 +00007/**
8 * An enumerated type. A list of t_constant objects with a name for the type.
9 *
10 * @author Mark Slee <mcslee@facebook.com>
11 */
Mark Slee31985722006-05-24 21:45:31 +000012class t_enum : public t_type {
13 public:
14 t_enum() {}
Mark Slee31985722006-05-24 21:45:31 +000015
Mark Sleef5377b32006-10-10 01:42:59 +000016 void set_name(std::string name) {
17 name_ = name;
18 }
19
20 void append(t_constant* constant) {
21 constants_.push_back(constant);
22 }
Mark Slee31985722006-05-24 21:45:31 +000023
Mark Sleef5377b32006-10-10 01:42:59 +000024 const std::vector<t_constant*>& get_constants() {
25 return constants_;
26 }
27
28 bool is_enum() const {
29 return true;
30 }
Mark Slee31985722006-05-24 21:45:31 +000031
32 private:
33 std::vector<t_constant*> constants_;
34};
35
36#endif