FireSTARR
Loading...
Searching...
No Matches
fs::topo::Position< V > Class Template Reference

A Position with a row and column. More...

#include <Location.h>

Public Member Functions

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.
 

Protected Member Functions

constexpr Position (const Topo &topo) noexcept
 Construct with given hash that may contain data from subclasses.
 

Static Protected Member Functions

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

topo_data_
 Stored hash that contains row and column data.
 

Static Protected Attributes

static constexpr uint32_t XYBits = std::bit_width<uint32_t>(MAX_ROWS - 1)
 Number of bits to use for storing one coordinate of Position data.
 
static constexpr uint32_t PositionBits = XYBits * 2
 Number of bits to use for storing Position data.
 
static constexpr Topo ColumnMask = util::bit_mask<XYBits, Topo>()
 Hash mask for bits being used for Position data.
 
static constexpr Topo HashMask = util::bit_mask<PositionBits, Topo>()
 Hash mask for bits being used for Position data.
 

Detailed Description

template<class V>
class fs::topo::Position< V >

A Position with a row and column.

Constructor & Destructor Documentation

◆ Position()

template<class V >
fs::topo::Position< V >::Position ( const Topo & topo)
inlineexplicitconstexprprotectednoexcept

Construct with given hash that may contain data from subclasses.

Parameters
topoHash to store

Member Function Documentation

◆ column()

template<class V >
Idx fs::topo::Position< V >::column ( ) const
inlinenodiscardconstexprnoexcept

Column.

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

◆ doHash()

template<class V >
static constexpr HashSize fs::topo::Position< V >::doHash ( const Idx row,
const Idx column )
inlinestaticnodiscardconstexprprotectednoexcept

Create a hash from given values.

Parameters
rowRow
columnColumn
Returns
Hash
Here is the call graph for this function:

◆ hash()

template<class V >
HashSize fs::topo::Position< V >::hash ( ) const
inlinenodiscardconstexprnoexcept

Hash derived from row and column.

Returns
Hash derived from row and column
Here is the caller graph for this function:

◆ operator!=()

template<class V >
bool fs::topo::Position< V >::operator!= ( const Position< V > & rhs) const
inlinenodiscardconstexprnoexcept

Inequality operator.

Parameters
rhsPosition to compare to
Returns
Whether or not these are not equivalent

◆ operator==()

template<class V >
bool fs::topo::Position< V >::operator== ( const Position< V > & rhs) const
inlinenodiscardconstexprnoexcept

Equality operator.

Parameters
rhsPosition to compare to
Returns
Whether or not these are equivalent
Here is the call graph for this function:

◆ row()

template<class V >
Idx fs::topo::Position< V >::row ( ) const
inlinenodiscardconstexprnoexcept

Row.

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

◆ unhashColumn()

template<class V >
static constexpr Idx fs::topo::Position< V >::unhashColumn ( const Topo hash)
inlinestaticnodiscardconstexprprotectednoexcept

Column.

Parameters
hashhash to extract column from
Returns
Column
Here is the caller graph for this function:

◆ unhashRow()

template<class V >
static constexpr Idx fs::topo::Position< V >::unhashRow ( const Topo hash)
inlinestaticnodiscardconstexprprotectednoexcept

Row from hash.

Parameters
hashhash to extract row from
Returns
Row from hash
Here is the caller graph for this function:

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