94 template <
class DataType>
153 bool read_block =
false,
bool write_block =
false,
154 int read_timeout = 0,
int write_timeout = 0)
155 #if defined(__GNUC__) && (__GNUC__ <= 3 && __GNUC_MINOR__ <= 3) 156 :
InPortBase(name, ::CORBA_Util::toRepositoryIdOfStruct<DataType>()),
158 :
InPortBase(name, ::CORBA_Util::toRepositoryId<DataType>()),
161 m_name(name), m_value(value),
162 m_OnRead(NULL), m_OnReadConvert(NULL),
163 m_status(1), m_directNewData(
false)
210 return m_name.c_str();
246 Guard gurad(m_valueMutex);
247 if (m_directNewData ==
true)
249 RTC_DEBUG((
"isNew() returns true because of direct write."));
266 RTC_DEBUG((
"isNew() = true, readable data: %d", r));
270 RTC_DEBUG((
"isNew() = false, no readable data"));
300 if (m_directNewData ==
true) {
return false; }
318 RTC_DEBUG((
"isEmpty() = true, buffer is empty"));
322 RTC_DEBUG((
"isEmpty() = false, data exists in the buffer"));
326 virtual void write(
const DataType& data)
328 Guard guard(m_valueMutex);
330 m_directNewData =
true;
411 if (m_OnRead != NULL)
418 Guard guard(m_valueMutex);
419 if (m_directNewData ==
true)
422 if (m_OnReadConvert != 0)
424 m_value = (*m_OnReadConvert)(m_value);
425 RTC_DEBUG((
"OnReadConvert for direct data called"));
428 m_directNewData =
false;
458 Guard guard(m_valueMutex);
461 if (m_OnReadConvert != 0)
463 m_value = (*m_OnReadConvert)(m_value);
484 RTC_ERROR((
"unknown retern value from buffer.read()"));
665 m_OnReadConvert = on_rconvert;
669 std::string m_typename;
723 bool m_directNewData;
728 #endif // RTC_INPORT_H virtual void write(const DataType &data)
データの書き込み
Definition: InPort.h:326
#define RTC_ERROR(fmt)
エラーログ出力マクロ。
Definition: SystemLogger.h:500
#define DATAPORTSTATUS_ENUM
RTC::DataPortStatus 導入
Definition: DataPortStatus.h:233
#define RTC_TRACE(fmt)
トレースログ出力マクロ。
Definition: SystemLogger.h:588
Mutex クラス
Definition: Mutex.h:40
coil::Mutex m_connectorsMutex
Definition: PortBase.h:2110
Definition: ConnectorListener.h:146
virtual ~InPort(void)
デストラクタ
Definition: InPort.h:187
DATAPORTSTATUS_ENUM InPort(const char *name, DataType &value, int bufsize=64, bool read_block=false, bool write_block=false, int read_timeout=0, int write_timeout=0)
コンストラクタ
Definition: InPort.h:151
Definition: Timestamp.h:26
virtual const char * name()
ポート名称を取得する。
Definition: InPort.h:208
#define RTC_WARN(fmt)
ワーニングログ出力マクロ。
Definition: SystemLogger.h:522
virtual bool isEmpty()
バッファが空かどうか確認する
Definition: InPort.h:297
read() 時のデータ変換コールバック抽象クラス
Definition: PortCallback.h:385
void setOnReadConvert(OnReadConvert< DataType > *on_rconvert)
InPort バッファへデータ読み出し時のコールバックの設定
Definition: InPort.h:663
std::vector< DataPortStatus::Enum > DataPortStatusList
Definition: DataPortStatus.h:206
direct接続用InPort基底クラス
Definition: DirectInPortBase.h:48
#define RTC_DEBUG(fmt)
デバッグログ出力マクロ。
Definition: SystemLogger.h:566
InPortConnector base class.
virtual void update()
バインドされた T 型の変数に InPort バッファの最新値を読み込む
Definition: InPort.h:511
InPortBase(const char *name, const char *data_type)
コンストラクタ
DirectPortBase * m_directport
Definition: PortBase.h:2235
InPort 用 Port.
Definition: InPortBase.h:74
Definition: ConnectorListener.h:144
Definition: DataPortStatus.h:145
RTC::Port implementation for InPort.
InPort テンプレートクラス
Definition: InPort.h:95
virtual bool isNew()
最新データが存在するか確認する
Definition: InPort.h:238
DataPortStatus::Enum getStatus(int index)
特定のコネクタへの書き込みステータスを得る
Definition: InPort.h:575
void setOnRead(OnRead< DataType > *on_read)
InPort バッファへデータ読み込み時のコールバックの設定
Definition: InPort.h:635
Timestamp listener class.
DataPortStatusList getStatusList()
特定のコネクタへの書き込みステータスリストを得る
Definition: InPort.h:609
Definition: DataPortStatus.h:150
void operator>>(DataType &rhs)
T 型のデータへ InPort の最新値データを読み込む
Definition: InPort.h:536
void addConnectorDataListener(ConnectorDataListenerType listener_type, ConnectorDataListener *listener, bool autoclean=true)
ConnectorDataListener リスナを追加する
Enum
Definition: DataPortStatus.h:143
ConnectorList m_connectors
接続リスト
Definition: InPortBase.h:880
bool read()
DataPort から値を読み出す
Definition: InPort.h:407
read() 時のコールバック抽象クラス
Definition: PortCallback.h:323
Definition: DataPortStatus.h:149