m2etis
0.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
27
#include "
m2etis/message/key/providers/IPv4KeyProvider.h
"
28
#include "
m2etis/net/NetworkController.h
"
29
#include "
m2etis/net/NetworkName.h
"
30
#include "
m2etis/net/NetworkType.h
"
31
32
namespace
m2etis
{
33
namespace
pubsub {
34
class
PubSubSystemEnvironment
;
35
}
/* namespace pubsub */
36
namespace
net {
37
44
class
NetworkFactory
{
45
public
:
46
NetworkFactory
(
const
std::string & listenIP,
const
unsigned
short
listenPort,
const
std::string & connectIP,
const
unsigned
short
connectPort,
pubsub::PubSubSystemEnvironment
* pssi);
47
48
~NetworkFactory
();
49
55
template
<
class
NetworkType>
56
NetworkController<NetworkType>
*
createNetworkController
(
NetworkType
) {
57
M2ETIS_THROW_FAILURE
(
"NetworkFactory"
,
"Wrong Usage of Network Factory! Call with existing NetworkType!"
, 1);
58
}
59
60
#ifdef WITH_CHIMERA
61
NetworkController<NetworkType<CHIMERA>
> *
createNetworkController
(
NetworkType<CHIMERA>
);
62
#endif
63
64
NetworkController<NetworkType<TCP>
> *
createNetworkController
(
NetworkType<TCP>
);
65
NetworkController<NetworkType<UDP>
> *
createNetworkController
(
NetworkType<UDP>
);
66
NetworkController<NetworkType<clockTCP>
> *
createNetworkController
(
NetworkType<clockTCP>
);
67
68
#ifdef WITH_SIM
69
NetworkController<NetworkType<OMNET>
> *
createNetworkController
(
NetworkType<OMNET>
);
70
#endif
71
72
private
:
73
std::string _listenIP;
74
unsigned
short
_listenPort;
75
std::string _connectIP;
76
unsigned
short
_connectPort;
77
pubsub::PubSubSystemEnvironment
* _pssi;
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
IPv4KeyProvider.h
m2etis::net::NetworkFactory::~NetworkFactory
~NetworkFactory()
NetworkName.h
M2ETIS_THROW_FAILURE
#define M2ETIS_THROW_FAILURE(module, message, errorcode)
throws on internal errors
Definition:
Exceptions.h:33
m2etis::pubsub::PubSubSystemEnvironment
Definition:
PubSubSystemEnvironment.h:46
NetworkController.h
m2etis::net::NetworkFactory::createNetworkController
NetworkController< NetworkType > * createNetworkController(NetworkType)
creates NetworkController
Definition:
NetworkFactory.h:56
Exceptions.h
m2etis::net::NetworkController
NetworkController.
Definition:
NetworkController.h:52
m2etis::net::NetworkFactory
NetworkFactory.
Definition:
NetworkFactory.h:44
m2etis
Definition:
DetMergeConfigTest.h:20
m2etis::net::NetworkType
Definition:
NetworkType.h:64
m2etis::net::NetworkFactory::NetworkFactory
NetworkFactory(const std::string &listenIP, const unsigned short listenPort, const std::string &connectIP, const unsigned short connectPort, pubsub::PubSubSystemEnvironment *pssi)
NetworkType.h
Projekte
m2etis
library
include
m2etis
net
NetworkFactory.h
Generated on Mon Jan 25 2016 01:06:05 for m2etis by
1.8.9.1