RINASim  October 2016
Documentation of framework for OMNeT++
ConnectionId.h
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #ifndef CONNECTIONID_H_
24 #define CONNECTIONID_H_
25 
26 //Standard libraries
27 #include <omnetpp.h>
28 #include <string>
29 
30 //RINASim libraries
31 #include "QoSCube.h"
32 
33 //Consts
34 extern const int VAL_UNDEF_CEPID;
35 extern const int VAL_MGMT_CEPID;
36 
42 class ConnectionId: public cObject {
43  public:
44 
48  ConnectionId();
49 
53  virtual ~ConnectionId();
54 
59  int getDstCepId() const;
60 
65  void setDstCepId(int destCepId);
66 
71  std::string getQoSId() const;
72 
77  void setQoSId(std::string qoSId);
78 
83  int getSrcCepId() const;
84 
89  void setSrcCepId(int srcCepId);
90 
97  bool operator<(const ConnectionId other) const;
98 
105  bool operator==(const ConnectionId other) const;
106 
111  virtual ConnectionId *dup() const;
112 
118 
119 
124  std::string info() const;
125 
126  protected:
130  std::string qosId;
131 
135  int srcCEPId;
136 
140  int dstCEPId;
141 
142 };
143 
144 
145 std::ostream& operator<< (std::ostream& os, const ConnectionId& connId);
146 
147 #endif /* CONNECTIONID_H_ */
int srcCEPId
Source Connection-Endpoint identifier.
Definition: ConnectionId.h:135
int dstCEPId
Destination Connection-Endpoint identifier.
Definition: ConnectionId.h:140
ConnectionId & swapCepIds()
Exchanges source and destination CEP identifiers.
std::string getQoSId() const
Getter of selected QoS-cube identifier.
Definition: ConnectionId.cc:44
const int VAL_UNDEF_CEPID
Definition: ConnectionId.cc:26
const int VAL_MGMT_CEPID
Definition: ConnectionId.cc:27
bool operator==(const ConnectionId other) const
Equal operator overload.
Definition: ConnectionId.cc:94
Connection identifier as defined in specifications.
Definition: ConnectionId.h:42
int getSrcCepId() const
Getter of source Connection-Endpoint identifier.
Definition: ConnectionId.cc:54
virtual ConnectionId * dup() const
Duplicate overload creates exact copy of ConnectionId.
Definition: ConnectionId.cc:71
void setDstCepId(int destCepId)
Setter of destination Connection-Endpoint identifier.
Definition: ConnectionId.cc:39
ConnectionId()
Constructor of blank ConnectionId.
Definition: ConnectionId.cc:29
virtual ~ConnectionId()
Destructor assigning undefined values.
Definition: ConnectionId.cc:64
int getDstCepId() const
Getter of destination Connection-Endpoint identifier.
Definition: ConnectionId.cc:34
bool operator<(const ConnectionId other) const
Less operator overload.
Definition: ConnectionId.cc:80
std::string info() const
Info text outpu suitable for << strinng streams and WATCH.
std::string qosId
QoS-cube identifier.
Definition: ConnectionId.h:130
std::ostream & operator<<(std::ostream &os, const ConnectionId &connId)
void setQoSId(std::string qoSId)
Setter of selected QoS-cube identifier.
Definition: ConnectionId.cc:49
void setSrcCepId(int srcCepId)
Setter of source Connection-Endpoint identifier.
Definition: ConnectionId.cc:59