hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::interface::Signable< Model, HashProvider > Class Template Referenceabstract

#include "signable.hpp"

Inheritance diagram for shared_model::interface::Signable< Model, HashProvider >:
Inheritance graph
Collaboration diagram for shared_model::interface::Signable< Model, HashProvider >:
Collaboration graph

Classes

class  SignatureSetTypeOps
 

Public Member Functions

virtual types::SignatureRangeType signatures () const =0
 
virtual bool addSignature (const crypto::Signed &signed_blob, const crypto::PublicKey &public_key)=0
 
virtual types::TimestampType createdTime () const =0
 
virtual const types::BlobTypepayload () const =0
 
virtual const types::BlobTypeblob () const =0
 
bool operator== (const Model &rhs) const override
 
bool equalsByValue (const Model &rhs) const
 
virtual const types::HashTypehash () const =0
 
std::string toString () const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< Model >
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 

Protected Types

template<typename T >
using SignatureSetType = std::unordered_set< T, SignatureSetTypeOps, SignatureSetTypeOps >
 

Static Protected Member Functions

static auto makeHash (const types::BlobType &payload)
 

Additional Inherited Members

- Public Types inherited from shared_model::interface::ModelPrimitive< Model >
using ModelType = Model
 

Detailed Description

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
class shared_model::interface::Signable< Model, HashProvider >

Interface provides signatures and adds them to model object

Template Parameters
Model- your model

Member Typedef Documentation

◆ SignatureSetType

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
template<typename T >
using shared_model::interface::Signable< Model, HashProvider >::SignatureSetType = std::unordered_set<T, SignatureSetTypeOps, SignatureSetTypeOps>
protected

Member Function Documentation

◆ addSignature()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual bool shared_model::interface::Signable< Model, HashProvider >::addSignature ( const crypto::Signed signed_blob,
const crypto::PublicKey public_key 
)
pure virtual

Attach signature to object

Parameters
signature- signature object for insertion
Returns
true, if signature was added

Implemented in shared_model::proto::Transaction, shared_model::proto::Query, shared_model::proto::Block, and shared_model::proto::BlocksQuery.

◆ blob()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual const types::BlobType& shared_model::interface::Signable< Model, HashProvider >::blob ( ) const
pure virtual
Returns
blob representation of object include signatures

Implemented in shared_model::proto::Query, shared_model::proto::Transaction, shared_model::proto::Block, and shared_model::proto::BlocksQuery.

◆ createdTime()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual types::TimestampType shared_model::interface::Signable< Model, HashProvider >::createdTime ( ) const
pure virtual
Returns
time of creation

Implemented in shared_model::proto::Transaction, shared_model::proto::Query, shared_model::proto::Block, and shared_model::proto::BlocksQuery.

Here is the caller graph for this function:

◆ equalsByValue()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
bool shared_model::interface::Signable< Model, HashProvider >::equalsByValue ( const Model &  rhs) const
inline

Provides comaprison based on equality objects only

Parameters
rhs- another model object
Returns
true, if hashes of objects are equal

◆ hash()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual const types::HashType& shared_model::interface::Signable< Model, HashProvider >::hash ( ) const
pure virtual

◆ makeHash()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
static auto shared_model::interface::Signable< Model, HashProvider >::makeHash ( const types::BlobType payload)
inlinestaticprotected

◆ operator==()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
bool shared_model::interface::Signable< Model, HashProvider >::operator== ( const Model &  rhs) const
inlineoverridevirtual

Provides comparison based on equality of objects and signatures.

Parameters
rhs- another model object
Returns
true, if objects totally equal

Implements shared_model::interface::ModelPrimitive< Model >.

◆ payload()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual const types::BlobType& shared_model::interface::Signable< Model, HashProvider >::payload ( ) const
pure virtual
Returns
object payload (everything except signatures)

Implemented in shared_model::proto::Block, shared_model::proto::Query, shared_model::proto::Transaction, and shared_model::proto::BlocksQuery.

◆ signatures()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
virtual types::SignatureRangeType shared_model::interface::Signable< Model, HashProvider >::signatures ( ) const
pure virtual
Returns
attached signatures

Implemented in shared_model::proto::Transaction, shared_model::proto::Query, shared_model::proto::Block, and shared_model::proto::BlocksQuery.

Here is the caller graph for this function:

◆ toString()

template<typename Model, typename HashProvider = shared_model::crypto::Sha3_256>
std::string shared_model::interface::Signable< Model, HashProvider >::toString ( ) const
inlineoverridevirtual

Make string developer representation of object

Returns
string with internal state of object

Reimplemented from shared_model::interface::ModelPrimitive< Model >.

Here is the caller graph for this function:

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