RINASim  October 2016
Documentation of framework for OMNeT++
QueueInfo.cc
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  * @file QueueInfo.cc
24  * @author Marcel Marek
25  * @date Apr 28, 2016
26  * @brief
27  * @detail
28  */
29 
30 #include <QueueInfo.h>
31 
33 
35 {
36  // TODO Auto-generated constructor stub
37 
38 }
39 
40 unsigned int QueueInfo::getCapacity() const
41 {
42  return capacity;
43 }
44 
45 void QueueInfo::setCapacity(unsigned int capacity)
46 {
47  this->capacity = capacity;
48 }
49 
51 {
52  return flow;
53 }
54 
56 {
57  this->flow = flow;
58 }
59 
60 unsigned int QueueInfo::getOccupied() const
61 {
62  return occupied;
63 }
64 
65 void QueueInfo::setOccupied(unsigned int occupied)
66 {
67  this->occupied = occupied;
68 }
69 
70 unsigned int QueueInfo::getFree() const
71 {
72  if(occupied > capacity){
73  return 0;
74  }else{
75  return capacity - occupied;
76  }
77 
78 }
79 
80 
82 {
83  // TODO Auto-generated destructor stub
84 }
85 
unsigned int getFree() const
Definition: QueueInfo.cc:70
Class representing flow object with attributes from specs.
Definition: Flow.h:45
Register_Class(QueueInfo)
unsigned int occupied
Definition: QueueInfo.h:41
unsigned int capacity
Definition: QueueInfo.h:40
virtual ~QueueInfo()
Definition: QueueInfo.cc:81
void setOccupied(unsigned int occupied)
Definition: QueueInfo.cc:65
void setCapacity(unsigned int capacity)
Definition: QueueInfo.cc:45
Flow * flow
Definition: QueueInfo.h:39
void setFlow(Flow *flow)
Definition: QueueInfo.cc:55
Flow * getFlow() const
Definition: QueueInfo.cc:50
unsigned int getCapacity() const
Definition: QueueInfo.cc:40
unsigned int getOccupied() const
Definition: QueueInfo.cc:60