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 --- Tobii EyeX/include/eyex-cpp/Command.inl | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/Command.inl (limited to 'Tobii EyeX/include/eyex-cpp/Command.inl') diff --git a/Tobii EyeX/include/eyex-cpp/Command.inl b/Tobii EyeX/include/eyex-cpp/Command.inl new file mode 100755 index 0000000..953687f --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/Command.inl @@ -0,0 +1,70 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * Command.inl + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Command__INL__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_Command__INL__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +inline Command::Command(const std::shared_ptr& spContext, TX_HANDLE hCommand) +: InteractionObject(spContext, hCommand) +{} + +/*********************************************************************************************************************/ + +inline TX_COMMANDTYPE Command::GetType() const +{ + TX_COMMANDTYPE commandType; + TX_VALIDATE(txGetCommandType(_hObject, &commandType)); + return commandType; +} + +/*********************************************************************************************************************/ + +inline void Command::ExecuteAsync(AsyncDataHandler fnHandler) +{ + auto spThis = shared_from_this(); + auto fnProxy = [&, spThis, fnHandler](TX_CONSTHANDLE hAsyncData) + { + GetContext()->InvokeAsyncDataHandler(hAsyncData, fnHandler); + }; + + TX_VALIDATE(Tx::ExecuteCommandAsync(_hObject, fnProxy)); +} + +/*********************************************************************************************************************/ + +inline std::shared_ptr Command::GetData() const +{ + auto spProperty = GetProperty(TX_LITERAL_DATA); + + std::shared_ptr spData; + if(spProperty->TryGetValue(&spData)) + return spData; + + return nullptr; +} + +/*********************************************************************************************************************/ + +inline void Command::SetData(const std::shared_ptr& spData) +{ + auto spProperty = GetProperty(TX_LITERAL_DATA); + spProperty->SetValue(spData); +} + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Command__INL__) + +/*********************************************************************************************************************/ -- cgit v1.2.3