OutPortConnector.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef RTC_OUTPORTCONNECTOR_H
21 #define RTC_OUTPORTCONNECTOR_H
22 
23 #include <rtm/SystemLogger.h>
24 #include <rtm/ConnectorBase.h>
25 
26 namespace RTC
27 {
49  : public ConnectorBase
50  {
51  public:
53 
62 
70  virtual ~OutPortConnector();
84  const ConnectorInfo& profile();
85 
99  const char* id();
100 
114  const char* name();
115 
129  virtual ReturnCode disconnect() = 0;
130 
144  virtual CdrBufferBase* getBuffer() = 0;
145 
159  virtual ReturnCode write(const cdrMemoryStream& data) = 0;
160 
174  virtual void setEndian(const bool endian_type);
175 
193  virtual bool isLittleEndian();
194 
208  template <class DataType>
209  ReturnCode write(const DataType& data)
210  {
211  m_cdr.rewindPtrs();
212  RTC_TRACE(("connector endian: %s", isLittleEndian() ? "little":"big"));
213  m_cdr.setByteSwapFlag(isLittleEndian());
214  data >>= m_cdr;
215  return write(m_cdr);
216  }
217 
218  protected:
250  cdrMemoryStream m_cdr;
251 
252  };
253 }; // namespace RTC
254 
255 #endif // RTC_CONNECTORBASE_H
ReturnCode write(const DataType &data)
The conversion template of the data type.
#define DATAPORTSTATUS_ENUM
Importing RTC::DataPortStatus macro.
RT-Component.
DATAPORTSTATUS_ENUM OutPortConnector(ConnectorInfo &info)
Constructor.
RT component logger class.
Connector Base class.
virtual CdrBufferBase * getBuffer()=0
Getting Buffer.
virtual void setEndian(const bool endian_type)
Setting an endian type.
ConnectorInfo m_profile
PortProfile of the Port.
Enum
DataPortStatus return codes.
Definition: BufferStatus.h:84
virtual bool isLittleEndian()
return it whether endian setting.
Connector base class.
virtual ReturnCode write(const cdrMemoryStream &data)=0
Destructor.
#define RTC_TRACE(fmt)
cdrMemoryStream m_cdr
CDR stream.
virtual ReturnCode disconnect()=0
Disconnect connection.
Logger rtclog
Logger stream.
BufferBase abstract class.
Definition: BufferBase.h:104
const char * id()
Getting Connector ID.
const ConnectorInfo & profile()
Getting Profile.
virtual ~OutPortConnector()
Destructor.
const char * name()
Getting Connector name.
bool m_littleEndian
Connected Endian.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:43