swimming_pool/swimming_pool/Serializers/Shape_serializer.cpp
P_Shape* Shape_serializer::to_object(std::string const& source)
{
    vstring_t parts = split(source, delimeter_);
    if (parts.size() < 4) {
        return nullptr;
    }
    
    P_Shape* p_shape = new P_Shape;
    p_shape->length_ = std::stod(parts[0]);
    p_shape->width_  = std::stod(parts[1]);
    p_shape->depth_  = std::stod(parts[2]);
    p_shape->shape_  = Shapes::to_shape(parts[3]);
    return p_shape;
}
/*
* Override of Serializer function for proper converting a string to P_Shape object
*/
Override of Serializer function for proper converting a string to P_Shape object
Override of Serializer function for proper converting a string to P_Shape object
P_Shape* Shape_serializer::to_object(std::string const& source)
{
    vstring_t parts = split(source, delimeter_);
    if (parts.size() < 4) {
        return nullptr;
    }
    P_Shape* p_shape = new P_Shape;
    p_shape->length_ = std::stod(parts[0]);
    p_shape->width_  = std::stod(parts[1]);
    p_shape->depth_  = std::stod(parts[2]);
    p_shape->shape_  = Shapes::to_shape(parts[3]);
    return p_shape;
}
P_Shape * Shape_serializer :: to_object ( std :: string const & source ) { vstring_t parts = split ( source , delimeter_ ) ; if ( parts . size ( ) < 4 ) { return nullptr ; } P_Shape * p_shape = new P_Shape ; p_shape -> length_ = std :: stod ( parts [ 0 ] ) ; p_shape -> width_ = std :: stod ( parts [ 1 ] ) ; p_shape -> depth_ = std :: stod ( parts [ 2 ] ) ; p_shape -> shape_ = Shapes :: to_shape ( parts [ 3 ] ) ; return p_shape ; }
Override of Serializer function for proper converting a string to P_Shape object
Override of Serializer function for proper converting a string to P_Shape object