summaryrefslogtreecommitdiffhomepage
path: root/Tobii-EyeX/include/eyex-cpp/Notification.inl
blob: 180fcd221609323d618deab25fec113c50757f44 (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
/*********************************************************************************************************************
 * Copyright 2013-2014 Tobii Technology AB. All rights reserved.
 * Notification.inl
 *********************************************************************************************************************/

#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Notification__INL__)
#define __TOBII_TX_CLIENT_CPPBINDINGS_Notification__INL__

/*********************************************************************************************************************/

TX_NAMESPACE_BEGIN
	
/*********************************************************************************************************************/

inline Notification::Notification(const std::shared_ptr<const Context>& spContext, TX_HANDLE hNotification) 
: InteractionObject(spContext, hNotification)
{ }

/*********************************************************************************************************************/
	              
inline TX_NOTIFICATIONTYPE Notification::GetNotificationType() const
{
    TX_NOTIFICATIONTYPE notificationType;
    TX_VALIDATE(txGetNotificationType(_hObject, &notificationType));
    return notificationType;
}

/*********************************************************************************************************************/

inline std::shared_ptr<InteractionObject> Notification::GetData() const
{
    Tx::Utils::ScopedHandle hData;
    if(!TX_VALIDATE(txGetNotificationData(_hObject, &hData), TX_RESULT_NOTFOUND))
        return nullptr;

    auto spData = _spContext->CreateObject(hData);
	return spData;
}

/*********************************************************************************************************************/

TX_NAMESPACE_END

/*********************************************************************************************************************/


#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Notification__INL__)

/*********************************************************************************************************************/