m2etis  0.4
NetworkFactory.h
Go to the documentation of this file.
1 /*
2  Copyright (2016) Michael Baer, Daniel Bonrath, 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  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 
22 #ifndef __M2ETIS_NET_NETWORKFACTORY_H__
23 #define __M2ETIS_NET_NETWORKFACTORY_H__
24 
25 #include "m2etis/util/Exceptions.h"
26 
29 #include "m2etis/net/NetworkName.h"
30 #include "m2etis/net/NetworkType.h"
31 
32 namespace m2etis {
33 namespace pubsub {
35 } /* namespace pubsub */
36 namespace net {
37 
45  public:
46  NetworkFactory(const std::string & listenIP, const unsigned short listenPort, const std::string & connectIP, const unsigned short connectPort, pubsub::PubSubSystemEnvironment * pssi);
47 
49 
55  template<class NetworkType>
57  M2ETIS_THROW_FAILURE("NetworkFactory", "Wrong Usage of Network Factory! Call with existing NetworkType!", 1);
58  }
59 
60 #ifdef WITH_CHIMERA
62 #endif
63 
67 
68 #ifdef WITH_SIM
70 #endif
71 
72  private:
73  std::string _listenIP;
74  unsigned short _listenPort;
75  std::string _connectIP;
76  unsigned short _connectPort;
78 #ifdef WITH_CHIMERA
79  NetworkController<NetworkType<CHIMERA>> * chimeracontroller_;
80 #endif /* WITH_CHIMERA */
81 
82 #ifdef WITH_SIM
83  NetworkController<NetworkType<OMNET>> * simcontroller_;
84 #endif
85 
86  NetworkController<NetworkType<TCP>> * tcpcontroller_;
87  NetworkController<NetworkType<UDP>> * udpcontroller_;
88  NetworkController<NetworkType<clockTCP>> * clocktcpcontroller_;
89  };
90 
91 } /* namespace net */
92 } /* namespace m2etis */
93 
94 #endif /* __M2ETIS_NET_NETWORKFACTORY_H__ */
95 
#define M2ETIS_THROW_FAILURE(module, message, errorcode)
throws on internal errors
Definition: Exceptions.h:33
NetworkController< NetworkType > * createNetworkController(NetworkType)
creates NetworkController
NetworkFactory(const std::string &listenIP, const unsigned short listenPort, const std::string &connectIP, const unsigned short connectPort, pubsub::PubSubSystemEnvironment *pssi)