Mark Slee | e9ce01c | 2007-05-16 02:29:53 +0000 | [diff] [blame^] | 1 | // 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 Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 7 | #ifndef T_SET_H |
| 8 | #define T_SET_H |
| 9 | |
Mark Slee | 4f8da1d | 2006-10-12 02:47:27 +0000 | [diff] [blame] | 10 | #include "t_container.h" |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 11 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 12 | /** |
| 13 | * A set is a lightweight container type that just wraps another data type. |
| 14 | * |
| 15 | * @author Mark Slee <mcslee@facebook.com> |
| 16 | */ |
Mark Slee | 4f8da1d | 2006-10-12 02:47:27 +0000 | [diff] [blame] | 17 | class t_set : public t_container { |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 18 | public: |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 19 | t_set(t_type* elem_type) : |
| 20 | elem_type_(elem_type) {} |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 21 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 22 | t_type* get_elem_type() const { |
| 23 | return elem_type_; |
| 24 | } |
| 25 | |
| 26 | bool is_set() const { |
| 27 | return true; |
| 28 | } |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 29 | |
| 30 | private: |
| 31 | t_type* elem_type_; |
| 32 | }; |
| 33 | |
| 34 | #endif |