PLCnext API Documentation 25.0.2.69
Public Member Functions | Static Public Member Functions | List of all members
Arp::Plc::Meta::Commons::BitSize Class Reference

This class represents a size of a variable More...

#include <BitSize.hpp>

Public Member Functions

 BitSize (uint32 bytes=0, uint32 bits=0)
 Constructs a BitSize object More...
 
 BitSize (const BitSize &arg)
 The default copy constructor.
 
 BitSize (BitSize &&arg) noexcept
 The default move constructor.
 
BitSizeoperator= (const BitSize &arg)
 The default copy-assignment operator.
 
BitSizeoperator= (BitSize &&arg) noexcept
 The default move-assignment operator.
 
 ~BitSize (void)
 The default destructor.
 
BitSizeoperator+= (const BitSize &rhs)
 The add-assign operator. More...
 
uint32 GetByteSize () const
 Returns the size in bytes More...
 
uint32 GetBitSize () const
 Returns the remaining bits More...
 
uint64 GetTotalBitSize (void) const
 Returns the total bit size (byte size * 8 + bit size); More...
 
size_t GetFullByteSize (void) const
 Returns the full byte size needed to store all bits. (e.g. 19 total bits returns 3 bytes). More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Static Public Member Functions

static const BitSizeGetNull (void)
 Gets the zeroed null value. More...
 
static const BitSizeGetBit (void)
 Gets a one-bit value. More...
 

Detailed Description

This class represents a size of a variable

The size might be smaller than one byte.

Constructor & Destructor Documentation

◆ BitSize()

Arp::Plc::Meta::Commons::BitSize::BitSize ( uint32  bytes = 0,
uint32  bits = 0 
)
explicit

Constructs a BitSize object

Parameters
bytesNumber of bytes
bitsNumber of bits, 0-7
Exceptions
ArgumentExceptionThrown if bits > 7

Member Function Documentation

◆ GetBit()

const BitSize & Arp::Plc::Meta::Commons::BitSize::GetBit ( void  )
static

Gets a one-bit value.

Returns
The one-bit value.

◆ GetBitSize()

uint32 Arp::Plc::Meta::Commons::BitSize::GetBitSize ( ) const

Returns the remaining bits

Returns
Remaining bits (0-7)

◆ GetByteSize()

uint32 Arp::Plc::Meta::Commons::BitSize::GetByteSize ( ) const

Returns the size in bytes

Returns
Size in bytes

◆ GetFullByteSize()

size_t Arp::Plc::Meta::Commons::BitSize::GetFullByteSize ( void  ) const

Returns the full byte size needed to store all bits. (e.g. 19 total bits returns 3 bytes).

Returns
The full byte size

◆ GetNull()

const BitSize & Arp::Plc::Meta::Commons::BitSize::GetNull ( void  )
static

Gets the zeroed null value.

Returns
The null value.

◆ GetTotalBitSize()

uint64 Arp::Plc::Meta::Commons::BitSize::GetTotalBitSize ( void  ) const

Returns the total bit size (byte size * 8 + bit size);

Returns
Total bit size

◆ operator+=()

BitSize & Arp::Plc::Meta::Commons::BitSize::operator+= ( const BitSize rhs)

The add-assign operator.

Parameters
rhsThe right operand to add.
Returns
This instance.

The documentation for this class was generated from the following files: