diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-16 11:19:10 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 10:28:01 +0200 |
| commit | be2926499af2e372c313d965533be3a7ee0dcf4d (patch) | |
| tree | 34501ef650da4a2990912bd0b38ed7135696c164 /Tobii EyeX/include/eyex-cpp/Command.inl | |
| parent | 6eb99f06be3ead3c898b400d7b9072583c7addf0 (diff) | |
add tobii eyex sdk
Diffstat (limited to 'Tobii EyeX/include/eyex-cpp/Command.inl')
| -rwxr-xr-x | Tobii EyeX/include/eyex-cpp/Command.inl | 70 |
1 files changed, 70 insertions, 0 deletions
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<const Context>& 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<InteractionObject> Command::GetData() const
+{
+ auto spProperty = GetProperty(TX_LITERAL_DATA);
+
+ std::shared_ptr<InteractionObject> spData;
+ if(spProperty->TryGetValue(&spData))
+ return spData;
+
+ return nullptr;
+}
+
+/*********************************************************************************************************************/
+
+inline void Command::SetData(const std::shared_ptr<InteractionObject>& spData)
+{
+ auto spProperty = GetProperty(TX_LITERAL_DATA);
+ spProperty->SetValue(spData);
+}
+
+/*********************************************************************************************************************/
+
+TX_NAMESPACE_END
+
+/*********************************************************************************************************************/
+
+#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Command__INL__)
+
+/*********************************************************************************************************************/
|
