blob: 02c671e6b25a817145cf3b66a94a7a60a3847625 [file] [log] [blame]
Mark Sleee9ce01c2007-05-16 02:29:53 +00001// Copyright (c) 2006- Facebook
2// Distributed under the Thrift Software License
3//
4// See accompanying file LICENSE or visit the Thrift site at:
5// http://developers.facebook.com/thrift/
6
Mark Sleee8540632006-05-30 09:24:40 +00007#ifndef T_MAP_H
8#define T_MAP_H
9
Mark Slee4f8da1d2006-10-12 02:47:27 +000010#include "t_container.h"
11
Mark Sleef5377b32006-10-10 01:42:59 +000012/**
13 * A map is a lightweight container type that just wraps another two data
14 * types.
15 *
16 * @author Mark Slee <mcslee@facebook.com>
17 */
Mark Slee4f8da1d2006-10-12 02:47:27 +000018class t_map : public t_container {
Mark Sleee8540632006-05-30 09:24:40 +000019 public:
20 t_map(t_type* key_type, t_type* val_type) :
Mark Sleef5377b32006-10-10 01:42:59 +000021 key_type_(key_type),
22 val_type_(val_type) {}
Mark Sleee8540632006-05-30 09:24:40 +000023
Mark Sleef5377b32006-10-10 01:42:59 +000024 t_type* get_key_type() const {
25 return key_type_;
26 }
27
28 t_type* get_val_type() const {
29 return val_type_;
30 }
31
32 bool is_map() const {
33 return true;
34 }
Mark Sleee8540632006-05-30 09:24:40 +000035
36 private:
37 t_type* key_type_;
38 t_type* val_type_;
39};
40
41#endif