|
a/src/Common/ConnectionId.h |
|
b/src/Common/ConnectionId.h |
|
... |
|
... |
16 |
//
|
16 |
//
|
17 |
|
17 |
|
18 |
#ifndef CONNECTIONID_H_
|
18 |
#ifndef CONNECTIONID_H_
|
19 |
#define CONNECTIONID_H_
|
19 |
#define CONNECTIONID_H_
|
20 |
|
20 |
|
|
|
21 |
//Standard libraries
|
21 |
#include <cobject.h>
|
22 |
#include <cobject.h>
|
22 |
#include <string>
|
23 |
#include <string>
|
|
|
24 |
|
|
|
25 |
//RINASim libraries
|
23 |
#include "QosCube.h"
|
26 |
#include "QosCube.h"
|
24 |
|
27 |
|
25 |
//Consts
|
28 |
//Consts
|
26 |
extern const unsigned short VAL_RESERVEDQOSID;
|
29 |
extern const unsigned short VAL_RESERVEDQOSID;
|
27 |
extern const int VAL_UNDEF_CEPID;
|
30 |
extern const int VAL_UNDEF_CEPID;
|
28 |
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* @brief Connection identifier as defined in specifications
|
|
|
34 |
* @authors Vladimir Vesely (ivesely@fit.vutbr.cz)
|
|
|
35 |
* @date Last refactorized and documented 2014-10-28
|
|
|
36 |
*/
|
29 |
class ConnectionId: public cObject {
|
37 |
class ConnectionId: public cObject {
|
30 |
public:
|
38 |
public:
|
|
|
39 |
|
|
|
40 |
/**
|
|
|
41 |
* @brief Constructor of blank ConnectionId
|
|
|
42 |
*/
|
31 |
ConnectionId();
|
43 |
ConnectionId();
|
|
|
44 |
|
|
|
45 |
/**
|
|
|
46 |
* @brief Destructor assigning undefined values
|
|
|
47 |
*/
|
32 |
virtual ~ConnectionId();
|
48 |
virtual ~ConnectionId();
|
|
|
49 |
|
|
|
50 |
/**
|
|
|
51 |
* @brief Getter of destination Connection-Endpoint identifier
|
|
|
52 |
* @return Returns destination CEP-id
|
|
|
53 |
*/
|
33 |
unsigned int getDstCepId() const;
|
54 |
int getDstCepId() const;
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
* @brief Setter of destination Connection-Endpoint identifier
|
|
|
58 |
* @param destCepId A new destination CEP-id value
|
|
|
59 |
*/
|
34 |
void setDstCepId(unsigned int destCepId);
|
60 |
void setDstCepId(int destCepId);
|
|
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
* @brief Getter of selected QoS-cube identifier
|
|
|
64 |
* @return Returns QoS-cube identifier
|
|
|
65 |
*/
|
35 |
unsigned short getQoSId() const;
|
66 |
unsigned short getQoSId() const;
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* @brief Setter of selected QoS-cube identifier
|
|
|
70 |
* @param qoSId A new QoS-cube id value
|
|
|
71 |
*/
|
36 |
void setQoSId(unsigned short qoSId);
|
72 |
void setQoSId(unsigned short qoSId);
|
37 |
unsigned int getSrcCepId() const;
|
|
|
38 |
void setSrcCepId(unsigned int srcCepId);
|
|
|
39 |
|
73 |
|
|
|
74 |
/**
|
|
|
75 |
* @brief Getter of source Connection-Endpoint identifier
|
|
|
76 |
* @return Returns source CEP-id
|
|
|
77 |
*/
|
|
|
78 |
int getSrcCepId() const;
|
|
|
79 |
|
|
|
80 |
/**
|
|
|
81 |
* @brief Setter of source Connection-Endpoint identifier
|
|
|
82 |
* @param srcCepId A new source CEP-id value
|
|
|
83 |
*/
|
|
|
84 |
void setSrcCepId(int srcCepId);
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* @brief Less operator overload
|
|
|
88 |
* @param other ConnectionId for comparison
|
|
|
89 |
* @return True if this QosId, dstCEPid, srcCEPid are lesser than others.
|
|
|
90 |
* Otherwise returns false
|
|
|
91 |
*/
|
40 |
bool operator<(const ConnectionId other) const;
|
92 |
bool operator<(const ConnectionId other) const;
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* @brief Equal operator overload
|
|
|
96 |
* @param other ConnectionId for comparison
|
|
|
97 |
* @return True if this QosId, dstCEPid, srcCEPid are equal with others.
|
|
|
98 |
* Otherwise returns false
|
|
|
99 |
*/
|
41 |
bool operator==(const ConnectionId other) const;
|
100 |
bool operator==(const ConnectionId other) const;
|
42 |
|
101 |
|
|
|
102 |
/**
|
|
|
103 |
* @brief Duplicate overload creates exact copy of ConnectionId
|
|
|
104 |
* @return Pointer to a copy
|
|
|
105 |
*/
|
43 |
virtual ConnectionId *dup() const;
|
106 |
virtual ConnectionId *dup() const;
|
44 |
|
107 |
|
45 |
private:
|
108 |
/**
|
|
|
109 |
* @brief Exchanges source and destination CEP identifiers
|
|
|
110 |
* @return Pointer to this object
|
|
|
111 |
*/
|
|
|
112 |
ConnectionId& swapCepIds();
|
|
|
113 |
|
|
|
114 |
protected:
|
|
|
115 |
/**
|
|
|
116 |
* @brief QoS-cube identifier
|
|
|
117 |
*/
|
46 |
unsigned int qosId;
|
118 |
unsigned short qosId;
|
|
|
119 |
|
|
|
120 |
/**
|
|
|
121 |
* @brief Source Connection-Endpoint identifier
|
|
|
122 |
*/
|
47 |
unsigned int srcCEPId;
|
123 |
int srcCEPId;
|
|
|
124 |
|
|
|
125 |
/**
|
|
|
126 |
* @brief Destination Connection-Endpoint identifier
|
|
|
127 |
*/
|
48 |
unsigned int dstCEPId;
|
128 |
int dstCEPId;
|
49 |
|
129 |
|
50 |
};
|
130 |
};
|
51 |
|
131 |
|
52 |
#endif /* CONNECTIONID_H_ */
|
132 |
#endif /* CONNECTIONID_H_ */
|