blob: fc384563329aefd177eb3238b98d132458f42045 [file] [log] [blame]
Mark Slee31985722006-05-24 21:45:31 +00001#ifndef T_FIELD_H
2#define T_FIELD_H
3
4#include <string>
5
6/**
7 * Class to represent a field in a thrift structure or in a set of arguments
8 * to a thrift function.
9 *
10 * @author Mark Slee <mcslee@facebook.com>
11 */
12class t_field {
13 public:
Mark Sleeb15a68b2006-06-07 06:46:24 +000014 t_field(t_type* type, std::string name) :
15 type_(type), name_(name), key_(0) {}
16
Mark Slee31985722006-05-24 21:45:31 +000017 t_field(t_type* type, std::string name, uint32_t key) :
18 type_(type), name_(name), key_(key) {}
19
20 ~t_field() {}
21
22 t_type* get_type() const { return type_; }
23 const std::string& get_name() const { return name_; }
24 uint32_t get_key() const { return key_; }
25
26 private:
27 t_type* type_;
28 std::string name_;
29 uint32_t key_;
30};
31
32#endif