SizedContainer
SizedContainer
is a class
defined in Fw/DataStructures
.
It is an abstract class representing a sized container.
1. Private Constructors
1.1. Copy Constructor
Defined as = delete
.
2. Protected Constructors and Destructors
2.1. Zero-Argument Constructor
Use default initialization of members.
2.2. Destructor
Defined as = default
.
3. Private Member Functions
3.1. operator=
Defined as = delete
.
4. Public Member Functions
4.1. clear
Clear the container.
Example:
4.2. getCapacity
Return the current capacity.
Example:
void f(const SizedContainer& c) {
const auto size = c.getSize();
const auto capacity = c.getCapacity();
ASSERT_LE(size, capacity);
}
4.3. getSize
Return the current size.
Example:
4.4. isEmpty
Return true
if the container is empty.
Example:
void f(const SizedContainer& c) {
if (c.size() == 0) {
ASSERT_TRUE(c.isEmpty());
} else {
ASSERT_FALSE(c.isEmpty());
}
}
4.5. isFull
Return true
if the container is full.
Example: