src/primitives/extrinsic.hpp¶
Namespaces¶
| Name |
|---|
| sgns |
| sgns::primitives |
Classes¶
| Name | |
|---|---|
| struct | sgns::primitives::Extrinsic Extrinsic class represents extrinsic. |
Types¶
| Name | |
|---|---|
| using uint32_t | ExtrinsicIndex |
Functions¶
| Name | |
|---|---|
| template <class Stream ,typename =std::enable_if_t Stream & |
operator<<(Stream & s, const Extrinsic & v) outputs object of type Extrinisic to stream |
| template <class Stream ,typename =std::enable_if_t Stream & |
operator>>(Stream & s, Extrinsic & v) decodes object of type Extrinisic from stream |
Types Documentation¶
using ExtrinsicIndex¶
Index of an extrinsic in a block
Functions Documentation¶
function operator<<¶
template <class Stream ,
typename =std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<<(
Stream & s,
const Extrinsic & v
)
outputs object of type Extrinisic to stream
Parameters:
- s stream reference
- v value to output
Template Parameters:
- Stream output stream type
Return: reference to stream
function operator>>¶
template <class Stream ,
typename =std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>>(
Stream & s,
Extrinsic & v
)
decodes object of type Extrinisic from stream
Parameters:
- s stream reference
- v value to output
Template Parameters:
- Stream input stream type
Return: reference to stream
Source code¶
#ifndef SUPERGENIUS_PRIMITIVES_EXTRINSIC_HPP
#define SUPERGENIUS_PRIMITIVES_EXTRINSIC_HPP
#include "base/buffer.hpp"
namespace sgns::primitives {
using ExtrinsicIndex = uint32_t;
struct Extrinsic {
base::Buffer data;
bool operator==( const Extrinsic &rhs ) const
{
return data == rhs.data;
}
friend std::ostream &operator<<(std::ostream &out, const Extrinsic &v)
{
return out << v.data;
}
};
template <class Stream,
typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream &operator<<(Stream &s, const Extrinsic &v) {
return s << v.data;
}
template <class Stream,
typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream &operator>>(Stream &s, Extrinsic &v) {
return s >> v.data;
}
} // namespace sgns::primitives
#endif // SUPERGENIUS_PRIMITIVES_EXTRINSIC_HPP
Updated on 2026-03-04 at 13:10:44 -0800