Fast DDS中接收数据的访问方式
一、数据访问的基本操作
应用程序可以通过“读取(read)”或“提取(take)”操作来访问和使用DataReader
上接收的数据值。
1.1 读取操作
读取操作通过以下成员函数实现:
DataReader::read_next_sample()
:读取DataReader
上可用的、之前未被访问过的下一个数据值,并将其存储在提供的数据缓冲区中。DataReader::read()
、DataReader::read_instance()
和DataReader::read_next_instance()
:提供获取符合特定条件的样本集合的机制。
1.2 提取操作
提取操作通过以下成员函数实现:
DataReader::take_next_sample()
:读取DataReader
上可用的、之前未被访问过的下一个数据值,并将其存储在提供的数据缓冲区中。DataReader::take()
、DataReader::take_instance()
和DataReader::take_next_instanc