123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- // 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 Topics.cpp
- * This source file contains the definition of the described types in the IDL file.
- *
- * This file was generated by the tool gen.
- */
- #ifdef USE_FASTRTPS
- #ifdef _WIN32
- // Remove linker warning LNK4221 on Visual Studio
- namespace { char dummy; }
- #endif
- #include "Topics.h"
- #include <fastcdr/Cdr.h>
- #include <fastcdr/exceptions/BadParamException.h>
- using namespace eprosima::fastcdr::exception;
- #include <utility>
- TopicSample::Message::Message()
- {
- // m_msgname com.eprosima.idl.parser.typecode.StringTypeCode@76329302
- m_msgname ="";
- // m_counter com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e25a92e
- m_counter = 0;
- // m_sendtime com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4df828d7
- m_sendtime = 0;
- // m_xdata com.eprosima.idl.parser.typecode.AliasTypeCode@b59d31
- m_xdata.push_back(1);
- m_xdata.push_back(2);
- }
- TopicSample::Message::~Message()
- {
- }
- TopicSample::Message::Message(const Message &x)
- {
- m_msgname = x.m_msgname;
- m_counter = x.m_counter;
- m_sendtime = x.m_sendtime;
- m_xdata = x.m_xdata;
- }
- TopicSample::Message::Message(Message &&x)
- {
- m_msgname = std::move(x.m_msgname);
- m_counter = x.m_counter;
- m_sendtime = x.m_sendtime;
- m_xdata = std::move(x.m_xdata);
- }
- TopicSample::Message& TopicSample::Message::operator=(const Message &x)
- {
- m_msgname = x.m_msgname;
- m_counter = x.m_counter;
- m_sendtime = x.m_sendtime;
- m_xdata = x.m_xdata;
- return *this;
- }
- TopicSample::Message& TopicSample::Message::operator=(Message &&x)
- {
- m_msgname = std::move(x.m_msgname);
- m_counter = x.m_counter;
- m_sendtime = x.m_sendtime;
- m_xdata = std::move(x.m_xdata);
- return *this;
- }
- size_t TopicSample::Message::getMaxCdrSerializedSize(size_t current_alignment)
- {
- size_t initial_alignment = current_alignment;
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1;
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
- current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
- current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
- return 10000000;
- // return current_alignment - initial_alignment;
- }
- size_t TopicSample::Message::getCdrSerializedSize(const TopicSample::Message& data, size_t current_alignment)
- {
- (void)data;
- size_t initial_alignment = current_alignment;
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.msgname().size() + 1;
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
- current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
- if (data.xdata().size() > 0)
- {
- current_alignment += (data.xdata().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
- }
- return current_alignment - initial_alignment;
- }
- void TopicSample::Message::serialize(eprosima::fastcdr::Cdr &scdr) const
- {
- scdr << m_msgname;
- scdr << m_counter;
- scdr << m_sendtime;
- scdr << m_xdata;
- // std::cout<<"serialize."<<std::endl;
- }
- void TopicSample::Message::deserialize(eprosima::fastcdr::Cdr &dcdr)
- {
- dcdr >> m_msgname;
- dcdr >> m_counter;
- dcdr >> m_sendtime;
- dcdr >> m_xdata;
- }
- /*!
- * @brief This function copies the value in member msgname
- * @param _msgname New value to be copied in member msgname
- */
- void TopicSample::Message::msgname(const std::string &_msgname)
- {
- m_msgname = _msgname;
- }
- /*!
- * @brief This function moves the value in member msgname
- * @param _msgname New value to be moved in member msgname
- */
- void TopicSample::Message::msgname(std::string &&_msgname)
- {
- m_msgname = std::move(_msgname);
- }
- /*!
- * @brief This function returns a constant reference to member msgname
- * @return Constant reference to member msgname
- */
- const std::string& TopicSample::Message::msgname() const
- {
- return m_msgname;
- }
- /*!
- * @brief This function returns a reference to member msgname
- * @return Reference to member msgname
- */
- std::string& TopicSample::Message::msgname()
- {
- return m_msgname;
- }
- /*!
- * @brief This function sets a value in member counter
- * @param _counter New value for member counter
- */
- void TopicSample::Message::counter(int32_t _counter)
- {
- m_counter = _counter;
- }
- /*!
- * @brief This function returns the value of member counter
- * @return Value of member counter
- */
- int32_t TopicSample::Message::counter() const
- {
- return m_counter;
- }
- /*!
- * @brief This function returns a reference to member counter
- * @return Reference to member counter
- */
- int32_t& TopicSample::Message::counter()
- {
- return m_counter;
- }
- /*!
- * @brief This function sets a value in member sendtime
- * @param _sendtime New value for member sendtime
- */
- void TopicSample::Message::sendtime(int64_t _sendtime)
- {
- m_sendtime = _sendtime;
- }
- /*!
- * @brief This function returns the value of member sendtime
- * @return Value of member sendtime
- */
- int64_t TopicSample::Message::sendtime() const
- {
- return m_sendtime;
- }
- /*!
- * @brief This function returns a reference to member sendtime
- * @return Reference to member sendtime
- */
- int64_t& TopicSample::Message::sendtime()
- {
- return m_sendtime;
- }
- /*!
- * @brief This function copies the value in member xdata
- * @param _xdata New value to be copied in member xdata
- */
- void TopicSample::Message::xdata(const TopicSample::SomeBytes &_xdata)
- {
- // return;
- m_xdata = _xdata;
- //int i;
- //for(i=0;i<300;i++)
- // m_xdata.push_back(_xdata.at(i));
- }
- /*!
- * @brief This function moves the value in member xdata
- * @param _xdata New value to be moved in member xdata
- */
- void TopicSample::Message::xdata(TopicSample::SomeBytes &&_xdata)
- {
- m_xdata = std::move(_xdata);
- }
- /*!
- * @brief This function returns a constant reference to member xdata
- * @return Constant reference to member xdata
- */
- const TopicSample::SomeBytes& TopicSample::Message::xdata() const
- {
- return m_xdata;
- }
- /*!
- * @brief This function returns a reference to member xdata
- * @return Reference to member xdata
- */
- TopicSample::SomeBytes& TopicSample::Message::xdata()
- {
- return m_xdata;
- }
- size_t TopicSample::Message::getKeyMaxCdrSerializedSize(size_t current_alignment)
- {
- size_t current_align = current_alignment;
- return current_align;
- }
- bool TopicSample::Message::isKeyDefined()
- {
- return false;
- }
- void TopicSample::Message::serializeKey(eprosima::fastcdr::Cdr &scdr) const
- {
- (void) scdr;
-
-
-
-
- }
- #endif
|