blob: 9e6c56a27013a4953ebeaa71ad3d7089057b0412 [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,
Mark Slee52f643d2006-08-09 00:03:43 +000010 * optional modifiers, and an argument list.
Mark Slee31985722006-05-24 21:45:31 +000011 *
12 * @author Mark Slee <mcslee@facebook.com>
13 */
14class t_function {
15 public:
Mark Slee52f643d2006-08-09 00:03:43 +000016 t_function(t_type* returntype,
17 std::string name,
18 t_struct* arglist,
19 bool async=false) :
20 returntype_(returntype),
21 name_(name),
22 arglist_(arglist),
23 async_(async) {}
Mark Slee31985722006-05-24 21:45:31 +000024
25 ~t_function() {}
26
Mark Slee31985722006-05-24 21:45:31 +000027 t_type* get_returntype() const { return returntype_; }
28 const std::string& get_name() const { return name_; }
29 t_struct* get_arglist() const { return arglist_; }
Mark Slee52f643d2006-08-09 00:03:43 +000030 bool is_async() const { return async_; }
Mark Sleeb15a68b2006-06-07 06:46:24 +000031
Mark Slee31985722006-05-24 21:45:31 +000032 private:
33 t_type* returntype_;
34 std::string name_;
35 t_struct* arglist_;
Mark Slee52f643d2006-08-09 00:03:43 +000036 bool async_;
Mark Slee31985722006-05-24 21:45:31 +000037};
38
39#endif