51 lines
1.4 KiB
C++
Executable File
51 lines
1.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* GenericFTS Interface
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <rti/core/SampleIdentity.hpp>
|
|
#include <QVector>
|
|
|
|
/**
|
|
* Note:
|
|
*
|
|
* The FTS calls a slot of the calling object (CO) to send the requestData to the CO.
|
|
* This slot needs to be implemented by the calling object (CO):
|
|
*
|
|
* public Q_SLOTS:
|
|
* void handleFunctionTopicRequest(const rti::core::SampleIdentity &requestIdentity, const TOPICTYPE_REQUEST &requestData);
|
|
*
|
|
* The CO processes the request and sends the feedback (and possible reply data) back to the FTS
|
|
* by calling the method:
|
|
*
|
|
* void sendReply(const rti::core::SampleIdentity &requestIdentity, const QVector<TOPICTYPE_REPLY> &replyData )
|
|
*
|
|
*
|
|
* - The FTS cannot use SIGNALS, because templates and QObject are incompatible.
|
|
* - The FTS and the CO are in different threads
|
|
*
|
|
* => reply data will be stored in a queue (std:queue) and the handling is done by a semaphore (QSemaphore)
|
|
*
|
|
* */
|
|
|
|
namespace FTS
|
|
{
|
|
// uses FTS (static)
|
|
template <typename TOPICTYPE_REQUEST, typename TOPICTYPE_REPLY>
|
|
class GenericFts
|
|
{
|
|
public:
|
|
GenericFts() = default;
|
|
virtual ~GenericFts() = default;
|
|
|
|
virtual bool sendReply(const rti::core::SampleIdentity &requestIdentity, const TOPICTYPE_REPLY &replyData) = 0;
|
|
virtual bool sendReply(const rti::core::SampleIdentity &requestIdentity, const QVector<TOPICTYPE_REPLY> &replyData) = 0;
|
|
};
|
|
|
|
}
|