ObjectMapper.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-mongo
#include "oatpp-mongo/bson/mapping/ObjectMapper.hpp"

ObjectMapper

BSON ObjectMapper. Serialized/Deserializes oatpp DTO objects to/from BSON. See Data Transfer Object(DTO) component.
Extends oatpp::base::Countable, oatpp::data::mapping::ObjectMapper.

namespace oatpp { namespace mongo { namespace bson { namespace mapping { 
  class ObjectMapper : public oatpp::base::Countable, public oatpp::data::mapping::ObjectMapper {}
}}}}

Methods

Return Type Name Summary
[none] ObjectMapper Multiple implementations:
  1. Constructor.
  2. Constructor.
std::shared_ptr<ObjectMapper> createShared Multiple implementations:
  1. Create shared ObjectMapper.
  2. Create shared ObjectMapper.
void write Implementation of oatpp::data::mapping::ObjectMapper::write().
oatpp::Void read Implementation of oatpp::data::mapping::ObjectMapper::read().
std::shared_ptr<Serializer> getSerializer Get serializer.
std::shared_ptr<Deserializer> getDeserializer Get deserializer.

ObjectMapper::ObjectMapper

  1. Constructor.
    • @param serializerConfig - oatpp::parser::bson::mapping::Serializer::Config.
    • @param deserializerConfig - oatpp::parser::bson::mapping::Deserializer::Config.
    ObjectMapper(const std::shared_ptr<Serializer::Config>& serializerConfig,
                 const std::shared_ptr<Deserializer::Config>& deserializerConfig)
    
  2. Constructor.
    • @param serializer
    • @param deserializer
    ObjectMapper(const std::shared_ptr<Serializer>& serializer = std::make_shared<Serializer>(),
                 const std::shared_ptr<Deserializer>& deserializer = std::make_shared<Deserializer>())
    

ObjectMapper::createShared

  1. Create shared ObjectMapper.
    • @param serializerConfig - oatpp::parser::bson::mapping::Serializer::Config.
    • @param deserializerConfig - oatpp::parser::bson::mapping::Deserializer::Config.
    • @return - std::shared_ptr to ObjectMapper.
    static std::shared_ptr<ObjectMapper>
    createShared(const std::shared_ptr<Serializer::Config>& serializerConfig,
                 const std::shared_ptr<Deserializer::Config>& deserializerConfig)
    
  2. Create shared ObjectMapper.
    • @param serializer
    • @param deserializer
    • @return
    static std::shared_ptr<ObjectMapper>
    createShared(const std::shared_ptr<Serializer>& serializer = std::make_shared<Serializer>(),
                 const std::shared_ptr<Deserializer>& deserializer = std::make_shared<Deserializer>())
    

ObjectMapper::write

Implementation of oatpp::data::mapping::ObjectMapper::write().

void write(data::stream::ConsistentOutputStream* stream, const oatpp::Void& variant) const override

ObjectMapper::read

Implementation of oatpp::data::mapping::ObjectMapper::read().

oatpp::Void read(oatpp::parser::Caret& caret, const oatpp::data::mapping::type::Type* const type) const override

ObjectMapper::getSerializer

Get serializer.

  • @return

std::shared_ptr<Serializer> getSerializer()

ObjectMapper::getDeserializer

Get deserializer.

  • @return

std::shared_ptr<Deserializer> getDeserializer()