veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::VbkNetworkType Struct Reference

works as optional<uint8_t> More...

Detailed Description

Definition at line 16 of file network_byte_pair.hpp.

#include <network_byte_pair.hpp>

+ Collaboration diagram for altintegration::VbkNetworkType:

Public Member Functions

 operator bool () const
 
bool operator== (const VbkNetworkType &other) const
 
std::string toPrettyString () const
 
template<typename JsonValue >
void putJson (JsonValue &obj) const
 

Public Attributes

bool hasValue = false
 if hasValue == false, it is mainnet More...
 
uint8_t value = 0
 otherwise, use value for network ID More...
 

Member Function Documentation

◆ operator bool()

altintegration::VbkNetworkType::operator bool ( ) const
inline

Definition at line 22 of file network_byte_pair.hpp.

22{ return hasValue; }
bool hasValue
if hasValue == false, it is mainnet

◆ operator==()

bool altintegration::VbkNetworkType::operator== ( const VbkNetworkType other) const
inline

Definition at line 24 of file network_byte_pair.hpp.

24 {
25 if (!hasValue && !other.hasValue) {
26 return true;
27 }
28
29 return hasValue && other.hasValue && value == other.value;
30 }
uint8_t value
otherwise, use value for network ID

◆ putJson()

template<typename JsonValue >
void altintegration::VbkNetworkType::putJson ( JsonValue &  obj) const
inline

Definition at line 41 of file network_byte_pair.hpp.

41 {
42 if (hasValue) {
43 json::putIntKV(obj, "networkByte", value);
44 } else {
45 json::putNullKV(obj, "networkByte");
46 }
47 }

◆ toPrettyString()

std::string altintegration::VbkNetworkType::toPrettyString ( ) const
inline

Definition at line 32 of file network_byte_pair.hpp.

32 {
33 if (hasValue) {
34 return std::to_string(value);
35 }
36
37 return {"null"};
38 }

Member Data Documentation

◆ hasValue

bool altintegration::VbkNetworkType::hasValue = false

Definition at line 18 of file network_byte_pair.hpp.

◆ value

uint8_t altintegration::VbkNetworkType::value = 0

Definition at line 20 of file network_byte_pair.hpp.


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