blob: ff1c56922290f467d8df3e549881c967fa586411 [file] [log] [blame]
Mark Sleee8540632006-05-30 09:24:40 +00001#ifndef T_MAP_H
2#define T_MAP_H
3
Mark Sleef5377b32006-10-10 01:42:59 +00004/**
5 * A map is a lightweight container type that just wraps another two data
6 * types.
7 *
8 * @author Mark Slee <mcslee@facebook.com>
9 */
Mark Sleee8540632006-05-30 09:24:40 +000010class t_map : public t_type {
11 public:
12 t_map(t_type* key_type, t_type* val_type) :
Mark Sleef5377b32006-10-10 01:42:59 +000013 key_type_(key_type),
14 val_type_(val_type) {}
Mark Sleee8540632006-05-30 09:24:40 +000015
Mark Sleef5377b32006-10-10 01:42:59 +000016 t_type* get_key_type() const {
17 return key_type_;
18 }
19
20 t_type* get_val_type() const {
21 return val_type_;
22 }
23
24 bool is_map() const {
25 return true;
26 }
Mark Sleee8540632006-05-30 09:24:40 +000027
28 private:
29 t_type* key_type_;
30 t_type* val_type_;
31};
32
33#endif