FETPAPI 0.3.0.0
This project provides C++ classes which facilitate the developement of ETP1.2 clients and servers.
Loading...
Searching...
No Matches
ProtocolHandlers.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under 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
38namespace 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}
Definition AbstractSession.h:51
Definition ProtocolHandlers.h:43