4 #include <vrecko/Export>
16 template <
class _MessageType>
40 template <
class _MessageType>
68 template <
class _MessageType,
class _ReturningMessageType>
97 template <
class _MessageType,
class _ReturningMessageType>
111 inline osg::ref_ptr<_ReturningMessageType>
request(_MessageType *messageToBeSent) {
169 #define DECLARE_INPUT(name, message_type) \
170 osg::ref_ptr<vrecko::InputPin<message_type>> input##name; \
171 void onMessage##name(message_type *message);
174 #define INIT_INPUT_EXTNAME(name, message_type, yourClassName, extName) \
175 addInputPin(input##name = new vrecko::InputPin<message_type>(this, extName, (vrecko::InputPin<message_type>::PROCESSING_METHOD)&yourClassName::onMessage##name));
185 #define INIT_INPUT(name, message_type, yourClassName) \
186 INIT_INPUT_EXTNAME(name, message_type, yourClassName, #name)
188 #define UNINIT_INPUT(name) \
191 removeInputPin(input##name); \
192 input##name = NULL; \
196 #define METHOD_INPUT(name, message_type, yourClassName) \
197 void yourClassName::onMessage##name(message_type *message)
202 #define DECLARE_OUTPUT(name, message_type) \
203 osg::ref_ptr<vrecko::OutputPin<message_type>> output##name;
205 #define INIT_OUTPUT_EXTNAME(name, message_type, extName) \
206 addOutputPin(output##name = new vrecko::OutputPin<message_type>(this, extName));
208 #define INIT_OUTPUT(name, message_type) INIT_OUTPUT_EXTNAME(name, message_type, #name)
210 #define UNINIT_OUTPUT(name) \
212 if (output##name) { \
213 removeOutputPin(output##name); \
214 output##name = NULL; \
221 #define DECLARE_REQUEST_INPUT(name, message_type, returning_message_type) \
222 osg::ref_ptr<vrecko::RequestInputPin<message_type, returning_message_type>> reqInput##name; \
223 osg::ref_ptr<returning_message_type> onRequest##name(message_type *message);
225 #define INIT_REQUEST_INPUT_EXTNAME(name, message_type, returning_message_type, yourClassName, extName) \
226 addRequestInputPin(reqInput##name = new vrecko::RequestInputPin<message_type, returning_message_type>(this, extName, (vrecko::RequestInputPin<message_type, returning_message_type>::PROCESSING_METHOD)&yourClassName::onRequest##name));
228 #define INIT_REQUEST_INPUT(name, message_type, returning_message_type, yourClassName) \
229 INIT_REQUEST_INPUT_EXTNAME(name, message_type, returning_message_type, yourClassName, #name)
231 #define UNINIT_REQUEST_INPUT(name) \
233 if (reqInput##name) { \
234 removeRequestInputPin(reqInput##name); \
235 reqInput##name = NULL; \
239 #define METHOD_REQUEST_INPUT(name, message_type, returning_message_type, yourClassName) \
240 osg::ref_ptr<returning_message_type> yourClassName::onRequest##name(message_type *message)
244 #define DECLARE_REQUEST_OUTPUT(name, message_type, returning_message_type) \
245 osg::ref_ptr<vrecko::RequestOutputPin<message_type, returning_message_type>> reqOutput##name;
247 #define INIT_REQUEST_OUTPUT_EXTNAME(name, message_type, returning_message_type, extName) \
248 addRequestOutputPin(reqOutput##name = new vrecko::RequestOutputPin<message_type, returning_message_type>(this, extName));
250 #define INIT_REQUEST_OUTPUT(name, message_type, returning_message_type) \
251 INIT_REQUEST_OUTPUT_EXTNAME(name, message_type, returning_message_type, #name)
253 #define UNINIT_REQUEST_OUTPUT(name) \
255 if (reqOutput##name) { \
256 removeRequestOutputPin(reqOutput##name); \
257 reqOutput##name = NULL; \