Skip to content

Commit

Permalink
Merge branch 'master' into github_master
Browse files Browse the repository at this point in the history
  • Loading branch information
richiprosima committed Jun 22, 2016
2 parents 3cf7996 + 7380732 commit a742bdb
Show file tree
Hide file tree
Showing 213 changed files with 11,919 additions and 2,284 deletions.
114 changes: 0 additions & 114 deletions .ycm_extra_conf.py

This file was deleted.

12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if(MSVC OR MSVC_IDE)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS] /W4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas")
Expand Down Expand Up @@ -146,6 +146,16 @@ if(EPROSIMA_INSTALLER)
set(EPROSIMA_BUILD ON)
endif()


###############################################################################
# Internal debug messages
###############################################################################

option(INTERNAL_DEBUG "Activate developer debug messages" OFF)
if(EPROSIMA_BUILD AND NOT EPROSIMA_INSTALLER_MINION)
set(INTERNAL_DEBUG ON)
endif()

###############################################################################
# Performance tests
###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion CTestJenkins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(CTEST_CMAKE_GENERATOR "${JENKINS_GENERATOR}")
set(CTEST_BUILD_OPTIONS "${JENKINS_BUILD_OPTIONS}")
set(CTEST_BUILD_CONFIGURATION "${JENKINS_BUILD_CONFIGURATION}")

set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${CTEST_MEMORYCHECK_COMMAND_OPTIONS} -q --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --xml=yes --xml-file=test_%p_memcheck.xml \"--suppressions=${CTEST_SOURCE_DIRECTORY}/valgrind.supp\"")
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${CTEST_MEMORYCHECK_COMMAND_OPTIONS} --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --xml=yes --xml-file=test_%p_memcheck.xml \"--suppressions=${CTEST_SOURCE_DIRECTORY}/valgrind.supp\"")

set(CTEST_COVERAGE_CXX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-fprofile-arcs -ftest-coverage")
set(CTEST_COVERAGE_EXE_LD_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage")
Expand Down
4 changes: 2 additions & 2 deletions cmake/dev/boost_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ macro(install_boost FILETYPE)
install(DIRECTORY ${BOOST_LIBRARYDIR_NORMALIZE}/
DESTINATION ${BIN_INSTALL_DIR}${DIR_EXTENSION}
COMPONENT libraries_${MSVC_ARCH}
CONFIGURATIONS Release
CONFIGURATIONS Release RelWithDebInfo
FILES_MATCHING
PATTERN "boost_${arg_}-${BOOST_ARCH}-mt*.dll"
PATTERN "boost_${arg_}-${BOOST_ARCH}-mt-gd*.dll" EXCLUDE
Expand All @@ -104,7 +104,7 @@ macro(install_boost FILETYPE)
install(DIRECTORY ${BOOST_LIBRARYDIR_NORMALIZE}/
DESTINATION ${LIB_INSTALL_DIR}${DIR_EXTENSION}
COMPONENT libraries_${MSVC_ARCH}
CONFIGURATIONS Release
CONFIGURATIONS Release RelWithDebInfo
FILES_MATCHING
PATTERN "boost_${arg_}-${BOOST_ARCH}-mt*.lib"
PATTERN "boost_${arg_}-${BOOST_ARCH}-mt-gd*.lib" EXCLUDE
Expand Down
11 changes: 9 additions & 2 deletions cmake/dev/compile_example.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
macro(compile_example example example_directory)
if(NOT ((EPROSIMA_INSTALLER OR EPROSIMA_INSTALLER_MINION) AND (MSVC OR MSVC_IDE)))

# Check if example use boost
set(USE_BOOST_ "")
foreach(arg ${ARGN})
if("${arg}" STREQUAL "USE_BOOST")
set(USE_BOOST_ "-DBOOST_ROOT:PATH=${BOOST_ROOT}" "-DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}")
endif()
endforeach()

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config/fastrtpsConfig.cmake
"include(\"${PROJECT_BINARY_DIR}/cmake/config/fastrtpsTargets.cmake\")\n"
)
Expand All @@ -24,8 +32,7 @@ macro(compile_example example example_directory)
set(${example}_CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/config|${CMAKE_PREFIX_PATH_}"
"-DBOOST_ROOT:PATH=${BOOST_ROOT}"
"-DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}"
${USE_BOOST_}
"-DBIN_INSTALL_DIR:PATH=${BIN_INSTALL_DIR}")
list(APPEND ${example}_CMAKE_ARGS LIST_SEPARATOR "|")

Expand Down
4 changes: 0 additions & 4 deletions cmake/packaging/linux/autotools_generator.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ macro(generate_public_headers_for_autotools)
foreach(@PROJECT_NAME@_PUBLIC_HEADER ${@PROJECT_NAME@_PUBLIC_HEADERS_TMP})
set(@PROJECT_NAME@_PUBLIC_HEADERS_AUTOTOOLS "${@PROJECT_NAME@_PUBLIC_HEADERS_AUTOTOOLS} ${@PROJECT_NAME@_PUBLIC_HEADER}")
endforeach()
file(GLOB_RECURSE @PROJECT_NAME@_PUBLIC_HEADERS_TMP RELATIVE ${directory} ${directory}/*.hpp)
foreach(@PROJECT_NAME@_PUBLIC_HEADER ${@PROJECT_NAME@_PUBLIC_HEADERS_TMP})
set(@PROJECT_NAME@_PUBLIC_HEADERS_AUTOTOOLS "${@PROJECT_NAME@_PUBLIC_HEADERS_AUTOTOOLS} ${@PROJECT_NAME@_PUBLIC_HEADER}")
endforeach()
endforeach()

set(@PROJECT_NAME@_PUBLIC_HEADERS_FILES_TMP @@PROJECT_NAME@_PUBLIC_HEADERS_FILES@)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Define variables for the FastRTPS version number.
#
m4_define([version_major],[1])
m4_define([version_minor],[1])
m4_define([version_minor],[2])
m4_define([version_micro],[0])

AC_INIT([fastrtps], [version_major.version_minor.version_micro], [[email protected]], [eProsima FastRTPS], [http://eprosima.com/])
Expand Down
67 changes: 67 additions & 0 deletions doc/README_newFeatures.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/********/
Internal ePRosima doc - New features in this branch
/********/

--- Query the number of Publishers and Subscribers listening to a topic

Participant has 2 new API functions, get_no_publishers and get_no_subscribers
These functions a target_topic as argument and return the number of pubs/subs
that exist on a participant that are assigned to the specified topic

--- Possibility to attach a secondary ReaderListener to SimpleEDP RTPSReaders

A new Participant API function, getEDPReaders, allows the user to get pointer
to the two stateful readers the EDP spawns. From here it is possible to access
the ReaderListener, which has been modified.

The ReaderListeners used in the EDP Readers inherit from a class that allows a
slave ReaderListener to be attached. This way a user can attach his own
ReaderListener so that its callback is executed whenever the default EDP
callback is invoked.

The result of this is that there is a path from user land to the EDP
RTPSReaders, then to the modified ReaderListener and from there we can
attach a user defined ReaderListener with its own callbacks.

--- Examples:

---Attach a slave ReaderListener:
- The target slave ReaderListener inherits from ReaderListener

class gettopicnamesandtypesReaderListener:public ReaderListener
{
public:
std::mutex mapmutex;
std::map<std::string,std::set<std::string>> topicNtypes;
void onNewCacheChangeAdded(RTPSReader* reader, const CacheChange_t* const change_in){
CacheChange_t* change = (CacheChange_t*) change_in;
if(change->kind == ALIVE){
WriterProxyData proxyData;
CDRMessage_t tempMsg;
tempMsg.msg_endian = change->serializedPayload.encapsulation == PL_CDR_BE ? BIGEND:LITTLEEND;
tempMsg.length = change->serializedPayload.length;
memcpy(tempMsg.buffer,change->serializedPayload.data,tempMsg.length);
if(proxyData.readFromCDRMessage(&tempMsg)){
mapmutex.lock();
topicNtypes[proxyData.m_topicName].insert(proxyData.m_typeName);
mapmutex.unlock();
}
}
}
};

- Insertion from within application code:

std::pair<StatefulReader*,StatefulReader*> EDP_Readers = my_participant->getEDPReaders();
InfectableReaderListener* target = dynamic_cast<InfectableReaderListener*>(EDP_Readers.second->getListener());
target->attachListener(slave_listener);
result = target->hasReaderAttached();
ASSERT_EQ(result,true);
slave_target = dynamic_cast<gettopicnamesandtypesReaderListener*>(target->getAttachedListener());


--- Poll the no of Pubs and Subs on topic "TEST_NAME"

std::string my_topicName("TEST_NAME");
int no_pubs = my_participant->get_no_publishers(my_topicName.cstr());

Binary file modified doc/pdf/FASTRTPSGEN - User Manual.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - Installation Manual.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - Latency Test.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - Throughput Test.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - User Manual.odt
Binary file not shown.
Empty file.
2 changes: 1 addition & 1 deletion examples/C++/Filtering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ message(STATUS "Configuring Filtering example...")
file(GLOB DEADLINEQOS_EXAMPLE_SOURCES "*.cxx")

add_executable(FilteringExample ${DEADLINEQOS_EXAMPLE_SOURCES})
target_include_directories(FilteringExample PRIVATE ${Boost_INCLUDE_DIR})
target_include_directories(FilteringExample PRIVATE)
target_link_libraries(FilteringExample fastrtps fastcdr ${Boost_LIBRARIES})
install(TARGETS FilteringExample
RUNTIME DESTINATION examples/C++/FilteringExample/${BIN_INSTALL_DIR}
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/Filtering/FilteringExamplePublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class FilteringExamplePublisher
void run();
private:
Participant *mp_participant;
Publisher *mp_slow_publisher;
Publisher *mp_fast_publisher;
Publisher *mp_slow_publisher;

class PubListener : public PublisherListener
{
Expand Down
2 changes: 2 additions & 0 deletions examples/C++/FlowControlExample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin
output
42 changes: 42 additions & 0 deletions examples/C++/FlowControlExample/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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.

cmake_minimum_required(VERSION 2.8.12)
project("FlowControlExample")

# Find requirements
find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)

# Set C++11
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
check_cxx_compiler_flag(--std=c++11 SUPPORTS_CXX11)
if(SUPPORTS_CXX11)
add_compile_options(--std=c++11)
else()
message(FATAL_ERROR "Compiler doesn't support C++11")
endif()
endif()

message(STATUS "Configuring Flow Control example...")
file(GLOB FLOWCONTROL_EXAMPLE_SOURCES_CXX "*.cxx")
file(GLOB FLOWCONTROL_EXAMPLE_SOURCES_CPP "*.cpp")

add_executable(FlowControlExample ${FLOWCONTROL_EXAMPLE_SOURCES_CXX} ${FLOWCONTROL_EXAMPLE_SOURCES_CPP})
target_include_directories(FlowControlExample PRIVATE)
target_link_libraries(FlowControlExample fastrtps fastcdr ${Boost_LIBRARIES})
install(TARGETS FlowControlExample
RUNTIME DESTINATION examples/C++/FlowControlExample/${BIN_INSTALL_DIR})
Loading

0 comments on commit a742bdb

Please sign in to comment.