バッファからデータを取り出してコンソールに出力するデータリーダーがあります。今私はリアルタイムでtexteditにデータを見たいと思います。 私は、データがテキストファイルからどのように(非リアルタイムで)読み込まれるかを示すいくつかの例を見てきました。データリーダ端末からリアルタイムでGUIにデータを取得
添付ファイルをご覧ください。ここで
/* Create a DataReader for the chatMessageTopic Topic (using the appropriate QoS). */
parentReader = chatSubscriber->create_datareader(
chatMessageTopic.in(),
DATAREADER_QOS_USE_TOPIC_QOS,
NULL,
STATUS_MASK_NONE);
checkHandle(parentReader.in(), "DDS::Subscriber::create_datareader");
/* Narrow the abstract parent into its typed representative. */
chatAdmin = Chat::ChatMessageDataReader::_narrow(parentReader.in());
checkHandle(chatAdmin.in(), "Chat::ChatMessageDataReader::_narrow");
/* Print a message that the MessageBoard has opened. */
cout << "MessageBoard has opened: send ChatMessages...." << endl << endl;
while (!terminated) {
/* Note: using read does not remove the samples from
unregistered instances from the DataReader. This means
that the DataRase would use more and more resources.
That's why we use take here instead. */
status = chatAdmin->take(
msgSeq,
infoSeq,
LENGTH_UNLIMITED,
ANY_SAMPLE_STATE,
ANY_VIEW_STATE,
ALIVE_INSTANCE_STATE);
checkStatus(status, "Chat::ChatMessageDataReader::take");
for (DDS::ULong i = 0; i < msgSeq->length(); i++) {
ChatMessage *msg = &(msgSeq[i]);
cout << msg->index << ": " << msg->content << endl;
fflush(stdout);
}
status = chatAdmin->return_loan(msgSeq, infoSeq);
checkStatus(status, "Chat::ChatMessageDataReader::return_loan");
QtCreatorはIDEです。あなたはQtを使っています! –
RTI Connext C++ APIを使用していると言えます。 –
これはPrismtech C++プログラムです –