CatapultServer  v0.5.0.1 (Elephant)
ResolutionStatement.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "ReceiptSource.h"
23 #include "ReceiptType.h"
24 #include "catapult/types.h"
25 
26 namespace catapult { namespace model {
27 
29  template<typename TUnresolved, typename TResolved, ReceiptType ResolutionReceiptType>
31  public:
32 #pragma pack(push, 1)
33 
35  struct ResolutionEntry {
37  TResolved ResolvedValue;
38 
41  };
42 
43 #pragma pack(pop)
44 
45  public:
47  explicit ResolutionStatement(const TUnresolved& unresolved);
48 
49  public:
51  const TUnresolved& unresolved() const;
52 
54  size_t size() const;
55 
57  const ResolutionEntry& entryAt(size_t index) const;
58 
60  Hash256 hash() const;
61 
62  public:
64  void addResolution(const TResolved& resolved, const ReceiptSource& source);
65 
66  private:
67  TUnresolved m_unresolved;
68  std::vector<ResolutionEntry> m_entries;
69  };
70 
74 
78 }}
ResolutionStatement.h
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::model::ResolutionStatement::entryAt
const ResolutionEntry & entryAt(size_t index) const
Gets the resolution entry at index.
ReceiptType.h
catapult::crypto::Sha3_256_Builder
KeccakBuilder< Sha3ModeTag, Hash256_tag > Sha3_256_Builder
Sha3_256_Builder.
Definition: Hashes.h:85
catapult::model::ResolutionStatement::size
size_t size() const
Gets the number of attached resolution entries.
catapult::model::ResolutionStatement::addResolution
void addResolution(const TResolved &resolved, const ReceiptSource &source)
Adds a resolution entry for resolving the unresolved value to resolved value at source.
catapult::model::ReceiptType
ReceiptType
Enumeration of receipt types.
Definition: ReceiptType.h:58
catapult::model::ResolutionStatement::m_entries
std::vector< ResolutionEntry > m_entries
Definition: ResolutionStatement.h:68
Hashes.h
catapult::model::ResolutionStatement
Collection of receipts scoped to a unresolved value.
Definition: ResolutionStatement.h:30
ReceiptSource.h
size
uint64_t size
Definition: MemoryCounters.cpp:65
catapult::model::ReceiptSource
Receipt source (unique within a block).
Definition: ReceiptSource.h:29
catapult::model::ResolutionStatement::unresolved
const TUnresolved & unresolved() const
Gets unresolved value.
types.h
catapult::model::ResolutionStatement::ResolutionEntry::ResolvedValue
TResolved ResolvedValue
Resolved value.
Definition: ResolutionStatement.h:37
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
catapult::model::ResolutionStatement::ResolutionStatement
ResolutionStatement(const TUnresolved &unresolved)
Creates a statement around unresolved value.
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::ResolutionStatement::hash
Hash256 hash() const
Calculates a unique hash for this statment.
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::model::ResolutionStatement::m_unresolved
TUnresolved m_unresolved
Definition: ResolutionStatement.h:67
catapult::model::ResolutionStatement::ResolutionEntry::Source
ReceiptSource Source
Source of resolution within block.
Definition: ResolutionStatement.h:40
catapult::model::ResolutionStatement::ResolutionEntry
Resolution entry.
Definition: ResolutionStatement.h:35