class
SfnSfThe 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
Constructors, destructors, conversion operators
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 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:: 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 |
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.
uint32_t ns3:: SfnSf:: GetSlotPerSubframe() const
Get SlotPerSubframe.
Returns | the number of slot per subframe; depends on the numerology installed |
---|
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) |