CatapultServer  v0.5.0.1 (Elephant)
catapult::mongo::mappers Namespace Reference

Namespaces

 bson_stream
 

Functions

bsoncxx::document::value ToDbModel (const state::AccountState &accountState)
 Maps an account state (accountState) to the corresponding db model value. More...
 
bsoncxx::document::value ToDbModel (const model::BlockElement &blockElement)
 Maps a blockElement to the corresponding db model entity. More...
 
model::HashRange ToModel (mongocxx::cursor &cursor, size_t numHashes)
 Maps numHashes db hashes under cursor to a hash range. More...
 
model::HashRange ToModel (const std::vector< bsoncxx::document::view > &hashContainer, size_t numHashes)
 Maps numHashes db hashes from hashContainer to a hash range. More...
 
bsoncxx::types::b_binary ToBinary (const uint8_t *pData, size_t size)
 Converts raw array (pData) of size elements into bson binary type. More...
 
bsoncxx::types::b_binary ToBinary (const UnresolvedAddress &unresolvedAddress)
 Converts unresolvedAddress into bson binary type. More...
 
uint8_t ToUint8 (int32_t value)
 Converts a 32 bit signed value to an 8 bit unsigned value. More...
 
uint32_t ToUint32 (int32_t value)
 Converts a 32 bit signed value to a 32 bit unsigned value. More...
 
uint64_t GetUint64OrDefault (const bsoncxx::document::view &documentView, const char *name, uint64_t defaultValue)
 Attempts to read a uint64 value from documentView with name, returning defaultValue if no such value exists. More...
 
bool IsEmptyDocument (const bsoncxx::document::value &document)
 Returns true if document is empty. More...
 
bson_stream::document & StreamEmbeddedTransaction (bson_stream::document &builder, const model::EmbeddedTransaction &transaction)
 Streams an embedded transaction to builder. More...
 
bson_stream::document & StreamVerifiableEntity (bson_stream::document &builder, const model::VerifiableEntity &entity)
 Streams a verifiable entity to builder. More...
 
bson_stream::array_contextStreamMosaic (bson_stream::array_context &context, MosaicId id, Amount amount)
 Streams a mosaic composed of id and amount to context. More...
 
bson_stream::array_contextStreamMosaic (bson_stream::array_context &context, UnresolvedMosaicId id, Amount amount)
 Streams a mosaic composed of id and amount to context. More...
 
bson_stream::document & StreamReceipt (bson_stream::document &builder, const model::Receipt &receipt)
 Streams a receipt to builder. More...
 
template<size_t N, typename TTag >
auto ToBinary (const utils::ByteArray< N, TTag > &array)
 Converts byte array into bson binary type. More...
 
template<typename TBaseValue , typename X = std::enable_if_t<std::is_same_v<uint32_t, typename TBaseValue::ValueType>>>
int32_t ToInt32 (TBaseValue value)
 Converts base value to int32_t. More...
 
template<typename TBaseValue , typename X = std::enable_if_t<std::is_same_v<uint64_t, typename TBaseValue::ValueType>>>
int64_t ToInt64 (TBaseValue value)
 Converts base value to int64_t. More...
 
template<typename TBaseValue , typename TBsonElement , typename X = std::enable_if_t<std::is_same_v<uint64_t, typename TBaseValue::ValueType>>>
TBaseValue GetValue64 (TBsonElement element)
 Gets a 64-bit value from element and converts it to a base value. More...
 
template<size_t N, typename TTag , typename TMongoContainer >
void DbBinaryToModelArray (utils::ByteArray< N, TTag > &dest, const TMongoContainer &source)
 Populates dest with data from source. More...
 
void StreamReceipt (bson_stream::document &builder, const model::Receipt &receipt, const MongoReceiptRegistry &receiptRegistry)
 Streams a receipt into builder using receiptRegistry for mapping derived receipt types. More...
 
