CatapultServer  v0.5.0.1 (Elephant)
RegisterNamespaceBuilder.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "TransactionBuilder.h"
24 
25 namespace catapult { namespace builders {
26 
29  public:
30  using Transaction = model::RegisterNamespaceTransaction;
31  using EmbeddedTransaction = model::EmbeddedRegisterNamespaceTransaction;
32 
33  public:
37 
38  public:
40  void setDuration(BlockDuration duration);
41 
43  void setParentId(NamespaceId parentId);
44 
46  void setName(const RawBuffer& name);
47 
48  public:
51  size_t size() const;
52 
54  std::unique_ptr<Transaction> build() const;
55 
57  std::unique_ptr<EmbeddedTransaction> buildEmbedded() const;
58 
59  private:
60  template<typename TTransaction>
61  size_t sizeImpl() const;
62 
63  template<typename TTransaction>
64  std::unique_ptr<TTransaction> buildImpl() const;
65 
66  private:
71  std::vector<uint8_t> m_name;
72  };
73 }}
catapult::builders::RegisterNamespaceBuilder::sizeImpl
size_t sizeImpl() const
Definition: RegisterNamespaceBuilder.cpp:69
catapult::builders::TransactionBuilder::signer
const Key & signer() const
Returns signer.
Definition: TransactionBuilder.h:41
catapult::builders::RegisterNamespaceBuilder::EmbeddedTransaction
model::EmbeddedRegisterNamespaceTransaction EmbeddedTransaction
Definition: RegisterNamespaceBuilder.h:31
catapult::builders::RegisterNamespaceBuilder::m_namespaceId
NamespaceId m_namespaceId
Definition: RegisterNamespaceBuilder.h:70
catapult::builders::RegisterNamespaceBuilder::m_name
std::vector< uint8_t > m_name
Definition: RegisterNamespaceBuilder.h:71
catapult::utils::BaseValue< uint64_t, BlockDuration_tag >
catapult::builders::RegisterNamespaceBuilder::m_duration
BlockDuration m_duration
Definition: RegisterNamespaceBuilder.h:68
catapult::builders::RegisterNamespaceBuilder
Builder for a register namespace transaction.
Definition: RegisterNamespaceBuilder.h:28
catapult::builders::RegisterNamespaceBuilder::m_parentId
NamespaceId m_parentId
Definition: RegisterNamespaceBuilder.h:69
catapult::builders::RegisterNamespaceBuilder::Transaction
model::RegisterNamespaceTransaction Transaction
Definition: RegisterNamespaceBuilder.h:30
catapult::model::NamespaceType
NamespaceType
Namespace types.
Definition: NamespaceTypes.h:27
catapult::builders::RegisterNamespaceBuilder::buildImpl
std::unique_ptr< TTransaction > buildImpl() const
RegisterNamespaceBuilder.h
TransactionBuilder.h
catapult::model::NamespaceType::Child
A child namespace.
catapult::builders::RegisterNamespaceBuilder::setParentId
void setParentId(NamespaceId parentId)
Sets the id of the parent namespace to parentId and namespaceType to child.
Definition: RegisterNamespaceBuilder.cpp:40
catapult::model::NamespaceType::Root
A root namespace.
catapult::builders::RegisterNamespaceBuilder::size
size_t size() const
Definition: RegisterNamespaceBuilder.cpp:56
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
catapult::builders::TransactionBuilder
Base transaction builder.
Definition: TransactionBuilder.h:31
RegisterNamespaceTransaction.h
NamespaceIdGenerator.h
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
m_name
std::string m_name
Definition: JointValidator.cpp:90
catapult::builders::RegisterNamespaceBuilder::build
std::unique_ptr< Transaction > build() const
Builds a new register namespace transaction.
Definition: RegisterNamespaceBuilder.cpp:60
catapult::model::GenerateNamespaceId
NamespaceId GenerateNamespaceId(NamespaceId parentId, const RawString &name) noexcept
Generates a namespace id given parentId and namespace name.
Definition: NamespaceIdGenerator.cpp:31
catapult::builders::RegisterNamespaceBuilder::buildEmbedded
std::unique_ptr< EmbeddedTransaction > buildEmbedded() const
Builds a new embedded register namespace transaction.
Definition: RegisterNamespaceBuilder.cpp:64
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
catapult::builders::RegisterNamespaceBuilder::m_namespaceType
model::NamespaceType m_namespaceType
Definition: RegisterNamespaceBuilder.h:67
catapult::builders::RegisterNamespaceBuilder::setName
void setName(const RawBuffer &name)
Sets the namespace name to name.
Definition: RegisterNamespaceBuilder.cpp:45
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::builders::RegisterNamespaceBuilder::RegisterNamespaceBuilder
RegisterNamespaceBuilder(model::NetworkIdentifier networkIdentifier, const Key &signer)
Definition: RegisterNamespaceBuilder.cpp:26
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::builders::RegisterNamespaceBuilder::setDuration
void setDuration(BlockDuration duration)
Sets the namespace duration to duration and namespaceType to root.
Definition: RegisterNamespaceBuilder.cpp:35
catapult::builders::TransactionType
model::AggregateTransaction TransactionType
Definition: AggregateTransactionBuilder.cpp:28
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62