AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
InProcessAttachment.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_INPROCESSATTACHMENT_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_INPROCESSATTACHMENT_H_
18 
22 
24 
25 namespace alexaClientSDK {
26 namespace avsCommon {
27 namespace avs {
28 namespace attachment {
29 
34 public:
38 
40  static const int SDS_BUFFER_DEFAULT_SIZE_IN_BYTES = 0x100000;
41 
49  InProcessAttachment(const std::string& id, std::unique_ptr<SDSType> sds = nullptr, size_t maxNumReaders = 1);
50 
51  std::unique_ptr<AttachmentWriter> createWriter(
52  InProcessAttachmentWriter::SDSTypeWriter::Policy policy =
53  InProcessAttachmentWriter::SDSTypeWriter::Policy::ALL_OR_NOTHING) override;
54 
55  std::unique_ptr<AttachmentReader> createReader(InProcessAttachmentReader::SDSTypeReader::Policy policy) override;
56 
57 private:
59  std::shared_ptr<SDSType> m_sds;
61  const size_t m_maxNumReaders;
62 };
63 
64 } // namespace attachment
65 } // namespace avs
66 } // namespace avsCommon
67 } // namespace alexaClientSDK
68 
69 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_INPROCESSATTACHMENT_H_
::std::string string
Definition: gtest-port.h:1097
static const int SDS_BUFFER_DEFAULT_SIZE_IN_BYTES
Default size of underlying SDS when created internally.
Definition: InProcessAttachment.h:40
avsCommon::utils::sds::InProcessSDS SDSType
Type aliases for convenience.
Definition: InProcessAttachment.h:36
std::unique_ptr< AttachmentReader > createReader(InProcessAttachmentReader::SDSTypeReader::Policy policy) override
InProcessAttachment(const std::string &id, std::unique_ptr< SDSType > sds=nullptr, size_t maxNumReaders=1)
SharedDataStream< InProcessSDSTraits > InProcessSDS
Type alias for a SharedDataStream which works between threads in a single process.
Definition: InProcessSDS.h:54
avsCommon::utils::sds::InProcessSDSTraits::Buffer SDSBufferType
Definition: InProcessAttachment.h:37
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::vector< uint8_t > Buffer
A std::vector provides a simple container to hold a buffer for in-process usage.
Definition: InProcessSDS.h:41
std::unique_ptr< AttachmentWriter > createWriter(InProcessAttachmentWriter::SDSTypeWriter::Policy policy=InProcessAttachmentWriter::SDSTypeWriter::Policy::ALL_OR_NOTHING) override

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0