F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SizedContainer.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title SizedContainer
3
// \author bocchino
4
// \brief An abstract base class representing a sized container
5
// ======================================================================
6
7
#ifndef Fw_SizedContainer_HPP
8
#define Fw_SizedContainer_HPP
9
10
#include "
Fw/FPrimeBasicTypes.hpp
"
11
12
namespace
Fw
{
13
14
class
SizedContainer
{
15
private
:
16
// ----------------------------------------------------------------------
17
// Private constructors
18
// ----------------------------------------------------------------------
19
22
SizedContainer
(
const
SizedContainer
&) =
delete
;
23
24
protected
:
25
// ----------------------------------------------------------------------
26
// Protected constructors and destructors
27
// ----------------------------------------------------------------------
28
30
SizedContainer
() {}
31
33
virtual
~SizedContainer
() =
default
;
34
35
private
:
36
// ----------------------------------------------------------------------
37
// Private member functions
38
// ----------------------------------------------------------------------
39
43
SizedContainer
& operator=(
const
SizedContainer
&) =
delete
;
44
45
public
:
46
// ----------------------------------------------------------------------
47
// Public member functions
48
// ----------------------------------------------------------------------
49
51
virtual
void
clear
() = 0;
52
55
virtual
FwSizeType
getSize
()
const
= 0;
56
59
virtual
FwSizeType
getCapacity
()
const
= 0;
60
63
bool
isEmpty
()
const
{
return
this->
getSize
() == 0; }
64
67
bool
isFull
()
const
{
return
this->
getSize
() >= this->
getCapacity
(); }
68
};
69
70
}
// namespace Fw
71
72
#endif
Fw::SizedContainer::isEmpty
bool isEmpty() const
Definition:
SizedContainer.hpp:63
Fw::SizedContainer::isFull
bool isFull() const
Definition:
SizedContainer.hpp:67
FwSizeType
PlatformSizeType FwSizeType
Definition:
FwSizeTypeAliasAc.h:15
Fw::SizedContainer::getSize
virtual FwSizeType getSize() const =0
FPrimeBasicTypes.hpp
Fw::SizedContainer
Definition:
SizedContainer.hpp:14
Fw::SizedContainer::~SizedContainer
virtual ~SizedContainer()=default
Destructor.
Fw::SizedContainer::SizedContainer
SizedContainer()
Zero-argument constructor.
Definition:
SizedContainer.hpp:30
Fw::SizedContainer::getCapacity
virtual FwSizeType getCapacity() const =0
Fw::SizedContainer::clear
virtual void clear()=0
Clear the container.
Fw
Definition:
FppConstantsAc.hpp:121
Fw
DataStructures
SizedContainer.hpp
Generated by
1.8.14