blob: 75d41714ccf64a317c2541f9b0bec0de47f5ea50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/*********************************************************************************************************************
* Copyright 2013-2014 Tobii Technology AB. All rights reserved.
* InteractionObject.hpp
*********************************************************************************************************************/
#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONOBJECT__HPP__)
#define __TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONOBJECT__HPP__
/*********************************************************************************************************************/
TX_NAMESPACE_BEGIN
/*********************************************************************************************************************/
template <typename THandle>
class InteractionObjectBase :
public HandleWrapper<THandle>
{
public:
InteractionObjectBase(const std::shared_ptr<const Context>& spContext, THandle hObject);
TX_INTERACTIONOBJECTTYPE GetObjectType() const;
bool TryGetProperty(std::shared_ptr<Property>* pspProperty, const std::string& propertyName) const;
std::shared_ptr<Property> GetProperty(const std::string& propertyName) const;
std::vector<std::shared_ptr<Property>> GetProperties() const;
void CopyPropertiesTo(const std::shared_ptr<InteractionObject>& spObject) const;
std::string FormatAsText() const;
public:
template <typename TValue>
typename PropertyValueResolver<TValue>::ValueType GetPropertyValue(const std::string& propertyName) const;
template <typename TValue>
bool TryGetPropertyValue(TValue* pValue, const std::string& propertyName) const;
};
/*********************************************************************************************************************/
class InteractionObject :
public InteractionObjectBase<TX_HANDLE>
{
public:
InteractionObject(const std::shared_ptr<const Context>& spContext, TX_HANDLE hObject);
virtual ~InteractionObject();
std::shared_ptr<Property> CreateProperty(const std::string& propertyName);
public:
template <typename TValue>
void SetPropertyValue(const std::string& propertyName, const TValue& value);
};
/*********************************************************************************************************************/
TX_NAMESPACE_END
/*********************************************************************************************************************/
#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONOBJECT__HPP__)
/*********************************************************************************************************************/
|