FETPAPI
0.3.0.0
This project provides C++ classes which facilitate the developement of ETP1.2 clients and servers.
Loading...
Searching...
No Matches
fetpapi-dev
src
etp
ProtocolHandlers
ProtocolHandlers.h
1
/*-----------------------------------------------------------------------
2
Licensed to the Apache Software Foundation (ASF) under one
3
or more contributor license agreements. See the NOTICE file
4
distributed with this work for additional information
5
regarding copyright ownership. The ASF licenses this file
6
to you under the Apache License, Version 2.0 (the
7
"License"; you may not use this file except in compliance
8
with the License. You may obtain a copy of the License at
9
10
http://www.apache.org/licenses/LICENSE-2.0
11
12
Unless required by applicable law or agreed to in writing,
13
software distributed under the License is distributed on an
14
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
KIND, either express or implied. See the License for the
16
specific language governing permissions and limitations
17
under the License.
18
-----------------------------------------------------------------------*/
19
#pragma once
20
21
#include <memory>
22
23
#include "../../nsDefinitions.h"
24
#include "../EtpMessages.h"
25
26
#if defined(_WIN32) && !defined(FETPAPI_STATIC)
27
#ifndef FETPAPI_DLL_IMPORT_OR_EXPORT
28
#if defined(Fetpapi_EXPORTS)
29
#define FETPAPI_DLL_IMPORT_OR_EXPORT __declspec(dllexport)
30
#else
31
#define FETPAPI_DLL_IMPORT_OR_EXPORT __declspec(dllimport)
32
#endif
33
#endif
34
#else
35
#define FETPAPI_DLL_IMPORT_OR_EXPORT
36
#endif
37
38
namespace
ETP_NS
39
{
40
class
AbstractSession;
41
42
class
FETPAPI_DLL_IMPORT_OR_EXPORT
ProtocolHandlers
:
public
std::enable_shared_from_this<ProtocolHandlers>
43
{
44
protected
:
45
ProtocolHandlers
(
AbstractSession
* mySession): session(mySession) {}
46
47
AbstractSession
* session;
48
49
void
printDataObject(
const
Energistics::Etp::v12::Datatypes::Object::DataObject
& dataObject);
50
51
public
:
52
virtual
~ProtocolHandlers
() =
default
;
53
54
virtual
void
decodeMessageBody(
const
Energistics::Etp::v12::Datatypes::MessageHeader
& mh, avro::DecoderPtr d) = 0;
55
56
AbstractSession
* getSession() {
return
session; }
57
};
58
}
ETP_NS::AbstractSession
Definition
AbstractSession.h:51
ETP_NS::ProtocolHandlers
Definition
ProtocolHandlers.h:43
Energistics::Etp::v12::Datatypes::MessageHeader
Definition
EtpMessages.h:1784
Energistics::Etp::v12::Datatypes::Object::DataObject
Definition
EtpMessages.h:4693
Generated by
1.10.0