-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCollectionSchemeIngestionList.h
74 lines (58 loc) · 2.17 KB
/
CollectionSchemeIngestionList.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "ICollectionSchemeList.h"
#include "collection_schemes.pb.h"
#include <cstddef>
#include <cstdint>
#include <vector>
namespace Aws
{
namespace IoTFleetWise
{
/**
* @brief Setting a size limit in bytes for incoming collectionSchemes from cloud
*/
constexpr size_t COLLECTION_SCHEME_LIST_BYTE_SIZE_LIMIT = 128000000;
class CollectionSchemeIngestionList : public ICollectionSchemeList
{
public:
CollectionSchemeIngestionList() = default;
~CollectionSchemeIngestionList() override;
CollectionSchemeIngestionList( const CollectionSchemeIngestionList & ) = delete;
CollectionSchemeIngestionList &operator=( const CollectionSchemeIngestionList & ) = delete;
CollectionSchemeIngestionList( CollectionSchemeIngestionList && ) = delete;
CollectionSchemeIngestionList &operator=( CollectionSchemeIngestionList && ) = delete;
bool isReady() const override;
bool build() override;
const std::vector<ICollectionSchemePtr> &getCollectionSchemes() const override;
bool copyData( const std::uint8_t *inputBuffer, const size_t size ) override;
inline const std::vector<uint8_t> &
getData() const override
{
return mProtoBinaryData;
}
private:
/**
* @brief This vector will store the binary data copied from the IReceiver callback.
*/
std::vector<uint8_t> mProtoBinaryData;
/**
* @brief Flag which is true if proto binary data is processed into readable data structures.
*/
bool mReady{ false };
/**
* @brief Member variable that will hold the vector of collection collectionSchemes
*/
std::vector<ICollectionSchemePtr> mVectorCollectionSchemePtr;
/**
* @brief If the getCollectionSchemes function fails, it will return a reference to this empty list.
*/
const std::vector<ICollectionSchemePtr> EMPTY_COLLECTION_SCHEME_LIST{};
/**
* @brief Used internally to hold the collectionSchemes message from the protobuffer
*/
Schemas::CollectionSchemesMsg::CollectionSchemes mCollectionSchemeListMsg;
};
} // namespace IoTFleetWise
} // namespace Aws