Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 1 | #ifndef T_SERVICE_H |
| 2 | #define T_SERVICE_H |
| 3 | |
| 4 | #include "t_function.h" |
| 5 | #include <vector> |
| 6 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame^] | 7 | /** |
| 8 | * A service consists of a set of functions. |
| 9 | * |
| 10 | * @author Mark Slee <mcslee@facebook.com> |
| 11 | */ |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 12 | class t_service { |
| 13 | public: |
| 14 | t_service() {} |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 15 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame^] | 16 | void set_name(std::string name) { |
| 17 | name_ = name; |
| 18 | } |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 19 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame^] | 20 | void add_function(t_function* func) { |
| 21 | functions_.push_back(func); |
| 22 | } |
| 23 | |
| 24 | const std::string& get_name() const { |
| 25 | return name_; |
| 26 | } |
| 27 | |
| 28 | const std::vector<t_function*>& get_functions() const { |
| 29 | return functions_; |
| 30 | } |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | std::string name_; |
| 34 | std::vector<t_function*> functions_; |
| 35 | }; |
| 36 | |
| 37 | #endif |