aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentHandler.h
blob: e2de554fcb427c3b360a81d18ed1785dbd7944b2 (plain) (blame)
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
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */
 
#pragma once 
#include <aws/core/utils/HashingUtils.h> 
#include <aws/core/utils/event/EventStreamHandler.h> 
#include <aws/core/client/AWSError.h> 
#include <aws/s3/S3_EXPORTS.h> 
#include <aws/s3/S3Errors.h> 
 
#include <aws/s3/model/RecordsEvent.h> 
#include <aws/s3/model/StatsEvent.h> 
#include <aws/s3/model/ProgressEvent.h> 
 
namespace Aws 
{ 
namespace S3 
{ 
namespace Model 
{ 
    enum class SelectObjectContentEventType 
    { 
        RECORDS, 
        STATS, 
        PROGRESS, 
        CONT, 
        END, 
        UNKNOWN 
    }; 
 
    class AWS_S3_API SelectObjectContentHandler : public Aws::Utils::Event::EventStreamHandler 
    { 
        typedef std::function<void(const RecordsEvent&)> RecordsEventCallback;
        typedef std::function<void(const StatsEvent&)> StatsEventCallback; 
        typedef std::function<void(const ProgressEvent&)> ProgressEventCallback; 
        typedef std::function<void()> ContinuationEventCallback; 
        typedef std::function<void()> EndEventCallback; 
        typedef std::function<void(const Aws::Client::AWSError<S3Errors>& error)> ErrorCallback; 

    public: 
        SelectObjectContentHandler(); 
        SelectObjectContentHandler& operator=(const SelectObjectContentHandler& handler) = default;
 
        virtual void OnEvent() override; 
 
        inline void SetRecordsEventCallback(const RecordsEventCallback& callback) { m_onRecordsEvent = callback; } 
        inline void SetStatsEventCallback(const StatsEventCallback& callback) { m_onStatsEvent = callback; } 
        inline void SetProgressEventCallback(const ProgressEventCallback& callback) { m_onProgressEvent = callback; } 
        inline void SetContinuationEventCallback(const ContinuationEventCallback& callback) { m_onContinuationEvent = callback; } 
        inline void SetEndEventCallback(const EndEventCallback& callback) { m_onEndEvent = callback; } 
        inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; } 
 
    private: 
        void HandleEventInMessage(); 
        void HandleErrorInMessage(); 
        void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
 
        RecordsEventCallback m_onRecordsEvent; 
        StatsEventCallback m_onStatsEvent; 
        ProgressEventCallback m_onProgressEvent; 
        ContinuationEventCallback m_onContinuationEvent; 
        EndEventCallback m_onEndEvent; 
        ErrorCallback m_onError; 
    }; 
 
namespace SelectObjectContentEventMapper 
{ 
    AWS_S3_API SelectObjectContentEventType GetSelectObjectContentEventTypeForName(const Aws::String& name); 
 
    AWS_S3_API Aws::String GetNameForSelectObjectContentEventType(SelectObjectContentEventType value); 
} // namespace SelectObjectContentEventMapper 
} // namespace Model 
} // namespace S3 
} // namespace Aws