Contents
rve_interface_gen turns an interface definition into an easy to use proxy class and inheritable server class that use rve_rpc for communication.
For example:
interface Bar { bar(uint32 x, uint32 y, string blah) returns (geometry_msgs/Vector3 v); }
generates a number of messages:
Bar_barRequest.msg Bar_barResponse.msg
a proxy class:
1 struct BarProxy : public Bar
2 {
3 BarProxy(rve_rpc::Client& client);
4 void bar(uint32_t x, uint32_t y, const std::string& blah, geometry_msgs::Vector3& out_v);
5 void barAsync(uint32_t x, uint32_t y, const std::string& blah, const barResponseCallback& cb);
6 barResponseConstPtr bar(const barRequestConstPtr& in);
7 void barAsync(const barRequestConstPtr& in, const barResponseCallback& cb);
8 };
And a server class:
along with a bunch of typedefs in a base class
1 struct Bar : public rve_interface_gen::Interface
2 {
3 virtual ~Bar() {}
4
5 typedef rve_interface_gen::Bar_barRequest barRequest;
6 typedef boost::shared_ptr<barRequest> barRequestPtr;
7 typedef boost::shared_ptr<barRequest const> barRequestConstPtr;
8 typedef rve_interface_gen::Bar_barResponse barResponse;
9 typedef boost::shared_ptr<barResponse> barResponsePtr;
10 typedef boost::shared_ptr<barResponse const> barResponseConstPtr;
11 typedef rve_rpc::CallHandle<barRequest, barResponse> barHandle;
12 typedef rve_rpc::MethodResponse<barResponse> barMethodResponse;
13 typedef boost::function<void(const barMethodResponse&)> barResponseCallback;
14
15 };