Skip to content

Commit

Permalink
TCP transport (eProsima#251)
Browse files Browse the repository at this point in the history
* Refs eProsima#2920 - Separate the cdr buffer from the message receives to set it into the socket infos.

* Refs eProsima#2920 - Update the binding method for remote locators during the TCP negotiation.

* Refs eProsima#2920 - Create socketinfo.cpp with the implemented methods from the header file.

* Refs eProsima#2920 Updated receivers management to store them in a map for future connections.

* Refs eProsima#2920 Fix UDP refactoring issues

* Refs eProsima#2928 - Add TCP types to the XML Parser
- Update TCP transport to fix an issue opening output channels over an input socket.

* Refs eProsima#2928 - Remove the shared pointers from the Socket Infos

* Refs eProsima#2928 - Remove shared pointers from several mutex on socket info

* Refs eProsima#2928 - Remove the shared pointers for TCP acceptors and update the hello world initialization for UDP.

* Refs eProsima#2926

* Refs eProsima#2927 Only BindConnection adapted

* Refs eProsima#2927 Payload usage

* Refs eProsima#2927 Payload not used in headers. Size fixed.

* Refs eProsima#2927 TCP Control Messages uses Cdr, but they are not using idl's union types yet.
OpenLogicalPort negociation seems to work fine, redirection maybe not.

* Refs eProsima#2928 - Adapt TCPv4 Transport without the ASIO_HAS_MOVE Macro for Android Devices.
- Update project configuration to build fastrtps with fastcdr in Windows

* Refs eProsima#2928 - Fix Compilation issue.

* Refs eProsima#2927 Using Payload directly.

* Refs eProsima#2927 Changed how buffer size is allocated.

* Refs eProsima#2928 - Fix compilation warnings

* Refs eProsima#2927

* Refs eProsima#2927 OpenLogicalPort mechanism

* Refs eProsima#2928 Unify the input logical ports management.

* Refs eProsima#2928 Fix issue with the Participant discovery

* Refs eProsima#2927

* Refs eProsima#2927

* Refs eProsima#2934 HelloWorldExample to HelloWorldExampleTCP and original HelloWorldExample recovered

* Refs eProsima#2928 - Create Unit tests for TCPV4 Transport

* Refs eProsima#2936 GTests compile. Some transport test need to be adapted.

* Refs eProsima#2934 - HelloWorldTCP

* Refs eProsima#2939 and eProsima#2940. Removed shared_ptr. SenderResource now has a pointer to the socket.

* Refs #2938 -Refactor all the resources creation to force writers and readers to create the resources that they need.

* Refs #2938 - Commit pending changes

* Refs eProsima#2939

* Refs #2938 Update sockets destruction to manage them asynchronously

* Refs #2938 Adapt UDP protocol to the new initialization of the Participants

* Refs #2938 - Update the retry system for ports creation.

* Refs eProsima#2944 Bug fixes

* Refs eProsima#2944

* Refs #2938 Fix several issues with the TCP communication
- Fix crash with the logger when the application is killed

* Refs eProsima#2944

* Refs eProsima#2944 Improved performance and thread-safe for standard log consumer.

* Refs eProsima#2944 More log options

* Refs #2938 Fix issue if the publisher is launched before the subscriber

* Refs #2938. Remove debug checking

* Refs eProsima#2944 log filtering

* Refs eProsima#2944 Fixed multiple subscribers.

* Refs #2938. Update the initialization of SenderResources and ReceiverResources in the ParticipantImpl
- Create test_TCPV4Transport

* Refs eProsima#2944 Fixed several subscribers and one left before publisher ends.

* Refs eProsima#2944 Several fixes.

* Refs eProsima#2948. Create Test_RTCPMessageManager to test errors during the TCP communication.

* Refs eProsima#2948. Fix compilation warnings

* Refs eProsima#2958 WAN support. HelloworldExampleTCP with best effort.

* Refs eProsima#2969 Update RTCP messages management adding several security checks.

* Refs eProsima#2934

* Refs eProsima#2969 Fix a race condition while a subscriber closes the connection with the publisher.
- Refactor several classes with the new coding style

* Refs eProsima#2934 Fixed configuration for retrieve missing messages.

* Refs eProsima#2969 - Create a timedEvent to clean the deleted sockets of the TCP Transport.
- Update copyright year in several files

* Refs eProsima#2969 Fix issue with the release of a timer in the tcp transport

* Refs eProsima#2974 Fixed dirty disconnections.

* Refs eProsima#2934 Helloworld with samples doesn't wait for enter.

* Refs eProsima#2969 - Fix error when the publisher stops without unmatching.

* Refs eProsima#2974 - Update the documentation and remove unnecessary variables.

* Refs eProsima#2974 Update the documentation about TCP transport

* Refs eProsima#2947 Remove the DefaultOutputLocator List because we don't need it in the new design

* Refs eProsima#2974. Refactor the output locators management changing them for remote locators.

* Refs eProsima#2974 Rename SocketInfo class for ChannelResource

* Refs eProsima#2974. Fix an issue with the optimization of the SenderResource<->ChannelResource relationship.

* Refs eProsima#2974 Update and fix several errors in the unit tests

* Refs eProsima#2973 XML parser adapted to parse xml node.

* Refs eProsima#2974. - Fix an issue opening an output logical port in the publisher side.

* Refs eProsima#3024. Update the first implementation of TCPv6 Transport.

* Refs eProsima#2974. Add extra checking before adding a logical port to open.

* Refs eProsima#2974. Fix an issue with the discovering process. ( Pending Logical Ports )

* Refs eProsima#2936 Fixed test and example compilation. Added MockReceiverResource.

* Refs eProsima#2936 Transport tests adapted. Two tests commented.

* Refs eProsima#3029. Implement transport parsing from XML files.

* Refs eProsima#2936 Fixed warning in release (Jenkins)

* Refs eProsima#2974. Fix Race condition during the destruction of a UDP transport.

* Refs eProsima#3029. Update the parsing method for Locators to support TCPv4 and IP6 addresses

* Refs eProsima#2936 Fixed XMLparser tests cmake

* Refs eProsima#2974 Add a new method to move the logical ports between channels if the connection is lost and we need to create a new one.

* Refs eProsima#2974. Create a security method to open a logical port if it's close during a send.

* Refs eProsima#2974. Create a security method to open a logical port if it's close during a send.

* Refs eProsima#2936 Test fixing and createParticipant added bool for IS.

* Refs eProsima#2936 Performance tests.

* Refs eProsima#2936 Profiling tests compile again.

* Refs eProsima#3034. Update the output channel creation to send the size of the buffer that could be created.

* Refs eProsima#3034. Create a new example benchmark to check how many messages can be sent with several configurations

* Refs eProsima#2936 Test compatibility.

* Refs eProsima#3034 Fixes for linux

* Refs eProsima#3034 Anouncement period to 1s

* Refs eProsima#2974 Testing avoid memcpy in send/recv.

* Refs eProsima#2974 IPv6 versions

* Refs eProsima#3034. Fix small issues in the benchmark.

* Refs eProsima#3034 Fix issue with TCP transports and Best Effort configuration

* Refs eProsima#2974 Restored Log header

* Refs eProsima#2974 Added asio directory

* Refs eProsima#3037 Close Socket now waits until all writers/readers closed it.

* Refs eProsima#3034 Fix compilation warnings.

* Refs eProsima#3034 Add an extra try-catch to manage an edge case

* Refs eProsima#3034. Remove the historic in the subscriber to avoid fails during the second test

* Rebase in process. Solving issues.

* Merge

* Refs eProsima#2975. Fix compilation warnings

* Refs eProsima#2975

* Refs eProsima#2975. Fix running issue on UDP4 & UDP6

* Refs eProsima#2975. update header files.

* Refs eProsima#2975

* Refs eProsima#2975 Update OpenExtraOuputChannel method to remove a variable by reference

* Refs eProsima#2975 Debugging

* Refs eProsima#2975. Fix possible issue with buffer sizes.

* Refs eProsima#2975. Refactor ChannelResource Classes

* Refs eProsima#2975 Fix compilation issues with asio

* Refs eProsima#2975 Update include relationships

* Refs eProsima#2975. Fix compilation warning

* Refs eProsima#2975 Valgrind fixing

* Refs eProsima#2975 Valgrind fixes

* Refs eProsima#2975 Split in different header files the transports and their descriptors.

* Refs eProsima#2975 Fix issues on NetworkFactoryTests

* Refs eProsima#2975 TCPv6 updated

* Refs eProsima#2975 Added TCPv6Tests

* Refs eProsima#2975 Added TCPv6Tests

* Refs eProsima#2975 Network factory

* Refs eProsima#2975. Update XML unit tests with moc transports

* Refs eProsima#2975 Warnings fixed

* Refs eProsima#3076. Fix test issue with the test_updv4 transport

* Refs eProsima#3076. Fix compilation warnings on NetworkFactory Tests.

* Refs eProsima#3076 Fixed Warnings.

* Refs eProsima#3076. Fix compilation issues on Transport tests

* Refs eProsima#3076. Fill several methods of moc Receiver Resource

* Refs eProsima#3076 Fixing tests

* Refs eProsima#3076. Fix TCP tests on Windows

* Refs eProsima#3076. Apply memory fix to UPD transports

* Refs eProsima#3076. Adapt test on Blackbox to use the new UDP transport descriptors

* Refs eProsima#3076 Fixed IPv6 :D

* Refs eProsima#3076 Fixed misleading-indentation warnings.

* Refs eProsima#3076 Fixed lack of brackets

* Refs eProsima#3076 Fix compilation warnings with HAVE_SECURITY

* Refs eProsima#3076 Fix compilation warnings with HAVE_SECURITY

* Refs eProsima#3076 Fix compilation warnings on VS2013

* Refs eProsima#3076 Fix compilation warnings with HAVE_SECURITY

* Refs eProsima#3076 Jenkins fixed

* Refs eProsima#3076 Fixing Jenkins

* Refs eProsima#3076 Clang warnings.

* Refs eProsima#3076 Clang warnings.

* Refs eProsima#2084 Refactor TCP transports to unify the common code in a parent class.

* Refs eProsima#3084. Fix merge issue

* Refs eProsima#3076 Anonymous unions named to avoid clang warnings.

* Refs eProsima#3084. Create a base class to merge the common code of UDP transports

* Refs eProsima#3076 Fixed warning (unused define)

* Refs eProsima#3076 Fixed reconnection due to refactor.

* Refs eProsima#3076 Disable two tests on TCPv6 because they can't be executed over the same machine.

* eProsima#3076. Fix issue with security

* Refs eProsima#3076. Fix issue with security tests
Refactor UDPv4 transport to unify the ouput sockets management.

* Refs eProsima#3076. Refactor UDPv6 transport to unify the ouput sockets management.

* Refs eProsima#3084. Adapt the protocol creations for each TCP transport

* Refs eProsima#3084. Merge all the common code between UDPv4 and UDPv6 in UDPTransportInterface

* Refs eProsima#3084. Refactor the method "OpenAndBindOutputSockets" for UDPv4 and UDPv6

* Refs eProsima#3076. Update one method to work with VS2013

* Refs eProsima#3076. Fix an issue with the Log in VS2013

* Refs eProsima#3076 Warning pedantic ";"

* Refs eProsima#3076 Fixed Blackbox tests when terminating Log.

* Refs eProsima#3076. Adapt TCP sockets management for VS2013.

* Refs eProsima#3076. Adapt TCP sockets management for VS2013.

* Refs eProsima#3076. Update the fix for the Log system to work with VS2013

* Refs eProsima#3085 Fix small issue during the TCP unit tests

* Refs eProsima#3204. Fix an issue with a string copy in a method of UDP transports

* Refs eProsima#3265 Comment uncompleted code that make crashes with TCP connections

* Refs eProsima#3267. Implement some modifications from the merge request

* Refs eProsima#3267. Restore removed code to override operators with ProtocolVersion Struct

* Refs eProsima#3262. Fixing compilation errors introduced by rebase

* Refs eProsima#3262 Changes due to comments on GitHub

* Refs eProsima#3375. Refactor with new SocketTransportDescriptor

* Refs eProsima#3373 WIP Locator refactor

* Refs eProsima#3085 Fix small issue during the TCP unit tests

# Conflicts:
#	src/cpp/transport/TCPTransportInterface.cpp
#	test/unittest/transport/TCPv4Tests.cpp

* Refs eProsima#3229 Fixed new GCC8 warnings

# Conflicts:
#	src/cpp/transport/tcp/RTCPMessageManager.cpp

* Refs eProsima#3265 Comment uncompleted code that make crashes with TCP connections

# Conflicts:
#	include/fastrtps/transport/TCPChannelResource.h
#	src/cpp/transport/TCPTransportInterface.cpp

* Refs eProsima#3265 Fixes warning with GCC8

# Conflicts:
#	examples/C++/Benchmark/BenchmarkSubscriber.h

* Refs eProsima#3231 Fixes

# Conflicts:
#	examples/C++/Benchmark/BenchmarkSubscriber.cpp
#	src/cpp/rtps/participant/RTPSParticipantImpl.cpp

* Merge branch 'DynamicTypes1.2' of https://192.168.1.4/LuisGasco/fastrtps into DynamicTypes1.2

# Conflicts:
#	src/cpp/rtps/participant/RTPSParticipantImpl.cpp

* Refs eProsima#3268 WIP Traces for Shapes Demo

# Conflicts:
#	src/cpp/rtps/participant/RTPSParticipantImpl.cpp

* Refs eProsima#3268 Logical Ports automatically calculated and added base negotiation on TCP if user left them as 0.

* Refs eProsima#3268 Changed logical ports's logic to match UDP domain's port logic.

# Conflicts:
#	examples/C++/HelloWorldExampleTCP/HelloWorldPublisher.cpp
#	examples/C++/HelloWorldExampleTCP/HelloWorldSubscriber.cpp
#	examples/C++/HelloWorldExampleTCP/HelloWorld_main.cpp
#	src/cpp/rtps/participant/RTPSParticipantImpl.cpp

* Refs eProsima#3274 Added Blackbox tests for TCP and Domain's ports logic.
Added timestamp to Stdout Log

* Refs eProsima#3371 TCP Commits added again (lost because they were added on dynamic types branch).

* eProsima#3371 TCP cherry picking verification and testing

* Refs eProsima#3396 WIP Refactor moving Locator configuration to transports.

* Refs eProsima#3396 RTPSParticpantImpl refactor. Now transports are responsible of their locators.

* Refs eProsima#3396 Iterate through all available transport and don't stop on first compatible.

* Refs eProsima#3378. Input channels have pointer to new TransportReceiverInterface

* Refs eProsima#3378. Updating tests

* Refs eProsima#3378. Fixed move constructor of ReceiverResource.

* Refs eProsima#3378. Fixing segfault on TCPChannelResource dtor

* Refs eProsima#3378 Fixed warning and memory leak.

* Refs eProsima#3378 Fixed compilation issues on Windows. FastCDR now links dynamically on transport tests. Tens of warning happens after include GTEST_LINKED_AS_SHARED...

* Refs eProsima#3378 Remove unnecessary macro that breaks the compilation on Windows

* Refs eProsima#3378 Fixed tests and discovery in TCP due to refactor.

* Refs eProsima#3378 Refined blackbox tests.

* Refs eProsima#3378. Minor improvements.

* Refs eProsima#3378. Fixing errors on tests with security enabled.

* Refs eProsima#3378. Fixing valgrind errors.

* Refs eProsima#3378. Fixing compile error on example.

* Refs eProsima#3378. Removing unnecessary buffer on MessageReceiver.

* Refs eProsima#3378 Fixing valgrind issues.

* Refs eProsima#3378 Fixing valgrind issues.

* Refs eProsima#3371. Refactor IPLocator::createLocator to avoid allocation

* Refs eProsima#3413.
* Compare full address on compareAddressAndPhysicalPort
* Removed metadata_logical_port
* Fixed possible race condition on TCPChannelResource

* Refs eProsima#3413 WIP: Unified ChannelResource lists. Removed some unused/trivial lists. Changed Receive method to return the remote locator instead only the destination logical port.
TODO:
Currrently close channels must be broken, it didn't check if there are more locators in the map to the same channel.
LogicalPorts managements can be broken as well.

* Refs eProsima#3413 WIP: Removed mBoundOutputSockets map and uses mChannelResources instead.
TODO:
Currrently close channels must be broken, it didn't check if there are more locators in the map to the same channel.
LogicalPorts managements can be broken as well.

* Refs eProsima#3413 WIP: Changed behaviour of OpenOutputChannel and removed ReceiversResources map from channel resources.
TODO:
Currrently close channels must be broken, it didn't check if there are more locators in the map to the same channel.
LogicalPorts managements can be broken as well.

* Refs eProsima#3413 WIP: LogicalPorts management fixed.
TODO:
Currrently close channels must be broken, it didn't check if there are more locators in the map to the same channel.

* Refs eProsima#3413. Acceptor is not created in OpenInputChannel

* Refs eProsima#3413. [WIP] Refactor of TCPConnector

* Refs eProsima#3413. TCP doesn't AddDefaultOutputLocator anymore. IsOutputChannelOpen now checks if the asked logical port was added to the existing channel resource.

* Refs eProsima#3413. BindConnection recovered

* Refs eProsima#3413. Merge completed.

* Refs eProsima#3413. TCPConnector responsibility changed to TCPChannelResource

* Refs eProsima#3413. Fixed gcc errors and added new ChannelResource methods.

* Refs eProsima#3413. Lost connection is retried. TODO: Set all logical ports as pending when connection is lost

* Refs eProsima#3413. LogicalPort management changed to reflect new design.

* Refs eProsima#3413. Added CopyPendingPortsFrom method and all opened ports are marked as pending on disconnect.

* Refs eProsima#3413. Informing channel resources of closed input port

* Refs eProsima#3413. Reconnection replaces channel resource on map.

* Refs eProsima#3413. Physical port at fill methods

* Refs eProsima#3413. Fixing condition on ConnectionLost

* Refs eProsima#3413. Channel resource fully owns the physical socket. Some other minor changes and bugfixes.

* Refs eProsima#3413. Don't sent close logical ports if connection isn't bound. Mutex on mReceiverResources. Clean unused methods.

* Refs eProsima#3413. Fixed double free.

* Refs eProsima#3413. Fixed double free due to bug.

* Refs eProsima#3413. Wait for negotiation restored.

* Refs eProsima#3413. Fixed warnings.

* Refs eProsima#3413. Minor improvements

* Refs eProsima#3413. Allow TCP blackbox tests to run in parallel

* Refs eProsima#3413. Each transport adds its own metatraffic locators.

* Refs eProsima#3413. Fixed unused parameters warnings.

* Refs eProsima#3413. Fix bug setting logical default port for metatraffic.

* Refs eProsima#3413. Each transport adds its own default unicast locators.

* Refs eProsima#3413. New HelloWorld TCP Configuration.

* Refs eProsima#3713. Fixing TCP BlackBox tests.

* Refs eProsima#3713. Fixing TCP std::remove bad use.

* Refs eProsima#3413. Fixing errors detected by unit tests.

* Refs eProsima#3413. Fixing valgrind errors

* Refs eProsima#3413. Picked changes from develop

* Refs eProsima#3413. Fixed valgrind errors.

* Refs eProsima#3413. Fixed more valgrind errors.

* Refs eProsima#3413. Removed unused arguments.

* Refs eProsima#3413. Removed warnings.

* Refs eProsima#3413. Improve tcp blackbox tests.

* Refs eProsima#3413. Added retries if not logical port openend.

* Refs eProsima#3413. Removed unnecessary sleep.
  • Loading branch information
JuanCarlos-Arce authored and richiware committed Oct 11, 2018
1 parent a02c069 commit cf247a5
Show file tree
Hide file tree
Showing 214 changed files with 21,336 additions and 3,469 deletions.
115 changes: 115 additions & 0 deletions examples/C++/Benchmark/Benchmark.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// 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 Benchmark.cpp
* This source file contains the definition of the described types in the IDL file.
*
* This file was generated by the tool gen.
*/

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "Benchmark.h"

#include <fastcdr/Cdr.h>

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

#include <utility>

BenchMark::BenchMark()
{
m_index = 0;
}

BenchMark::~BenchMark()
{
}

BenchMark::BenchMark(const BenchMark &x)
{
m_index = x.m_index;
}

BenchMark::BenchMark(BenchMark &&x)
{
m_index = x.m_index;
}

BenchMark& BenchMark::operator=(const BenchMark &x)
{
m_index = x.m_index;

return *this;
}

BenchMark& BenchMark::operator=(BenchMark &&x)
{
m_index = x.m_index;

return *this;
}

size_t BenchMark::getMaxCdrSerializedSize(size_t current_alignment)
{
size_t initial_alignment = current_alignment;

current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


return current_alignment - initial_alignment;
}

size_t BenchMark::getCdrSerializedSize(const BenchMark&, size_t current_alignment)
{
size_t initial_alignment = current_alignment;

current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


return current_alignment - initial_alignment;
}

void BenchMark::serialize(eprosima::fastcdr::Cdr &scdr) const
{
scdr << m_index;
}

void BenchMark::deserialize(eprosima::fastcdr::Cdr &dcdr)
{
dcdr >> m_index;
}

size_t BenchMark::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
size_t current_align = current_alignment;


return current_align;
}

