Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 1 | #ifndef T_FUNCTION_H |
| 2 | #define T_FUNCTION_H |
| 3 | |
| 4 | #include <string> |
| 5 | #include "t_type.h" |
| 6 | #include "t_struct.h" |
| 7 | |
| 8 | /** |
| 9 | * Representation of a function. Key parst are return type, function name, |
| 10 | * optional modifiers, and an argument list. Each function also has a |
| 11 | * hash signature that is used in the network protocol. |
| 12 | * |
| 13 | * @author Mark Slee <mcslee@facebook.com> |
| 14 | */ |
| 15 | class t_function { |
| 16 | public: |
| 17 | t_function(t_type* returntype, std::string name, t_struct* arglist) : |
| 18 | returntype_(returntype), name_(name), arglist_(arglist) {} |
| 19 | |
| 20 | ~t_function() {} |
| 21 | |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 22 | t_type* get_returntype() const { return returntype_; } |
| 23 | const std::string& get_name() const { return name_; } |
| 24 | t_struct* get_arglist() const { return arglist_; } |
Mark Slee | b15a68b | 2006-06-07 06:46:24 +0000 | [diff] [blame^] | 25 | |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 26 | private: |
| 27 | t_type* returntype_; |
| 28 | std::string name_; |
| 29 | t_struct* arglist_; |
| 30 | }; |
| 31 | |
| 32 | #endif |