FireSTARR
Loading...
Searching...
No Matches
fs::topo::Cell Class Reference

A Position with a Slope, Aspect, and Fuel. More...

#include <Cell.h>

Inheritance diagram for fs::topo::Cell:
Collaboration diagram for fs::topo::Cell:

Public Member Functions

constexpr Cell () noexcept
 Default constructor.
 
constexpr Topo fullHash () const
 Full stored hash that may contain data from subclasses.
 
constexpr Cell (const Topo hash) noexcept
 Construct from hash value.
 
constexpr Cell (const HashSize hash, const SlopeSize slope, const AspectSize aspect, const FuelCodeSize &fuel) noexcept
 Construct based on given attributes.
 
constexpr Cell (const Idx row, const Idx column, const SlopeSize slope, const AspectSize aspect, const FuelCodeSize &fuel) noexcept
 Constructor.
 
constexpr SpreadKey key () const noexcept
 A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.
 
constexpr AspectSize aspect () const noexcept
 Aspect (degrees)
 
constexpr FuelCodeSize fuelCode () const noexcept
 Fuel.
 
constexpr SlopeSize slope () const noexcept
 Slope (degrees)
 
constexpr Topo topoHash () const noexcept
 Topo that contains Cell data.
 
- Public Member Functions inherited from fs::topo::Position< Topo >
constexpr Idx row () const noexcept
 Row.
 
constexpr Idx column () const noexcept
 Column.
 
constexpr HashSize hash () const noexcept
 Hash derived from row and column.
 
constexpr bool operator== (const Position &rhs) const noexcept
 Equality operator.
 
constexpr bool operator!= (const Position &rhs) const noexcept
 Inequality operator.
 

Static Public Member Functions

static constexpr Topo hashCell (const SlopeSize slope, const AspectSize aspect, const FuelCodeSize &fuel) noexcept
 Hash attributes into a Topo value.
 
static constexpr SpreadKey key (const Topo value) noexcept
 A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.
 
static constexpr AspectSize aspect (const SpreadKey value) noexcept
 Aspect (degrees)
 
static constexpr FuelCodeSize fuelCode (const SpreadKey value) noexcept
 Fuel.
 
static constexpr SlopeSize slope (const SpreadKey value) noexcept
 Slope (degrees)
 
static constexpr AspectSize aspect (const Topo value) noexcept
 Aspect (degrees)
 
static constexpr FuelCodeSize fuelCode (const Topo value) noexcept
 Fuel.
 
static constexpr SlopeSize slope (const Topo value) noexcept
 Slope (degrees)
 
static constexpr Topo topoHash (const Topo value) noexcept
 Topo that contains Cell data.
 

Static Protected Attributes

static constexpr uint32_t FuelShift = 32
 Shift for fuel bitmask.
 
static constexpr uint32_t FuelBits = std::bit_width<uint32_t>(NUMBER_OF_FUELS)
 Number of bits in fuel bitmask.
 
static constexpr Topo FuelBitMask = util::bit_mask<FuelBits, Topo>()
 Bitmask for fuel information in Topo before shift.
 
static constexpr Topo FuelMask = FuelBitMask << FuelShift
 Bitmask for fuel information in Topo.
 
static constexpr uint32_t AspectShift = FuelBits + FuelShift
 Shift for aspect bitmask.
 
static constexpr uint32_t AspectBits = std::bit_width<uint32_t>(MAX_ASPECT)
 Number of bits in aspect bitmask.
 
static constexpr Topo AspectBitMask = util::bit_mask<AspectBits, Topo>()
 Bitmask for aspect in Topo before shift.
 
static constexpr Topo AspectMask = AspectBitMask << AspectShift
 Bitmask for aspect in Topo.
 
static constexpr uint32_t SlopeShift = AspectBits + AspectShift
 Shift for slope bitmask.
 
static constexpr uint32_t SlopeBits = std::bit_width<uint32_t>(MAX_SLOPE_FOR_DISTANCE)
 Number of bits in slope bitmask.
 
static constexpr Topo SlopeBitMask = util::bit_mask<SlopeBits, Topo>()
 Bitmask for slope in Topo before shift.
 
static constexpr Topo SlopeMask = SlopeBitMask << SlopeShift
 Bitmask for slope in Topo.
 
static constexpr Topo CellMask = HashMask | FuelMask | AspectMask | SlopeMask
 Bitmask for Cell information in Topo.
 
- Static Protected Attributes inherited from fs::topo::Position< Topo >
static constexpr uint32_t XYBits
 Number of bits to use for storing one coordinate of Position data.
 
static constexpr uint32_t PositionBits
 Number of bits to use for storing Position data.
 
static constexpr Topo ColumnMask
 Hash mask for bits being used for Position data.
 
static constexpr Topo HashMask
 Hash mask for bits being used for Position data.
 

Additional Inherited Members

- Protected Member Functions inherited from fs::topo::Position< Topo >
constexpr Position (const Topo &topo) noexcept
 Construct with given hash that may contain data from subclasses.
 
