blob: fd55932685d871bb7fc1d2d77770cb10bd60232c [file] [log] [blame]
Mark Sleee8540632006-05-30 09:24:40 +00001#ifndef T_MAP_H
2#define T_MAP_H
3
Mark Slee4f8da1d2006-10-12 02:47:27 +00004#include "t_container.h"
5
Mark Sleef5377b32006-10-10 01:42:59 +00006/**
7 * A map is a lightweight container type that just wraps another two data
8 * types.
9 *
10 * @author Mark Slee <mcslee@facebook.com>
11 */
Mark Slee4f8da1d2006-10-12 02:47:27 +000012class t_map : public t_container {
Mark Sleee8540632006-05-30 09:24:40 +000013 public:
14 t_map(t_type* key_type, t_type* val_type) :
Mark Sleef5377b32006-10-10 01:42:59 +000015 key_type_(key_type),
16 val_type_(val_type) {}
Mark Sleee8540632006-05-30 09:24:40 +000017
Mark Sleef5377b32006-10-10 01:42:59 +000018 t_type* get_key_type() const {
19 return key_type_;
20 }
21
22 t_type* get_val_type() const {
23 return val_type_;
24 }
25
26 bool is_map() const {
27 return true;
28 }
Mark Sleee8540632006-05-30 09:24:40 +000029
30 private:
31 t_type* key_type_;
32 t_type* val_type_;
33};
34
35#endif