-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathDataFetchManagerAPITypes.h
60 lines (50 loc) · 1.55 KB
/
DataFetchManagerAPITypes.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
53
54
55
56
57
58
59
60
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "CollectionInspectionAPITypes.h"
#include "SignalTypes.h"
#include <functional>
#include <unordered_map>
#include <vector>
namespace Aws
{
namespace IoTFleetWise
{
struct FetchRequest
{
SignalID signalID{ 0U };
std::string functionName;
std::vector<InspectionValue> args;
};
struct LastExecutionInfo
{
uint64_t lastExecutionMonotonicTimeMs{ 0 };
// TODO: below parameters are not yet supported by the cloud and are ignored on edge
uint64_t firstExecutionMonotonicTimeMs{ 0 };
uint32_t executionCount{ 0 };
};
struct PeriodicalFetchParameters
{
uint64_t fetchFrequencyMs{ 0U };
// TODO: below parameters are not yet supported by the cloud and are therefore ignored on edge
uint64_t maxExecutionCount{ 0U };
uint64_t maxExecutionCountResetPeriodMs{ 0U };
};
struct FetchMatrix
{
// Map of all fetch requests that were registered in the collection schemes
std::unordered_map<FetchRequestID, std::vector<FetchRequest>> fetchRequests;
// Map of periodical fetch parameters provided in the collection schemes
std::unordered_map<FetchRequestID, PeriodicalFetchParameters> periodicalFetchRequestSetup;
};
enum class FetchErrorCode
{
SUCCESSFUL,
SIGNAL_NOT_FOUND,
UNSUPPORTED_PARAMETERS,
NOT_IMPLEMENTED
};
using CustomFetchFunction =
std::function<FetchErrorCode( SignalID, FetchRequestID, const std::vector<InspectionValue> & )>;
} // namespace IoTFleetWise
} // namespace Aws