client-cpp  0.6.3
GenericTransportInfo.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 CyberVision, Inc.
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  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef KAA_CHANNEL_GENERICTRANSPORTINFO_HPP_
18 #define KAA_CHANNEL_GENERICTRANSPORTINFO_HPP_
19 
20 #include <botan/base64.h>
21 
23 
24 namespace kaa {
25 
26 
28 {
29 public:
30  GenericTransportInfo(ServerType type, const ProtocolMetaData& metaData) :
31  serverType_(type), accessPointId_(metaData.accessPointId)
32  , protocolId_(metaData.protocolVersionInfo), connectionData_(metaData.connectionInfo) {}
33 
34  GenericTransportInfo(ServerType type, const std::int32_t& accessPointId
35  , const TransportProtocolId& protocolId, const std::vector<std::uint8_t>& connectionData)
36  : serverType_(type), accessPointId_(accessPointId)
37  , protocolId_(protocolId), connectionData_(connectionData) {}
38 
40  return serverType_;
41  }
42 
43  virtual std::int32_t getAccessPointId() {
44  return accessPointId_;
45  }
46 
48  return protocolId_;
49  }
50 
51  virtual const std::vector<std::uint8_t>& getConnectionInfo() {
52  return connectionData_;
53  }
54 
55 protected:
57  std::int32_t accessPointId_;
59  std::vector<std::uint8_t> connectionData_;
60 };
61 
62 } /* namespace kaa */
63 
64 #endif /* KAA_CHANNEL_GENERICTRANSPORTINFO_HPP_ */
virtual TransportProtocolId getTransportId()
virtual const std::vector< std::uint8_t > & getConnectionInfo()
virtual ServerType getServerType()
GenericTransportInfo(ServerType type, const ProtocolMetaData &metaData)
ServerType
Definition: ServerType.hpp:22
std::vector< std::uint8_t > connectionData_
GenericTransportInfo(ServerType type, const std::int32_t &accessPointId, const TransportProtocolId &protocolId, const std::vector< std::uint8_t > &connectionData)
virtual std::int32_t getAccessPointId()