Bring the validation-scope line (in-tree Jenkins CI copy, lcov coverage wiring, step-by-step release-scope README, TetraIF unit tests, the LogView runtime icon/resource fix, Dockerfile, rpmbuild and the new_docker_build.sh driver with the DEB output path) on top of the XmlPatterns branch pruned to the Release 2 scope. Conflict policy: - Out-of-scope targets/modules: keep the prune (deletion wins). - In-scope files that validation had deleted: restored from story/release-2-cleanup (the Release 2 closure, with the pruned-module guards). - In-scope sources carrying migration work: XmlPatterns versions (Qt XmlPatterns rework on QDomDocument, DDS member and logger fixes, first-build fixes). - Scope-aware CMakeLists (top level, PluginInterfaces, LtsWidgets) and .envrc: story/release-2-cleanup / ours versions.
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* Handler which notifes the FTS-instances about new data
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
|
#include <QtCore/QString>
|
|
#include <QtCore/QUrl>
|
|
#include <QtCore/QFlag>
|
|
#include <dds/core/cond/Condition.hpp>
|
|
#include <dds/core/cond/GuardCondition.hpp>
|
|
#include <dds/core/cond/WaitSet.hpp>
|
|
#include <ddsgen_export.h>
|
|
#include <future>
|
|
#include <map>
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace DDSGeneric
|
|
{
|
|
class DDSGEN_EXPORT WaitSetHandler final
|
|
{
|
|
public:
|
|
class CallbackInterface
|
|
{
|
|
public:
|
|
virtual ~CallbackInterface() = default;
|
|
virtual void dataAvailable() = 0;
|
|
};
|
|
|
|
WaitSetHandler();
|
|
~WaitSetHandler();
|
|
|
|
bool attachWaitSet(const dds::core::cond::Condition& cond, CallbackInterface* cb);
|
|
bool detachWaitSet(const dds::core::cond::Condition& cond, CallbackInterface* cb);
|
|
bool enableWaitSet(const dds::core::cond::Condition& cond, CallbackInterface* cb);
|
|
bool disableWaitSet(const dds::core::cond::Condition& cond, CallbackInterface* cb);
|
|
|
|
int attachedConditionCount() const;
|
|
|
|
private:
|
|
NGL::INGLLogger& m_logger;
|
|
void waitSetTask();
|
|
|
|
struct WaitSetData final
|
|
{
|
|
dds::core::cond::Condition condition;
|
|
CallbackInterface* callback = nullptr;
|
|
bool enabled = true;
|
|
bool needWaitSetAttach = false;
|
|
|
|
WaitSetData(const dds::core::cond::Condition& cond, CallbackInterface* cb) : condition(cond), callback(cb) {}
|
|
};
|
|
|
|
dds::core::cond::WaitSet m_waitSet;
|
|
dds::core::cond::GuardCondition m_abortCondition;
|
|
std::future<void> m_task;
|
|
std::mutex m_accessMutex;
|
|
std::map<const DDS_Condition*, WaitSetData> m_waitSetData;
|
|
};
|
|
} // namespace DDSGeneric
|