-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathCAPIClient.hpp
102 lines (79 loc) · 1.79 KB
/
CAPIClient.hpp
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
#ifndef EVENTSCLIENT_HPP
#define EVENTSCLIENT_HPP
//
// Header-only implementation of C++03 API on top of stable C ABI
//
#include "ctmacros.hpp"
#include "mat.h"
/* This class is currently incompatible with Secure Template Overloads */
#ifdef evt_log
#undef evt_log
#endif
namespace MAT_NS_BEGIN
{
class CAPIClient
{
protected:
evt_handle_t handle;
evt_handle_t lib;
public:
CAPIClient(evt_handle_t lib_ = 0) :
handle(0),
lib(lib_)
{
if (lib != 0)
evt_load(lib);
}
virtual ~CAPIClient()
{
if (lib != 0)
evt_unload(lib);
}
evt_handle_t open(const char* config)
{
handle = evt_open(config);
return handle;
};
evt_status_t configure(const char* config)
{
return evt_configure(handle, config);
}
evt_status_t log(evt_prop* evt)
{
return evt_log(handle, evt);
}
evt_status_t pause()
{
return evt_pause(handle);
}
evt_status_t resume()
{
return evt_resume(handle);
}
evt_status_t upload()
{
return evt_upload(handle);
}
evt_status_t flushAndTeardown()
{
return evt_flushAndTeardown(handle);
}
evt_status_t flush()
{
return evt_flush(handle);
}
evt_status_t close()
{
return evt_close(handle);
}
const char * version()
{
return evt_version();
}
};
} MAT_NS_END
#endif