bool BenchMark::isKeyDefined()
{
return false;
}

void BenchMark::serializeKey(eprosima::fastcdr::Cdr &) const
{

}
187 changes: 187 additions & 0 deletions examples/C++/Benchmark/Benchmark.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// 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 Benchmark.h
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool gen.
*/

#ifndef _Benchmark_H_
#define _Benchmark_H_

// TODO Poner en el contexto.

#include <stdint.h>
#include <array>
#include <string>
#include <vector>

#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
#define eProsima_user_DllExport __declspec( dllexport )
#else
#define eProsima_user_DllExport
#endif
#else
#define eProsima_user_DllExport
#endif

#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
#if defined(Benchmark_SOURCE)
#define Benchmark_DllAPI __declspec( dllexport )
#else
#define Benchmark_DllAPI __declspec( dllimport )
#endif // Benchmark_SOURCE
#else
#define Benchmark_DllAPI
#endif
#else
#define Benchmark_DllAPI
#endif // _WIN32

namespace eprosima
{
namespace fastcdr
{
class Cdr;
}
}

/*!
* @brief This class represents the structure BenchMark defined by the user in the IDL file.
* @ingroup BENCHMARK
*/
class BenchMark
{
public:

/*!
* @brief Default constructor.
*/
eProsima_user_DllExport BenchMark();

/*!
* @brief Default destructor.
*/
eProsima_user_DllExport ~BenchMark();

/*!
* @brief Copy constructor.
* @param x Reference to the object BenchMark that will be copied.
*/
eProsima_user_DllExport BenchMark(const BenchMark &x);

/*!
* @brief Move constructor.
* @param x Reference to the object BenchMark that will be copied.
*/
eProsima_user_DllExport BenchMark(BenchMark &&x);

/*!
* @brief Copy assignment.
* @param x Reference to the object BenchMark that will be copied.
*/
eProsima_user_DllExport BenchMark& operator=(const BenchMark &x);

/*!
* @brief Move assignment.
* @param x Reference to the object BenchMark that will be copied.
*/
eProsima_user_DllExport BenchMark& operator=(BenchMark &&x);

/*!
* @brief This function sets a value in member index
* @param _index New value for member index
*/
inline eProsima_user_DllExport void index(uint32_t _index)
{
m_index = _index;
}

/*!
* @brief This function returns the value of member index
* @return Value of member index
*/
inline eProsima_user_DllExport uint32_t index() const
{
return m_index;
}

/*!
* @brief This function returns a reference to member index
* @return Reference to member index
*/
inline eProsima_user_DllExport uint32_t& index()
{
return m_index;
}

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
* @param current_alignment Buffer alignment.
* @return Serialized size.
*/
eProsima_user_DllExport static size_t getCdrSerializedSize(const BenchMark& data, size_t current_alignment = 0);


/*!
* @brief This function serializes an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const;

/*!
* @brief This function deserializes an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr);



/*!
* @brief This function returns the maximum serialized size of the Key of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);

/*!
* @brief This function tells you if the Key has been defined for this type
*/
eProsima_user_DllExport static bool isKeyDefined();

/*!
* @brief This function serializes the key members of an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const;

private:
uint32_t m_index;
};

#endif // _Benchmark_H_
4 changes: 4 additions & 0 deletions examples/C++/Benchmark/Benchmark.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
struct BenchMark
{
unsigned long index;
};
Loading

0 comments on commit cf247a5

Please sign in to comment.