blob: b248db7ced065ba1db5f72e0951ee9ea6404551a [file] [log] [blame]
Mark Slee31985722006-05-24 21:45:31 +00001#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 */
15class 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 Slee31985722006-05-24 21:45:31 +000022 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 Sleeb15a68b2006-06-07 06:46:24 +000025
Mark Slee31985722006-05-24 21:45:31 +000026 private:
27 t_type* returntype_;
28 std::string name_;
29 t_struct* arglist_;
30};
31
32#endif