CatapultServer  v0.5.0.1 (Elephant)
RegisterNamespaceTransaction.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "NamespaceConstants.h"
23 #include "NamespaceEntityType.h"
24 #include "NamespaceTypes.h"
26 
27 namespace catapult { namespace model {
28 
29 #pragma pack(push, 1)
30 
32  template<typename THeader>
33  struct RegisterNamespaceTransactionBody : public THeader {
34  private:
36 
37  public:
38  DEFINE_TRANSACTION_CONSTANTS(Entity_Type_Register_Namespace, 1)
39 
40  public:
44  {}
45 
46  public:
49 
50  union {
54 
58  };
59 
63 
66 
67  // followed by namespace name
69 
70  private:
71  template<typename T>
72  static auto* NamePtrT(T& transaction) {
73  return transaction.NamespaceNameSize ? THeader::PayloadStart(transaction) : nullptr;
74  }
75 
76  public:
78  bool IsRootRegistration() const {
80  }
81 
83  bool IsChildRegistration() const {
85  }
86 
87  public:
89  static constexpr uint64_t CalculateRealSize(const TransactionType& transaction) noexcept {
90  return sizeof(TransactionType) + transaction.NamespaceNameSize;
91  }
92  };
93 
94  DEFINE_EMBEDDABLE_TRANSACTION(RegisterNamespace)
95 
96 #pragma pack(pop)
97 }}
NamespaceConstants.h
catapult::model::RegisterNamespaceTransactionBody
Binary layout for a register namespace transaction body.
Definition: RegisterNamespaceTransaction.h:33
Transaction.h
catapult::model::RegisterNamespaceTransactionBody::CalculateRealSize
static constexpr uint64_t CalculateRealSize(const TransactionType &transaction) noexcept
Calculates the real size of register namespace transaction.
Definition: RegisterNamespaceTransaction.h:89
catapult::model::RegisterNamespaceTransactionBody::TransactionType
RegisterNamespaceTransactionBody< THeader > TransactionType
Definition: RegisterNamespaceTransaction.h:35
catapult::model::RegisterNamespaceTransactionBody::IsChildRegistration
bool IsChildRegistration() const
Returns true if this transaction registers a child namespace.
Definition: RegisterNamespaceTransaction.h:83
catapult::model::RegisterNamespaceTransactionBody::NamespaceType
model::NamespaceType NamespaceType
Type of the registered namespace.
Definition: RegisterNamespaceTransaction.h:48
DEFINE_EMBEDDABLE_TRANSACTION
#define DEFINE_EMBEDDABLE_TRANSACTION(NAME)
Defines a transaction with NAME that supports embedding.
Definition: Transaction.h:69
catapult::model::RegisterNamespaceTransactionBody::ParentId
NamespaceId ParentId
Definition: RegisterNamespaceTransaction.h:53
catapult::model::RegisterNamespaceTransactionBody::Duration
BlockDuration Duration
Definition: RegisterNamespaceTransaction.h:57
catapult::utils::BaseValue< uint64_t, NamespaceId_tag >
catapult::model::NamespaceType
NamespaceType
Namespace types.
Definition: NamespaceTypes.h:27
catapult::model::RegisterNamespaceTransactionBody::NamespaceId
catapult::NamespaceId NamespaceId
Definition: RegisterNamespaceTransaction.h:62
NamespaceTypes.h
catapult::model::NamespaceType::Child
A child namespace.
catapult::model::NamespaceType::Root
A root namespace.
Name
static constexpr auto Name
Definition: PtSynchronizer.cpp:31
catapult::model::RegisterNamespaceTransactionBody::NamePtrT
static auto * NamePtrT(T &transaction)
Definition: RegisterNamespaceTransaction.h:72
DEFINE_TRANSACTION_CONSTANTS
#define DEFINE_TRANSACTION_CONSTANTS(TYPE, VERSION)
Defines constants for a transaction with TYPE and VERSION.
Definition: Transaction.h:50
NamespaceEntityType.h
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
catapult::model::RegisterNamespaceTransactionBody::IsRootRegistration
bool IsRootRegistration() const
Returns true if this transaction registers a root namespace.
Definition: RegisterNamespaceTransaction.h:78
catapult::model::RegisterNamespaceTransactionBody::NamespaceNameSize
uint8_t NamespaceNameSize
Size of the namespace name.
Definition: RegisterNamespaceTransaction.h:65