template<typename TArtifactId >
void StreamReceipt (bson_stream::document &builder, const model::ArtifactExpiryReceipt< TArtifactId > &receipt)
 Streams receipt into builder. More...
 
bsoncxx::document::value ToDbModel (Height height, const model::AddressResolutionStatement &statement)
 Maps a statement at height to the corresponding db model value. More...
 
bsoncxx::document::value ToDbModel (Height height, const model::MosaicResolutionStatement &statement)
 Maps a statement at height to the corresponding db model value. More...
 
std::vector< bsoncxx::document::value > ToDbDocuments (const model::Transaction &transaction, const MongoTransactionMetadata &metadata, const MongoTransactionRegistry &transactionRegistry)
 
bsoncxx::document::value ToDbModel (Height height, const model::TransactionStatement &statement, const MongoReceiptRegistry &receiptRegistry)
 Maps a statement at height to the corresponding db model value using receiptRegistry for mapping derived receipt types. More...
 
bsoncxx::document::value ToDbModel (const model::TransactionStatus &status)
 Maps a transaction status to the corresponding db model value. More...
 

Function Documentation

◆ DbBinaryToModelArray()

template<size_t N, typename TTag , typename TMongoContainer >
void catapult::mongo::mappers::DbBinaryToModelArray ( utils::ByteArray< N, TTag > &  dest,
const TMongoContainer &  source 
)

Populates dest with data from source.

Here is the call graph for this function:

◆ GetUint64OrDefault()

uint64_t catapult::mongo::mappers::GetUint64OrDefault ( const bsoncxx::document::view &  documentView,
const char *  name,
uint64_t  defaultValue 
)

Attempts to read a uint64 value from documentView with name, returning defaultValue if no such value exists.

◆ GetValue64()

template<typename TBaseValue , typename TBsonElement , typename X = std::enable_if_t<std::is_same_v<uint64_t, typename TBaseValue::ValueType>>>
TBaseValue catapult::mongo::mappers::GetValue64 ( TBsonElement  element)

Gets a 64-bit value from element and converts it to a base value.

◆ IsEmptyDocument()

bool catapult::mongo::mappers::IsEmptyDocument ( const bsoncxx::document::value &  document)

Returns true if document is empty.

◆ StreamEmbeddedTransaction()

bson_stream::document & catapult::mongo::mappers::StreamEmbeddedTransaction ( bson_stream::document &  builder,
const model::EmbeddedTransaction transaction 
)

Streams an embedded transaction to builder.

◆ StreamMosaic() [1/2]

bson_stream::array_context & catapult::mongo::mappers::StreamMosaic ( bson_stream::array_context context,
MosaicId  id,
Amount  amount 
)

Streams a mosaic composed of id and amount to context.

◆ StreamMosaic() [2/2]

bson_stream::array_context & catapult::mongo::mappers::StreamMosaic ( bson_stream::array_context context,
UnresolvedMosaicId  id,
Amount  amount 
)

Streams a mosaic composed of id and amount to context.

◆ StreamReceipt() [1/3]

template<typename TArtifactId >
void catapult::mongo::mappers::StreamReceipt ( bson_stream::document &  builder,
const model::ArtifactExpiryReceipt< TArtifactId > &  receipt 
)

Streams receipt into builder.

Here is the call graph for this function:

◆ StreamReceipt() [2/3]

bson_stream::document & catapult::mongo::mappers::StreamReceipt ( bson_stream::document &  builder,
const model::Receipt receipt 
)

Streams a receipt to builder.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamReceipt() [3/3]

void catapult::mongo::mappers::StreamReceipt ( bson_stream::document &  builder,
const model::Receipt receipt,
const MongoReceiptRegistry receiptRegistry 
)

Streams a receipt into builder using receiptRegistry for mapping derived receipt types.

Here is the call graph for this function:

◆ StreamVerifiableEntity()

