Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::fixed_key< Size > Class Template Reference

#include <fixed_key.hpp>

Public Types

typedef uint128_t word_t
 

Public Member Functions

 fixed_key ()
 Default constructor to fixed_key object.
 
 fixed_key (const std::array< word_t, num_words()> &arr)
 Constructor to fixed_key object from std::array of num_words() words.
 

Static Public Member Functions

static constexpr size_t num_words ()
 
static constexpr size_t padded_bytes ()
 

Public Attributes

template<typename Word , size_t NumWords>
 arr_itr = num_sub_words
 
return arr
 

Friends

bool operator== (const fixed_key< Size > &c1, const fixed_key< Size > &c2)
 Compares two fixed_key variables c1 and c2.
 
bool operator!= (const fixed_key< Size > &c1, const fixed_key< Size > &c2)
 Compares two fixed_key variables c1 and c2.
 
bool operator> (const fixed_key< Size > &c1, const fixed_key< Size > &c2)
 Compares two fixed_key variables c1 and c2.
 
bool operator< (const fixed_key< Size > &c1, const fixed_key< Size > &c2)
 Compares two fixed_key variables c1 and c2.
 

Detailed Description

template<size_t Size>
class sysio::fixed_key< Size >

Definition at line 34 of file fixed_key.hpp.

Member Typedef Documentation

◆ word_t

template<size_t Size>
uint128_t sysio::fixed_key< Size >::word_t

Definition at line 74 of file fixed_key.hpp.

Constructor & Destructor Documentation

◆ fixed_key() [1/2]

template<size_t Size>
sysio::fixed_key< Size >::fixed_key ( )
inline

Default constructor to fixed_key object which initializes all bytes to zero

Definition at line 84 of file fixed_key.hpp.

84: _data() {}

◆ fixed_key() [2/2]

template<size_t Size>
sysio::fixed_key< Size >::fixed_key ( const std::array< word_t, num_words()> & arr)
inline

Constructor to fixed_key object from std::array of num_words() words

Parameters
arrdata

Definition at line 92 of file fixed_key.hpp.

93 {
94 std::copy(arr.begin(), arr.end(), _data.begin());
95 }

Member Function Documentation

◆ num_words()

template<size_t Size>
static constexpr size_t sysio::fixed_key< Size >::num_words ( )
inlinestaticconstexpr

Definition at line 76 of file fixed_key.hpp.

76{ return (Size + sizeof(word_t) - 1) / sizeof(word_t); }
uint128_t word_t
Definition fixed_key.hpp:74
Here is the caller graph for this function:

◆ padded_bytes()

template<size_t Size>
static constexpr size_t sysio::fixed_key< Size >::padded_bytes ( )
inlinestaticconstexpr

Definition at line 77 of file fixed_key.hpp.

77{ return num_words() * sizeof(word_t) - Size; }
static constexpr size_t num_words()
Definition fixed_key.hpp:76
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

template<size_t Size>
bool operator!= ( const fixed_key< Size > & c1,
const fixed_key< Size > & c2 )
friend

Lexicographically compares two fixed_key variables c1 and c2

Returns
if c1 != c2, return true, otherwise false

Definition at line 193 of file fixed_key.hpp.

193 {
194 return c1._data != c2._data;
195 }

◆ operator<

template<size_t Size>
bool operator< ( const fixed_key< Size > & c1,
const fixed_key< Size > & c2 )
friend

Lexicographically compares two fixed_key variables c1 and c2

Returns
if c1 < c2, return true, otherwise false

Definition at line 215 of file fixed_key.hpp.

215 {
216 return c1._data < c2._data;
217 }

◆ operator==

template<size_t Size>
bool operator== ( const fixed_key< Size > & c1,
const fixed_key< Size > & c2 )
friend

Lexicographically compares two fixed_key variables c1 and c2

Returns
if c1 == c2, return true, otherwise false

Definition at line 182 of file fixed_key.hpp.

182 {
183 return c1._data == c2._data;
184 }

◆ operator>

template<size_t Size>
bool operator> ( const fixed_key< Size > & c1,
const fixed_key< Size > & c2 )
friend

Lexicographically compares two fixed_key variables c1 and c2

Returns
if c1 > c2, return true, otherwise false

Definition at line 204 of file fixed_key.hpp.

204 {
205 return c1._data > c2._data;
206 }

Member Data Documentation

◆ arr

template<size_t Size>
return sysio::fixed_key< Size >::arr

Definition at line 158 of file fixed_key.hpp.

◆ arr_itr

template<size_t Size>
template<typename Word , size_t NumWords>
sysio::fixed_key< Size >::arr_itr = num_sub_words

Definition at line 155 of file fixed_key.hpp.


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