From be2926499af2e372c313d965533be3a7ee0dcf4d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 May 2016 11:19:10 +0200 Subject: add tobii eyex sdk --- .../include/eyex-cpp/InteractionAgentBase.hpp | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/InteractionAgentBase.hpp (limited to 'Tobii EyeX/include/eyex-cpp/InteractionAgentBase.hpp') diff --git a/Tobii EyeX/include/eyex-cpp/InteractionAgentBase.hpp b/Tobii EyeX/include/eyex-cpp/InteractionAgentBase.hpp new file mode 100755 index 0000000..3ca22d4 --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/InteractionAgentBase.hpp @@ -0,0 +1,79 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * InteractionAgentBase.hpp + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONAGENTBASE__HPP__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONAGENTBASE__HPP__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +class InteractionAgentBase +{ +public: + void Initialize(); + void Uninitialize(); + + std::shared_ptr GetContext() const; + +protected: + InteractionAgentBase(bool trackObjects = true); + + virtual void OnInitialize() {} + virtual void OnUninitialize() {} + virtual void OnRegisterQueryHandlers(); + + virtual void OnConnectionStateChanged(TX_CONNECTIONSTATE state) {} + virtual void OnNotification(const std::shared_ptr& spNotification) {} + virtual void OnQuery(const std::shared_ptr& spQuery) {} + virtual void OnEvent(const std::shared_ptr& spEvent) {} + + virtual std::shared_ptr InitializeEyeX(); + virtual TX_LOGGINGMODEL* GetLoggingModel(); + virtual TX_THREADINGMODEL* GetThreadingModel() { return nullptr; } + virtual TX_SCHEDULINGMODEL* GetSchedulingModel() { return nullptr; } + + void RegisterQueryHandler(const std::string& processId); + + bool IsRunning() const; + +private: + bool _isRunning; + + std::shared_ptr _spContext; + TX_TICKET _connectionStateChangedHandlerTicket; + std::vector _messageHandlerTickets; + std::shared_ptr _spSystem; + bool _trackObjects; + + TX_LOGGINGMODEL _defaultLoggingModel; +}; + +/*********************************************************************************************************************/ + +class AutoRespondingInteractionAgentBase : + public InteractionAgentBase +{ +public: + AutoRespondingInteractionAgentBase(bool trackObjects = true); + +protected: + void OnQuery(const std::shared_ptr& spQuery) override; + + virtual bool PrepareSnapshot(const std::shared_ptr& spSnapshot) { return false; } + virtual void OnSnapshotResult(const std::unique_ptr& upAsyncData) {} +}; + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONAGENTBASE__HPP__) + +/*********************************************************************************************************************/ -- cgit v1.2.3