CatapultServer  v0.5.0.1 (Elephant)
MosaicDefinitionTransaction.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "MosaicConstants.h"
23 #include "MosaicEntityType.h"
24 #include "MosaicProperties.h"
26 
27 namespace catapult { namespace model {
28 
29 #pragma pack(push, 1)
30 
32  template<typename THeader>
33  struct MosaicDefinitionTransactionBody : public THeader {
34  private:
36 
37  public:
38  DEFINE_TRANSACTION_CONSTANTS(Entity_Type_Mosaic_Definition, 1)
39 
40  public:
43 
47 
50 
51  // followed by optional properties
53 
54  private:
55  template<typename T>
56  static auto* PropertiesPtrT(T& transaction) {
57  return transaction.PropertiesHeader.Count ? THeader::PayloadStart(transaction) : nullptr;
58  }
59 
60  public:
62  static constexpr uint64_t CalculateRealSize(const TransactionType& transaction) noexcept {
63  return sizeof(TransactionType) + transaction.PropertiesHeader.Count * sizeof(MosaicProperty);
64  }
65  };
66 
67  DEFINE_EMBEDDABLE_TRANSACTION(MosaicDefinition)
68 
69 #pragma pack(pop)
70 }}
catapult::model::MosaicDefinitionTransactionBody
Binary layout for a mosaic definition transaction body.
Definition: MosaicDefinitionTransaction.h:33
catapult::model::MosaicDefinitionTransactionBody::PropertiesHeader
MosaicPropertiesHeader PropertiesHeader
Properties header.
Definition: MosaicDefinitionTransaction.h:49
Transaction.h
Observers.h
catapult::model::MosaicDefinitionTransactionBody::CalculateRealSize
static constexpr uint64_t CalculateRealSize(const TransactionType &transaction) noexcept
Calculates the real size of mosaic definition transaction.
Definition: MosaicDefinitionTransaction.h:62
catapult::model::First_Optional_Property
constexpr size_t First_Optional_Property
Index of first optional property.
Definition: MosaicProperty.h:84
catapult::observers::DEFINE_OBSERVER
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto &notification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
catapult::observers::NotifyMode
NotifyMode
Enumeration of possible notification modes.
Definition: ObserverContext.h:41
DEFINE_EMBEDDABLE_TRANSACTION
#define DEFINE_EMBEDDABLE_TRANSACTION(NAME)
Defines a transaction with NAME that supports embedding.
Definition: Transaction.h:69
Value
uint32_t Value
Definition: BlockScorer.cpp:32
catapult::utils::BaseValue< uint32_t, MosaicNonce_tag >
catapult::model::MosaicProperty
Mosaic property composed of an id and a value.
Definition: MosaicProperty.h:69
MosaicEntityType.h
MosaicCache.h
MosaicProperties.h
catapult::model::MosaicProperties::FromValues
static MosaicProperties FromValues(const PropertyValuesContainer &values)
Creates mosaic properties from values.
Definition: MosaicProperties.h:65
AccountStateCache.h
catapult::model::MosaicPropertiesHeader
Mosaic properties header.
Definition: MosaicProperties.h:32
DEFINE_TRANSACTION_CONSTANTS
#define DEFINE_TRANSACTION_CONSTANTS(TYPE, VERSION)
Defines constants for a transaction with TYPE and VERSION.
Definition: Transaction.h:50
catapult
Definition: AddressExtractionExtension.cpp:28
DEFINE_TRANSACTION_VARIABLE_DATA_ACCESSORS
#define DEFINE_TRANSACTION_VARIABLE_DATA_ACCESSORS(NAME, TYPE)
Defines NAME (TYPE typed) variable data accessors around a similarly named templated untyped data acc...
Definition: Transaction.h:57
MosaicConstants.h
catapult::model::MosaicDefinitionTransactionBody::TransactionType
MosaicDefinitionTransactionBody< THeader > TransactionType
Definition: MosaicDefinitionTransaction.h:35
catapult::model::MosaicProperties::PropertyValuesContainer
std::array< uint64_t, Num_Mosaic_Properties > PropertyValuesContainer
Type of values container.
Definition: MosaicProperties.h:52
catapult::model::MosaicDefinitionTransactionBody::PropertiesPtrT
static auto * PropertiesPtrT(T &transaction)
Definition: MosaicDefinitionTransaction.h:56