-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtracker.h
53 lines (47 loc) · 2.47 KB
/
tracker.h
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
#include "db.h"
// Opaque type for tracker management
typedef struct tracker tracker_t;
/**
* @brief Low-level measurement data (invm) processing function
* @warning Should only be called with a full data cycle (i.e. beginning with a sentry record and containing ordered records up to the next sentry record exclusive)
* @note tracker_process_data_buffered is a wrapper around tracker_process_data that buffers data until next sentry record is found - a useful frontend.
*/
int tracker_process_data(tracker_t* pTracker,
const int nInvm,
const int nCycles,
const char** pTimes,
const char** pEpcs,
const char** pAntnos,
const char** pRxsss,
const char** pRxrates,
const char** pTxps,
const char** pRxlats,
const char** pMtypes,
const char** pRkts,
const char** pRkps);
/**
* @brief Application wrapper around `tracker_process_data` that buffers data until next sentry record is found
* @note This function is designed to be thread-safe, though it doesn't make sense to call it from multiple threads for the same lab as we block the critical section with a mutex anyway
*/
int tracker_process_data_buffered(tracker_t* pTracker,
const int nInvm,
const char** pTimes,
const char** pEpcs,
const char** pAntnos,
const char** pRxsss,
const char** pRxrates,
const char** pTxps,
const char** pRxlats,
const char** pMtypes,
const char** pRkts,
const char** pRkps,
const int* pIsSentry);
/**
* @brief Create a new tracker instance
* @note Resources allocation caused by this function and subsequent operations shall be freed after use by calling `tracker_free`. Usually one tracker instance per application should be enough though.
*/
tracker_t* tracker_new(db_t* pDb);
/**
* @brief Free resource allocation caused by `tracker_new` and subsequent operations
*/
void tracker_free(tracker_t* pTracker);