ns3::SfnSf class

The SfnSf class.

Keep track of the frame, subframe, slot number. The value can be normalized in the number of slot. Please keep in mind that a SfnSf is valid only when there is an associated numerology, and that a particular value is not normalized the same in two different numerologies.

Usage

To create a SfnSf with numerology 2 (for example), please do:

auto sfn = SfnSf (1, 0, 0, 2);

Public static functions

static auto Decode(uint64_t sfn) -> SfnSf
Decode the parameter and return a SfnSf.
static auto Encode(const SfnSf& p) -> uint64_t
Encode the parameter in a uint64_t.
static auto GetSubframesPerFrame() -> uint32_t

Constructors, destructors, conversion operators

SfnSf() defaulted
constructor
SfnSf(uint32_t frameNum, uint8_t sfNum, uint8_t slotNum, uint8_t numerology)
SfnSf constructor Numerology must be <= 5.

Public functions

void Add(uint32_t slotN)
Add to this SfnSf a number of slot indicated by the first parameter.
void FromEncoding(uint64_t sfn)
Fill the private fields with the value extracted from the parameter.
auto GetEncForStreamWithSymStart(uint8_t streamId, uint8_t symStart) const -> uint64_t
Get the enconding number, including a symbol start value and stream id.
auto GetEncoding() const -> uint64_t
Get encoding for this SfnSf.
auto GetEncodingWithSymStart(uint8_t symStart) const -> uint64_t
Get the encoding number, including a symbol start value.
auto GetFrame() const -> uint32_t
GetFrame.
auto GetFutureSfnSf(uint32_t slotN) -> SfnSf
Get a Future SfnSf.
auto GetNumerology() const -> uint8_t
GetNumerology.
auto GetSlot() const -> uint8_t
GetSlot.
auto GetSlotPerSubframe() const -> uint32_t
Get SlotPerSubframe.
auto GetSubframe() const -> uint8_t
GetSubframe.
auto Normalize() const -> uint64_t
Normalize the SfnSf in slot number.
auto operator<(const SfnSf& rhs) const -> bool
operator < (less than)
auto operator==(const SfnSf& o) const -> bool
operator ==, compares frame, subframe, and slot

Function documentation

static SfnSf ns3::SfnSf::Decode(uint64_t sfn)

Decode the parameter and return a SfnSf.

Parameters
sfn the encoded value
Returns an object which contains the values extracted from the encoding

static uint64_t ns3::SfnSf::Encode(const SfnSf& p)

Encode the parameter in a uint64_t.

Parameters
p the SfnSf to encode
Returns an uint64_t that can represent this SfnSf

static uint32_t ns3::SfnSf::GetSubframesPerFrame()

Returns the number of subframes per frame (ten for every numerology)

ns3::SfnSf::SfnSf(uint32_t frameNum, uint8_t sfNum, uint8_t slotNum, uint8_t numerology)

SfnSf constructor Numerology must be <= 5.

Parameters
frameNum Frame number (32-bit)
sfNum Subframe Number (8-bit)
slotNum Slot number (8-bit)
numerology Numerology (will be always associated with this SfnSf) (8-bit)

void ns3::SfnSf::Add(uint32_t slotN)

Add to this SfnSf a number of slot indicated by the first parameter.

Parameters
slotN Number of slot to add

void ns3::SfnSf::FromEncoding(uint64_t sfn)

Fill the private fields with the value extracted from the parameter.

Parameters
sfn Encoding from which extract the value

uint64_t ns3::SfnSf::GetEncForStreamWithSymStart(uint8_t streamId, uint8_t symStart) const

Get the enconding number, including a symbol start value and stream id.

Parameters
streamId The stream id value to include
symStart the symbol start value to include
Returns an uint64_t that can represent this SfnSf plus 2 bytes to represent the symbol start, and the 2 bytes to represent stream id

uint64_t ns3::SfnSf::GetEncoding() const

Get encoding for this SfnSf.

Returns an uint64_t that is able to represent fully this SfnSf

uint64_t ns3::SfnSf::GetEncodingWithSymStart(uint8_t symStart) const

Get the encoding number, including a symbol start value.

Parameters
symStart the symbol start value to include
Returns an uint64_t that can represent this SfnSf plus a short integer to represent the symbol start

uint32_t ns3::SfnSf::GetFrame() const

GetFrame.

Returns the frame number

SfnSf ns3::SfnSf::GetFutureSfnSf(uint32_t slotN)

Get a Future SfnSf.

Parameters
slotN slot to sum
Returns the SfnSf that results from the operation (*this) + slotN

uint8_t ns3::SfnSf::GetNumerology() const

GetNumerology.

Returns the numerology installed

Please note that if you invoke this method without passing a numerology to the constructor or without constructing the object from an encoded value with a valid numerology, the program will fail.

uint8_t ns3::SfnSf::GetSlot() const

GetSlot.

Returns the slot number

uint32_t ns3::SfnSf::GetSlotPerSubframe() const

Get SlotPerSubframe.

Returns the number of slot per subframe; depends on the numerology installed

uint8_t ns3::SfnSf::GetSubframe() const

GetSubframe.

Returns the subframe number

uint64_t ns3::SfnSf::Normalize() const

Normalize the SfnSf in slot number.

Returns The number of total slots passed

This value will wrap if the frame count (32-bit unsigned integer) wraps

bool ns3::SfnSf::operator<(const SfnSf& rhs) const

operator < (less than)

Parameters
rhs other SfnSf to compare
Returns true if this SfnSf is less than rhs

The comparison is done on m_frameNum, m_subframeNum, and m_slotNum The program will assert if numerologies do not match (and asserts are enabled)

bool ns3::SfnSf::operator==(const SfnSf& o) const

operator ==, compares frame, subframe, and slot

Parameters
o other instance to compare
Returns true if this instance and the other have the same frame, subframe, and slot The program will assert if numerologies do not match (and asserts are enabled)