00001 #ifndef ROSRTT_CONN_INPUT_ENDPOINT_HPP 00002 #define ROSRTT_CONN_INPUT_ENDPOINT_HPP 00003 00004 #include "channel_data_element.hpp" 00005 #include "../connection_base.h" 00006 00007 namespace hpcl_rtt 00008 { 00012 template<typename T> 00013 class ConnInputEndpoint : public ChannelElement<T> 00014 { 00015 ConnectionBasePtr port; 00016 00017 public: 00018 ConnInputEndpoint(ConnectionBasePtr port) : port(port) { } 00019 00020 ~ConnInputEndpoint() 00021 { 00022 //this->disconnect(false); // inform port (if any) we're gone. 00023 } 00024 00025 using ChannelElement<T>::read; 00026 00030 virtual FlowStatus read(typename ChannelElement<T>::reference_t sample) 00031 { return NoData; } 00032 00033 virtual bool inputReady() 00034 { 00035 return true; 00036 } 00037 00038 virtual void disconnect(bool forward) 00039 { 00040 // Call the base class first 00041 // base::ChannelElement<T>::disconnect(forward); 00042 // 00043 // Publication<T>* port = this->port; 00044 // if (port && !forward) 00045 // { 00046 // this->port = 0; 00047 // port->removeConnection(); 00048 // } 00049 } 00050 }; 00051 00052 } 00053 00054 #endif