bson_stream::document & catapult::mongo::mappers::StreamVerifiableEntity ( bson_stream::document &  builder,
const model::VerifiableEntity entity 
)

Streams a verifiable entity to builder.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToBinary() [1/3]

bsoncxx::v_noabi::types::b_binary catapult::mongo::mappers::ToBinary ( const uint8_t *  pData,
size_t  size 
)

Converts raw array (pData) of size elements into bson binary type.

Here is the caller graph for this function:

◆ ToBinary() [2/3]

bsoncxx::v_noabi::types::b_binary catapult::mongo::mappers::ToBinary ( const UnresolvedAddress unresolvedAddress)

Converts unresolvedAddress into bson binary type.

Here is the call graph for this function:

◆ ToBinary() [3/3]

template<size_t N, typename TTag >
auto catapult::mongo::mappers::ToBinary ( const utils::ByteArray< N, TTag > &  array)

Converts byte array into bson binary type.

Here is the call graph for this function:

◆ ToDbDocuments()

std::vector< bsoncxx::document::value > catapult::mongo::mappers::ToDbDocuments ( const model::Transaction transaction,
const MongoTransactionMetadata metadata,
const MongoTransactionRegistry transactionRegistry 
)

Maps a transaction with metadata to representative db documents using transactionRegistry for mapping derived transaction types.

Here is the call graph for this function:

◆ ToDbModel() [1/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( const model::BlockElement blockElement)

Maps a blockElement to the corresponding db model entity.

Here is the call graph for this function:

◆ ToDbModel() [2/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( const model::TransactionStatus status)

Maps a transaction status to the corresponding db model value.

Here is the call graph for this function:

◆ ToDbModel() [3/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( const state::AccountState accountState)

Maps an account state (accountState) to the corresponding db model value.

Here is the call graph for this function:

◆ ToDbModel() [4/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( Height  height,
const model::AddressResolutionStatement statement 
)

Maps a statement at height to the corresponding db model value.

◆ ToDbModel() [5/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( Height  height,
const model::MosaicResolutionStatement statement 
)

Maps a statement at height to the corresponding db model value.

◆ ToDbModel() [6/6]

bsoncxx::document::value catapult::mongo::mappers::ToDbModel ( Height  height,
const model::TransactionStatement statement,
const MongoReceiptRegistry receiptRegistry 
)

Maps a statement at height to the corresponding db model value using receiptRegistry for mapping derived receipt types.

Here is the call graph for this function:

◆ ToInt32()

template<typename TBaseValue , typename X = std::enable_if_t<std::is_same_v<uint32_t, typename TBaseValue::ValueType>>>
int32_t catapult::mongo::mappers::ToInt32 ( TBaseValue  value)

Converts base value to int32_t.

Here is the caller graph for this function:

◆ ToInt64()

template<typename TBaseValue , typename X = std::enable_if_t<std::is_same_v<uint64_t, typename TBaseValue::ValueType>>>
int64_t catapult::mongo::mappers::ToInt64 ( TBaseValue  value)

Converts base value to int64_t.

Here is the caller graph for this function:

◆ ToModel() [1/2]

model::HashRange catapult::mongo::mappers::ToModel ( const std::vector< bsoncxx::document::view > &  hashContainer,
size_t  numHashes 
)

Maps numHashes db hashes from hashContainer to a hash range.

◆ ToModel() [2/2]

model::HashRange catapult::mongo::mappers::ToModel ( mongocxx::cursor &  cursor,
size_t  numHashes 
)

Maps numHashes db hashes under cursor to a hash range.

◆ ToUint32()

uint32_t catapult::mongo::mappers::ToUint32 ( int32_t  value)

Converts a 32 bit signed value to a 32 bit unsigned value.

Here is the caller graph for this function:

◆ ToUint8()

uint8_t catapult::mongo::mappers::ToUint8 ( int32_t  value)

Converts a 32 bit signed value to an 8 bit unsigned value.