m2etis  0.4
NetworkType.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_NETWORKTYPE_H__
23 #define __M2ETIS_NET_NETWORKTYPE_H__
24 
25 #include "m2etis/util/Exceptions.h"
26 
28 #include "m2etis/net/NetworkName.h"
29 
30 namespace m2etis {
31 
32 // Forward declarations
33 namespace sim {
34  class OmNetKeyProvider;
35 } /* namespace sim */
36 
37 namespace message {
38  template<class T>
39  class Key;
40 
41  class SHA1KeyProvider;
42  class IPv4KeyProvider;
43 
44  template<class S>
45  class NetworkMessage;
46 } /* namespace message */
47 
48 namespace net {
49 
50  class NullProvider {
51  public:
53  M2ETIS_THROW_FAILURE("NullProvider", "This class should never be instantiated", 1);
54  }
55  };
56 
57  template<class NetType>
58  class KeyPChooser {
59  public:
61  };
62 
63  template<NetworkName nettype>
64  class NetworkType {
65  public:
66  enum {
67  value = nettype
68  };
69 
76  };
77 
78  template<>
80  public:
82  };
83 
84  template<>
86  public:
88  };
89 
90  template<>
92  public:
94  };
95 
96  template<>
98  public:
100  };
101 
102  template<>
104  public:
106  };
107 
108 } /* namespace net */
109 } /* namespace m2etis */
110 
111 #endif /* __M2ETIS_NET_NETWORKTYPE_H__ */
112 
#define M2ETIS_THROW_FAILURE(module, message, errorcode)
throws on internal errors
Definition: Exceptions.h:33
KeyPChooser< NetworkType< nettype > >::KeyProvider KeyProvider
Definition: NetworkType.h:72
NetworkType< nettype > type
Definition: NetworkType.h:71
message::MessageType MessageType
Definition: NetworkType.h:75
NullProvider KeyProvider
Definition: NetworkType.h:60
message::NetworkMessage< type > Message
Definition: NetworkType.h:74
uint32_t MessageType
Definition: MessageType.h:35
message::Key< KeyProvider > Key
Definition: NetworkType.h:73