// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file DDSSampleMachineCdrAux.ipp
 * This source file contains some declarations of CDR related functions.
 *
 * This file was generated by the tool fastddsgen.
 */

#ifndef FAST_DDS_GENERATED__SAMPLEMODULE_DDSSAMPLEMACHINECDRAUX_IPP
#define FAST_DDS_GENERATED__SAMPLEMODULE_DDSSAMPLEMACHINECDRAUX_IPP

#include "DDSSampleMachineCdrAux.hpp"

#include <fastcdr/Cdr.h>
#include <fastcdr/CdrSizeCalculator.hpp>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

namespace eprosima {
namespace fastcdr {

template<>
eProsima_user_DllExport size_t calculate_serialized_size(
        eprosima::fastcdr::CdrSizeCalculator& calculator,
        const SampleModule::SampleConfig& data,
        size_t& current_alignment)
{
    using namespace SampleModule;

    static_cast<void>(data);

    eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
    size_t calculated_size {calculator.begin_calculate_type_serialized_size(
                                eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
                                eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
                                eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
                                current_alignment)};


        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
                data.unifiedDepth(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
                data.sampleOrder(), current_alignment);


    calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);

    return calculated_size;
}

template<>
eProsima_user_DllExport void serialize(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleConfig& data)
{
    using namespace SampleModule;

    eprosima::fastcdr::Cdr::state current_state(scdr);
    scdr.begin_serialize_type(current_state,
            eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);

    scdr
        << eprosima::fastcdr::MemberId(0) << data.unifiedDepth()
        << eprosima::fastcdr::MemberId(1) << data.sampleOrder()
;
    scdr.end_serialize_type(current_state);
}

template<>
eProsima_user_DllExport void deserialize(
        eprosima::fastcdr::Cdr& cdr,
        SampleModule::SampleConfig& data)
{
    using namespace SampleModule;

    cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
            [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
            {
                bool ret_value = true;
                switch (mid.id)
                {
                                        case 0:
                                                dcdr >> data.unifiedDepth();
                                            break;

                                        case 1:
                                                dcdr >> data.sampleOrder();
                                            break;

                    default:
                        ret_value = false;
                        break;
                }
                return ret_value;
            });
}

void serialize_key(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleConfig& data)
{
    using namespace SampleModule;

    static_cast<void>(scdr);
    static_cast<void>(data);
                        scdr << data.unifiedDepth();

                        scdr << data.sampleOrder();

}


template<>
eProsima_user_DllExport size_t calculate_serialized_size(
        eprosima::fastcdr::CdrSizeCalculator& calculator,
        const SampleModule::SampleCommand& data,
        size_t& current_alignment)
{
    using namespace SampleModule;

    static_cast<void>(data);

    eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
    size_t calculated_size {calculator.begin_calculate_type_serialized_size(
                                eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
                                eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
                                eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
                                current_alignment)};


        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
                data.maskBits(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
                data.controlType(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
                data.startSample(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
                data.stopSample(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
                data.reset(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
                data.positionCheck(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
                data.emergencyUp(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
                data.emergencyStop(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
                data.controlBelt1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
                data.controlBelt2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10),
                data.controlCrush1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11),
                data.controlCrush2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12),
                data.controlDivider(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13),
                data.controlCoalDistributor(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14),
                data.reductionRatio(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15),
                data.version(), current_alignment);


    calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);

    return calculated_size;
}

template<>
eProsima_user_DllExport void serialize(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleCommand& data)
{
    using namespace SampleModule;

    eprosima::fastcdr::Cdr::state current_state(scdr);
    scdr.begin_serialize_type(current_state,
            eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);

    scdr
        << eprosima::fastcdr::MemberId(0) << data.maskBits()
        << eprosima::fastcdr::MemberId(1) << data.controlType()
        << eprosima::fastcdr::MemberId(2) << data.startSample()
        << eprosima::fastcdr::MemberId(3) << data.stopSample()
        << eprosima::fastcdr::MemberId(4) << data.reset()
        << eprosima::fastcdr::MemberId(5) << data.positionCheck()
        << eprosima::fastcdr::MemberId(6) << data.emergencyUp()
        << eprosima::fastcdr::MemberId(7) << data.emergencyStop()
        << eprosima::fastcdr::MemberId(8) << data.controlBelt1()
        << eprosima::fastcdr::MemberId(9) << data.controlBelt2()
        << eprosima::fastcdr::MemberId(10) << data.controlCrush1()
        << eprosima::fastcdr::MemberId(11) << data.controlCrush2()
        << eprosima::fastcdr::MemberId(12) << data.controlDivider()
        << eprosima::fastcdr::MemberId(13) << data.controlCoalDistributor()
        << eprosima::fastcdr::MemberId(14) << data.reductionRatio()
        << eprosima::fastcdr::MemberId(15) << data.version()
;
    scdr.end_serialize_type(current_state);
}

template<>
eProsima_user_DllExport void deserialize(
        eprosima::fastcdr::Cdr& cdr,
        SampleModule::SampleCommand& data)
{
    using namespace SampleModule;

    cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
            [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
            {
                bool ret_value = true;
                switch (mid.id)
                {
                                        case 0:
                                                dcdr >> data.maskBits();
                                            break;

                                        case 1:
                                                dcdr >> data.controlType();
                                            break;

                                        case 2:
                                                dcdr >> data.startSample();
                                            break;

                                        case 3:
                                                dcdr >> data.stopSample();
                                            break;

                                        case 4:
                                                dcdr >> data.reset();
                                            break;

                                        case 5:
                                                dcdr >> data.positionCheck();
                                            break;

                                        case 6:
                                                dcdr >> data.emergencyUp();
                                            break;

                                        case 7:
                                                dcdr >> data.emergencyStop();
                                            break;

                                        case 8:
                                                dcdr >> data.controlBelt1();
                                            break;

                                        case 9:
                                                dcdr >> data.controlBelt2();
                                            break;

                                        case 10:
                                                dcdr >> data.controlCrush1();
                                            break;

                                        case 11:
                                                dcdr >> data.controlCrush2();
                                            break;

                                        case 12:
                                                dcdr >> data.controlDivider();
                                            break;

                                        case 13:
                                                dcdr >> data.controlCoalDistributor();
                                            break;

                                        case 14:
                                                dcdr >> data.reductionRatio();
                                            break;

                                        case 15:
                                                dcdr >> data.version();
                                            break;

                    default:
                        ret_value = false;
                        break;
                }
                return ret_value;
            });
}

void serialize_key(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleCommand& data)
{
    using namespace SampleModule;

    static_cast<void>(scdr);
    static_cast<void>(data);
                        scdr << data.maskBits();

                        scdr << data.controlType();

                        scdr << data.startSample();

                        scdr << data.stopSample();

                        scdr << data.reset();

                        scdr << data.positionCheck();

                        scdr << data.emergencyUp();

                        scdr << data.emergencyStop();

                        scdr << data.controlBelt1();

                        scdr << data.controlBelt2();

                        scdr << data.controlCrush1();

                        scdr << data.controlCrush2();

                        scdr << data.controlDivider();

                        scdr << data.controlCoalDistributor();

                        scdr << data.reductionRatio();

                        scdr << data.version();

}


template<>
eProsima_user_DllExport size_t calculate_serialized_size(
        eprosima::fastcdr::CdrSizeCalculator& calculator,
        const SampleModule::SampleMachineInfo& data,
        size_t& current_alignment)
{
    using namespace SampleModule;

    static_cast<void>(data);

    eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
    size_t calculated_size {calculator.begin_calculate_type_serialized_size(
                                eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
                                eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
                                eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
                                current_alignment)};


        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
                data.maskBits(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
                data.bigPoint(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
                data.smallPoint(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
                data.depthPoint(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
                data.hasToXY(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
                data.hasSamplePoints(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
                data.gameOver(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
                data.backState(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
                data.sampleState(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
                data.belt1State(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10),
                data.belt2State(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11),
                data.crush1State(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12),
                data.crush2State(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13),
                data.dividerState(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14),
                data.bigLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15),
                data.bigZeroLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16),
                data.smallLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17),
                data.smallZeroLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18),
                data.upLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19),
                data.downLimit(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20),
                data.version(), current_alignment);


    calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);

    return calculated_size;
}

template<>
eProsima_user_DllExport void serialize(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleMachineInfo& data)
{
    using namespace SampleModule;

    eprosima::fastcdr::Cdr::state current_state(scdr);
    scdr.begin_serialize_type(current_state,
            eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);

    scdr
        << eprosima::fastcdr::MemberId(0) << data.maskBits()
        << eprosima::fastcdr::MemberId(1) << data.bigPoint()
        << eprosima::fastcdr::MemberId(2) << data.smallPoint()
        << eprosima::fastcdr::MemberId(3) << data.depthPoint()
        << eprosima::fastcdr::MemberId(4) << data.hasToXY()
        << eprosima::fastcdr::MemberId(5) << data.hasSamplePoints()
        << eprosima::fastcdr::MemberId(6) << data.gameOver()
        << eprosima::fastcdr::MemberId(7) << data.backState()
        << eprosima::fastcdr::MemberId(8) << data.sampleState()
        << eprosima::fastcdr::MemberId(9) << data.belt1State()
        << eprosima::fastcdr::MemberId(10) << data.belt2State()
        << eprosima::fastcdr::MemberId(11) << data.crush1State()
        << eprosima::fastcdr::MemberId(12) << data.crush2State()
        << eprosima::fastcdr::MemberId(13) << data.dividerState()
        << eprosima::fastcdr::MemberId(14) << data.bigLimit()
        << eprosima::fastcdr::MemberId(15) << data.bigZeroLimit()
        << eprosima::fastcdr::MemberId(16) << data.smallLimit()
        << eprosima::fastcdr::MemberId(17) << data.smallZeroLimit()
        << eprosima::fastcdr::MemberId(18) << data.upLimit()
        << eprosima::fastcdr::MemberId(19) << data.downLimit()
        << eprosima::fastcdr::MemberId(20) << data.version()
;
    scdr.end_serialize_type(current_state);
}

template<>
eProsima_user_DllExport void deserialize(
        eprosima::fastcdr::Cdr& cdr,
        SampleModule::SampleMachineInfo& data)
{
    using namespace SampleModule;

    cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
            [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
            {
                bool ret_value = true;
                switch (mid.id)
                {
                                        case 0:
                                                dcdr >> data.maskBits();
                                            break;

                                        case 1:
                                                dcdr >> data.bigPoint();
                                            break;

                                        case 2:
                                                dcdr >> data.smallPoint();
                                            break;

                                        case 3:
                                                dcdr >> data.depthPoint();
                                            break;

                                        case 4:
                                                dcdr >> data.hasToXY();
                                            break;

                                        case 5:
                                                dcdr >> data.hasSamplePoints();
                                            break;

                                        case 6:
                                                dcdr >> data.gameOver();
                                            break;

                                        case 7:
                                                dcdr >> data.backState();
                                            break;

                                        case 8:
                                                dcdr >> data.sampleState();
                                            break;

                                        case 9:
                                                dcdr >> data.belt1State();
                                            break;

                                        case 10:
                                                dcdr >> data.belt2State();
                                            break;

                                        case 11:
                                                dcdr >> data.crush1State();
                                            break;

                                        case 12:
                                                dcdr >> data.crush2State();
                                            break;

                                        case 13:
                                                dcdr >> data.dividerState();
                                            break;

                                        case 14:
                                                dcdr >> data.bigLimit();
                                            break;

                                        case 15:
                                                dcdr >> data.bigZeroLimit();
                                            break;

                                        case 16:
                                                dcdr >> data.smallLimit();
                                            break;

                                        case 17:
                                                dcdr >> data.smallZeroLimit();
                                            break;

                                        case 18:
                                                dcdr >> data.upLimit();
                                            break;

                                        case 19:
                                                dcdr >> data.downLimit();
                                            break;

                                        case 20:
                                                dcdr >> data.version();
                                            break;

                    default:
                        ret_value = false;
                        break;
                }
                return ret_value;
            });
}

void serialize_key(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SampleMachineInfo& data)
{
    using namespace SampleModule;

    static_cast<void>(scdr);
    static_cast<void>(data);
                        scdr << data.maskBits();

                        scdr << data.bigPoint();

                        scdr << data.smallPoint();

                        scdr << data.depthPoint();

                        scdr << data.hasToXY();

                        scdr << data.hasSamplePoints();

                        scdr << data.gameOver();

                        scdr << data.backState();

                        scdr << data.sampleState();

                        scdr << data.belt1State();

                        scdr << data.belt2State();

                        scdr << data.crush1State();

                        scdr << data.crush2State();

                        scdr << data.dividerState();

                        scdr << data.bigLimit();

                        scdr << data.bigZeroLimit();

                        scdr << data.smallLimit();

                        scdr << data.smallZeroLimit();

                        scdr << data.upLimit();

                        scdr << data.downLimit();

                        scdr << data.version();

}


template<>
eProsima_user_DllExport size_t calculate_serialized_size(
        eprosima::fastcdr::CdrSizeCalculator& calculator,
        const SampleModule::SamplePoints& data,
        size_t& current_alignment)
{
    using namespace SampleModule;

    static_cast<void>(data);

    eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
    size_t calculated_size {calculator.begin_calculate_type_serialized_size(
                                eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
                                eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
                                eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
                                current_alignment)};


        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
                data.totalPoints(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
                data.x1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
                data.y1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
                data.z1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
                data.o1(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
                data.x2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
                data.y2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
                data.z2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
                data.o2(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
                data.x3(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10),
                data.y3(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11),
                data.z3(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12),
                data.o3(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13),
                data.x4(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14),
                data.y4(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15),
                data.z4(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16),
                data.o4(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17),
                data.x5(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18),
                data.y5(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19),
                data.z5(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20),
                data.o5(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21),
                data.x6(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(22),
                data.y6(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(23),
                data.z6(), current_alignment);

        calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(24),
                data.o6(), current_alignment);


    calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);

    return calculated_size;
}

template<>
eProsima_user_DllExport void serialize(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SamplePoints& data)
{
    using namespace SampleModule;

    eprosima::fastcdr::Cdr::state current_state(scdr);
    scdr.begin_serialize_type(current_state,
            eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);

    scdr
        << eprosima::fastcdr::MemberId(0) << data.totalPoints()
        << eprosima::fastcdr::MemberId(1) << data.x1()
        << eprosima::fastcdr::MemberId(2) << data.y1()
        << eprosima::fastcdr::MemberId(3) << data.z1()
        << eprosima::fastcdr::MemberId(4) << data.o1()
        << eprosima::fastcdr::MemberId(5) << data.x2()
        << eprosima::fastcdr::MemberId(6) << data.y2()
        << eprosima::fastcdr::MemberId(7) << data.z2()
        << eprosima::fastcdr::MemberId(8) << data.o2()
        << eprosima::fastcdr::MemberId(9) << data.x3()
        << eprosima::fastcdr::MemberId(10) << data.y3()
        << eprosima::fastcdr::MemberId(11) << data.z3()
        << eprosima::fastcdr::MemberId(12) << data.o3()
        << eprosima::fastcdr::MemberId(13) << data.x4()
        << eprosima::fastcdr::MemberId(14) << data.y4()
        << eprosima::fastcdr::MemberId(15) << data.z4()
        << eprosima::fastcdr::MemberId(16) << data.o4()
        << eprosima::fastcdr::MemberId(17) << data.x5()
        << eprosima::fastcdr::MemberId(18) << data.y5()
        << eprosima::fastcdr::MemberId(19) << data.z5()
        << eprosima::fastcdr::MemberId(20) << data.o5()
        << eprosima::fastcdr::MemberId(21) << data.x6()
        << eprosima::fastcdr::MemberId(22) << data.y6()
        << eprosima::fastcdr::MemberId(23) << data.z6()
        << eprosima::fastcdr::MemberId(24) << data.o6()
;
    scdr.end_serialize_type(current_state);
}

template<>
eProsima_user_DllExport void deserialize(
        eprosima::fastcdr::Cdr& cdr,
        SampleModule::SamplePoints& data)
{
    using namespace SampleModule;

    cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
            eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
            eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
            [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
            {
                bool ret_value = true;
                switch (mid.id)
                {
                                        case 0:
                                                dcdr >> data.totalPoints();
                                            break;

                                        case 1:
                                                dcdr >> data.x1();
                                            break;

                                        case 2:
                                                dcdr >> data.y1();
                                            break;

                                        case 3:
                                                dcdr >> data.z1();
                                            break;

                                        case 4:
                                                dcdr >> data.o1();
                                            break;

                                        case 5:
                                                dcdr >> data.x2();
                                            break;

                                        case 6:
                                                dcdr >> data.y2();
                                            break;

                                        case 7:
                                                dcdr >> data.z2();
                                            break;

                                        case 8:
                                                dcdr >> data.o2();
                                            break;

                                        case 9:
                                                dcdr >> data.x3();
                                            break;

                                        case 10:
                                                dcdr >> data.y3();
                                            break;

                                        case 11:
                                                dcdr >> data.z3();
                                            break;

                                        case 12:
                                                dcdr >> data.o3();
                                            break;

                                        case 13:
                                                dcdr >> data.x4();
                                            break;

                                        case 14:
                                                dcdr >> data.y4();
                                            break;

                                        case 15:
                                                dcdr >> data.z4();
                                            break;

                                        case 16:
                                                dcdr >> data.o4();
                                            break;

                                        case 17:
                                                dcdr >> data.x5();
                                            break;

                                        case 18:
                                                dcdr >> data.y5();
                                            break;

                                        case 19:
                                                dcdr >> data.z5();
                                            break;

                                        case 20:
                                                dcdr >> data.o5();
                                            break;

                                        case 21:
                                                dcdr >> data.x6();
                                            break;

                                        case 22:
                                                dcdr >> data.y6();
                                            break;

                                        case 23:
                                                dcdr >> data.z6();
                                            break;

                                        case 24:
                                                dcdr >> data.o6();
                                            break;

                    default:
                        ret_value = false;
                        break;
                }
                return ret_value;
            });
}

void serialize_key(
        eprosima::fastcdr::Cdr& scdr,
        const SampleModule::SamplePoints& data)
{
    using namespace SampleModule;

    static_cast<void>(scdr);
    static_cast<void>(data);
                        scdr << data.totalPoints();

                        scdr << data.x1();

                        scdr << data.y1();

                        scdr << data.z1();

                        scdr << data.o1();

                        scdr << data.x2();

                        scdr << data.y2();

                        scdr << data.z2();

                        scdr << data.o2();

                        scdr << data.x3();

                        scdr << data.y3();

                        scdr << data.z3();

                        scdr << data.o3();

                        scdr << data.x4();

                        scdr << data.y4();

                        scdr << data.z4();

                        scdr << data.o4();

                        scdr << data.x5();

                        scdr << data.y5();

                        scdr << data.z5();

                        scdr << data.o5();

                        scdr << data.x6();

                        scdr << data.y6();

                        scdr << data.z6();

                        scdr << data.o6();

}



} // namespace fastcdr
} // namespace eprosima

#endif // FAST_DDS_GENERATED__SAMPLEMODULE_DDSSAMPLEMACHINECDRAUX_IPP