- Static Protected Member Functions inherited from fs::topo::Position< Topo >
static constexpr HashSize doHash (const Idx row, const Idx column) noexcept
 Create a hash from given values.
 
static constexpr Idx unhashRow (const Topo hash) noexcept
 Row from hash.
 
static constexpr Idx unhashColumn (const Topo hash) noexcept
 Column.
 
- Protected Attributes inherited from fs::topo::Position< Topo >
Topo topo_data_
 Stored hash that contains row and column data.
 

Detailed Description

A Position with a Slope, Aspect, and Fuel.

Constructor & Destructor Documentation

◆ Cell() [1/3]

fs::topo::Cell::Cell ( const Topo hash)
inlineexplicitconstexprnoexcept

Construct from hash value.

Parameters
hashHash defining all attributes

◆ Cell() [2/3]

fs::topo::Cell::Cell ( const HashSize hash,
const SlopeSize slope,
const AspectSize aspect,
const FuelCodeSize & fuel )
inlineconstexprnoexcept

Construct based on given attributes.

Parameters
hashHash of row and column
slopeSlope
aspectAspect
fuelFuel

◆ Cell() [3/3]

fs::topo::Cell::Cell ( const Idx row,
const Idx column,
const SlopeSize slope,
const AspectSize aspect,
const FuelCodeSize & fuel )
inlineconstexprnoexcept

Constructor.

Parameters
rowRow
columnColumn
slopeSlope
aspectAspect
fuelFuel

Member Function Documentation

◆ aspect() [1/3]

AspectSize fs::topo::Cell::aspect ( ) const
inlinenodiscardconstexprnoexcept

Aspect (degrees)

Returns
Aspect (degrees)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ aspect() [2/3]

static constexpr AspectSize fs::topo::Cell::aspect ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Aspect (degrees)

Parameters
valueSpreadKey to extract from
Returns
Aspect (degrees)
Here is the caller graph for this function:

◆ aspect() [3/3]

static constexpr AspectSize fs::topo::Cell::aspect ( const Topo value)
inlinestaticnodiscardconstexprnoexcept

Aspect (degrees)

Parameters
valueTopo to extract from
Returns
Aspect (degrees)

◆ fuelCode() [1/3]

FuelCodeSize fs::topo::Cell::fuelCode ( ) const
inlinenodiscardconstexprnoexcept

Fuel.

Returns
Fuel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuelCode() [2/3]

static constexpr FuelCodeSize fs::topo::Cell::fuelCode ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Fuel.

Parameters
valueSpreadKey to extract from
Returns
Fuel
Here is the caller graph for this function:

◆ fuelCode() [3/3]

static constexpr FuelCodeSize fs::topo::Cell::fuelCode ( const Topo value)
inlinestaticnodiscardconstexprnoexcept

Fuel.

Parameters
valueTopo to extract from
Returns
Fuel

◆ fullHash()

Topo fs::topo::Cell::fullHash ( ) const
inlinenodiscardconstexpr

Full stored hash that may contain data from subclasses.

Returns
Full stored hash that may contain data from subclasses

◆ hashCell()

static constexpr Topo fs::topo::Cell::hashCell ( const SlopeSize slope,
const AspectSize aspect,
const FuelCodeSize & fuel )
inlinestaticnodiscardconstexprnoexcept

Hash attributes into a Topo value.

Parameters
slopeSlope
aspectAspect
fuelFuel
Returns
Hash
Here is the call graph for this function:

◆ key() [1/2]

SpreadKey fs::topo::Cell::key ( ) const
inlinenodiscardconstexprnoexcept

A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.

Returns
A key defining Slope, Aspect, and Fuel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key() [2/2]

static constexpr SpreadKey fs::topo::Cell::key ( const Topo value)
inlinestaticnodiscardconstexprnoexcept

A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.

Parameters
valueTopo to extract from
Returns
A key defining Slope, Aspect, and Fuel
Here is the caller graph for this function:

◆ slope() [1/3]

SlopeSize fs::topo::Cell::slope ( ) const
inlinenodiscardconstexprnoexcept

Slope (degrees)

Returns
Slope (degrees)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slope() [2/3]

static constexpr SlopeSize fs::topo::Cell::slope ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Slope (degrees)

Parameters
valueSpreadKey to extract from
Returns
Slope (degrees)
Here is the caller graph for this function:

◆ slope() [3/3]

static constexpr SlopeSize fs::topo::Cell::slope ( const Topo value)
inlinestaticnodiscardconstexprnoexcept

Slope (degrees)

Parameters
valueTopo to extract from
Returns
Slope (degrees)

◆ topoHash() [1/2]

Topo fs::topo::Cell::topoHash ( ) const
inlinenodiscardconstexprnoexcept

Topo that contains Cell data.

Returns
Topo that contains Cell data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ topoHash() [2/2]

static constexpr Topo fs::topo::Cell::topoHash ( const Topo value)
inlinestaticnodiscardconstexprnoexcept

Topo that contains Cell data.

Parameters
valueTopo to extract from
Returns
Topo that contains Cell data

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