7 #ifndef Fw_CircularIndex_HPP 8 #define Fw_CircularIndex_HPP 28 : m_modulus(modulus) {
47 this->m_value = ci.m_value;
48 this->m_modulus = ci.m_modulus;
56 FW_ASSERT(this->m_value < this->m_modulus);
64 this->m_value = value % this->m_modulus;
69 FW_ASSERT(this->m_value < this->m_modulus);
70 return this->m_modulus;
76 this->m_modulus = modulus;
86 this->
setValue(this->m_value + offset);
95 const FwSizeType offset = amount % this->m_modulus;
96 this->
setValue(this->m_value + this->m_modulus - offset);
PlatformSizeType FwSizeType
FwSizeType getValue() const
CircularIndex()
Zero-argument constructor.
CircularIndex(FwSizeType modulus, FwSizeType value=0)
Constructor with specified members.
FwSizeType getModulus() const
Get the modulus.
CircularIndex & operator=(const CircularIndex &ci)
operator=
FwSizeType increment(FwSizeType amount=1)
void setModulus(FwSizeType modulus)
Set the modulus.
CircularIndex(const CircularIndex &ci)
Copy constructor.
~CircularIndex()=default
Destructor.
void setValue(FwSizeType value)
Set the index value.
FwSizeType decrement(FwSizeType amount=1)