blob: 38eb7500929c0981d60544218c6421fa962fd63c [file] [log] [blame]
Mark Slee31985722006-05-24 21:45:31 +00001#ifndef T_STRUCT_H
2#define T_STRUCT_H
3
4#include <vector>
5#include <string>
6
7#include "t_type.h"
Mark Sleee8540632006-05-30 09:24:40 +00008#include "t_field.h"
Mark Slee31985722006-05-24 21:45:31 +00009
10class t_struct : public t_type {
11 public:
Mark Sleee8540632006-05-30 09:24:40 +000012 t_struct() {}
Mark Slee31985722006-05-24 21:45:31 +000013 ~t_struct() {}
14
Mark Sleee8540632006-05-30 09:24:40 +000015 /** Set the struct name */
16 void set_name(const std::string& name) { name_ = name; }
17
18 /** Add a new field to the list */
19 void append(t_field* elem) { members_.push_back(elem); }
20
21 const std::vector<t_field*>& get_members() { return members_; }
22 bool is_struct() const { return true; }
Mark Slee31985722006-05-24 21:45:31 +000023
24 private:
Mark Sleee8540632006-05-30 09:24:40 +000025 std::vector<t_field*> members_;
Mark Slee31985722006-05-24 21:45:31 +000026};
27
28#endif