00001 #ifndef OROGEN_MQ_TYPELIB_MARSHALLER_HPP 00002 #define OROGEN_MQ_TYPELIB_MARSHALLER_HPP 00003 00004 #include <rtt/transports/mqueue/MQTemplateProtocol.hpp> 00005 00006 namespace orogen_transports { 00007 class TypelibMarshallerBase; 00008 00009 class MQTypelibMarshallerBase 00010 { 00011 orogen_transports::TypelibMarshallerBase* marshaller; 00012 00013 public: 00014 MQTypelibMarshallerBase(orogen_transports::TypelibMarshallerBase* marshaller); 00015 virtual ~MQTypelibMarshallerBase(); 00016 void* createCookie() const; 00017 void deleteCookie(void* cookie) const; 00018 std::pair<void const*,int> fillBlob( RTT::base::DataSourceBase::shared_ptr source, void* blob, int size, void* cookie) const; 00019 bool updateFromBlob(const void* blob, int size, RTT::base::DataSourceBase::shared_ptr target, void* cookie) const; 00020 unsigned int getSampleSize( RTT::base::DataSourceBase::shared_ptr sample, void* cookie) const; 00021 }; 00022 00023 template<typename T> 00024 class MQTypelibMarshaller : public RTT::mqueue::MQTemplateProtocol<T>, public MQTypelibMarshallerBase { 00025 public: 00026 MQTypelibMarshaller(orogen_transports::TypelibMarshallerBase* marshaller) 00027 : MQTypelibMarshallerBase(marshaller) {} 00028 00029 void* createCookie() const 00030 { return MQTypelibMarshallerBase::createCookie(); } 00031 void deleteCookie(void* cookie) const 00032 { return MQTypelibMarshallerBase::deleteCookie(cookie); } 00033 std::pair<void const*,int> fillBlob( RTT::base::DataSourceBase::shared_ptr source, void* blob, int size, void* cookie) const 00034 { return MQTypelibMarshallerBase::fillBlob(source, blob, size, cookie); } 00035 bool updateFromBlob(const void* blob, int size, RTT::base::DataSourceBase::shared_ptr target, void* cookie) const 00036 { return MQTypelibMarshallerBase::updateFromBlob(blob, size, target, cookie); } 00037 unsigned int getSampleSize( RTT::base::DataSourceBase::shared_ptr sample, void* cookie) const 00038 { return MQTypelibMarshallerBase::getSampleSize(sample, cookie); } 00039 }; 00040 } 00041 00042 #endif