00001 #ifndef ros1_ros_cpp_template_SERVICE_HPP_ 00002 #define ros1_ros_cpp_template_SERVICE_HPP_ 00003 00004 #include <ros1_cpptemplate/atomic_fibonacci.hpp> 00005 #include <ros1_template_msgs/Answer.h> 00006 00007 #include <ros/service.h> 00008 #include <ros/node_handle.h> 00009 00010 #include <memory> 00011 #include <string> 00012 00013 namespace ros1_ros_cpptemplate 00014 { 00015 00019 class Service 00020 { 00021 public: 00029 explicit Service(ros1_cpptemplate::AtomicFibonacciPtr atomic_fibonacci, 00030 ros::NodeHandle& node_handle, 00031 const std::string& service_topic_name); 00032 00036 virtual ~Service(); 00037 00038 protected: 00042 Service() 00043 { 00044 } 00045 00049 virtual bool serve(ros1_template_msgs::Answer::Request &request, 00050 ros1_template_msgs::Answer::Response &response); 00051 00053 ros1_cpptemplate::AtomicFibonacciPtr atomic_fibonacci_; 00054 00056 ros::ServiceServer service_; 00057 }; 00058 typedef std::shared_ptr<Service> ServicePtr; 00059 00060 } // namespace 00061 00062 #endif