|
a/src/Common/CongestionDescriptor.cc |
|
b/src/Common/CongestionDescriptor.cc |
|
|
1 |
// The MIT License (MIT)
|
1 |
//
|
2 |
//
|
2 |
// This program is free software: you can redistribute it and/or modify
|
3 |
// Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
|
3 |
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
4 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
5 |
// (at your option) any later version.
|
|
|
6 |
//
|
4 |
//
|
7 |
// This program is distributed in the hope that it will be useful,
|
5 |
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
6 |
// of this software and associated documentation files (the "Software"), to deal
|
9 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
7 |
// in the Software without restriction, including without limitation the rights
|
10 |
// GNU Lesser General Public License for more details.
|
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 |
//
|
11 |
//
|
12 |
// You should have received a copy of the GNU Lesser General Public License
|
12 |
// The above copyright notice and this permission notice shall be included in
|
13 |
// along with this program. If not, see http://www.gnu.org/licenses/.
|
13 |
// all copies or substantial portions of the Software.
|
14 |
//
|
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.
|
15 |
|
22 |
|
16 |
#include <CongestionDescriptor.h>
|
23 |
#include <CongestionDescriptor.h>
|
17 |
|
24 |
|
18 |
Register_Class(CongestionDescriptor);
|
25 |
Register_Class(CongestionDescriptor);
|
19 |
|
26 |
|
20 |
CongestionDescriptor::CongestionDescriptor()
|
27 |
CongestionDescriptor::CongestionDescriptor()
|
21 |
{
|
28 |
{
|
22 |
ConId.setSrcCepId(-1);
|
29 |
ConId.setSrcCepId(-1);
|
23 |
ConId.setDstCepId(-1);
|
30 |
ConId.setDstCepId(-1);
|
24 |
ConId.setQoSId(0);
|
31 |
ConId.setQoSId(VAL_UNDEF_QOSID);
|
25 |
}
|
32 |
}
|
26 |
|
33 |
|
27 |
CongestionDescriptor::~CongestionDescriptor() {
|
34 |
CongestionDescriptor::~CongestionDescriptor() {
|
28 |
ConId.setSrcCepId(-1);
|
35 |
ConId.setSrcCepId(-1);
|
29 |
ConId.setDstCepId(-1);
|
36 |
ConId.setDstCepId(-1);
|
30 |
ConId.setQoSId(0);
|
37 |
ConId.setQoSId("");
|
31 |
}
|
38 |
}
|
32 |
|
39 |
|
33 |
ConnectionId& CongestionDescriptor::getConnectionId() {
|
40 |
ConnectionId& CongestionDescriptor::getConnectionId() {
|
34 |
return ConId;
|
41 |
return ConId;
|
35 |
}
|
42 |
}
|
36 |
|
43 |
|
37 |
CongestionDescriptor::CongestionDescriptor(int srcCepId, int dstCepId,
|
44 |
CongestionDescriptor::CongestionDescriptor(int srcCepId, int dstCepId,
|
38 |
unsigned short qosId)
|
45 |
std::string qosId)
|
39 |
{
|
46 |
{
|
40 |
ConId.setSrcCepId(srcCepId);
|
47 |
ConId.setSrcCepId(srcCepId);
|
41 |
ConId.setDstCepId(dstCepId);
|
48 |
ConId.setDstCepId(dstCepId);
|
42 |
ConId.setQoSId(qosId);
|
49 |
ConId.setQoSId(qosId);
|
43 |
}
|
50 |
}
|