diff --git a/.gitignore b/.gitignore index 4d7b589e..b501ac21 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ objs/ Debug/ Release/ ipch/ -Generated/ # Compiled source # ################### diff --git a/ChocolateFactory/ExampleCode/make/Makefile.common b/ChocolateFactory/ExampleCode/make/Makefile.common deleted file mode 100644 index d709fe75..00000000 --- a/ChocolateFactory/ExampleCode/make/Makefile.common +++ /dev/null @@ -1,194 +0,0 @@ -############################################################################### -## (c) Copyright, Real-Time Innovations, All rights reserved. ## -## ## -## Permission to modify and use for internal purposes granted. ## -## This software is provided "as is", without warranty, express or implied. ## -## ## -############################################################################### - -# This Makefile contains the common rules to build for all the architectures. -# It is included from the architecture-specific Makefile. -# This Makefile requires the following variables: -# - ARCH: Architecture to build (for example i86Linux2.6gcc4.4.5) -# -# Optional variables: -# - DEBUG: If set to '1', it turns on debugging information -# - SHAREDLIB: If set to '1', shared libraries will be used -# - CXX: compiler name. -# - CXXFLAGS: compiler flags: will be appended to $CXX command-line -# - CXXLD: linker name. -# - CXXLDFLAGS: linker flags: will be inserted at the beginning of CXXLD cmdline -# - SYSLIBS: additional system libraries to append to the CXXLD command-line - -############################################################################### -# Ensure this Makefile is invoked with the right variable set -############################################################################### -ifeq ($(ARCH), ) -all: - @echo "***************************************************************" - @echo "You cannot use this Makefile directly, instead use the" - @echo "architecture-specific Makefile. For example:" - @echo " gmake -f make/Makefile.i86Linux2.6gcc4.4.5" - @echo "***************************************************************" - @false -else -############################################################################### -# Ensure $NDDSHOME is defined -############################################################################### -ifeq ($(NDDSHOME), ) -all: - @echo "***************************************************************" - @echo "The environment variable 'NDDSHOME' is not set!" - @echo "To use this makefile you need to set NDDSHOME to the directory" - @echo "where you have RTI Connext installed." - @echo "***************************************************************" - @false -endif -endif - - -# Define the sources and NDDS search path -INCLUDES = -Isrc/CommonInfrastructure -Isrc/Generated -I$(NDDSHOME)/include \ - -I$(NDDSHOME)/include/ndds - -############################################################################### -# Modify build flags for debug/release -############################################################################### -ifeq ($(DEBUG),1) -CXXFLAGS += -g -O0 -ifeq ($(SHAREDLIB),1) -NDDSLIBS = -lnddscppd -lnddscd -lnddscored -else -NDDSLIBS = -lnddscppzd -lnddsczd -lnddscorezd -endif -else -CXXFLAGS += -O2 -ifeq ($(SHAREDLIB),1) -NDDSLIBS = -lnddscpp -lnddsc -lnddscore -else -NDDSLIBS = -lnddscppz -lnddscz -lnddscorez -endif -endif - -LIBS = -L$(NDDSHOME)/lib/$(ARCH) $(NDDSLIBS) $(SYSLIBS) -STATION_CONTROLLERLIBS = $(LIBS) - -COMMONSRC = src/CommonInfrastructure/DDSCommunicator.cxx \ - src/CommonInfrastructure/OSAPI.cxx \ - src/CommonInfrastructure/ChocolateLotStateEntities.cxx \ - src/CommonInfrastructure/EnumPrintHelpers.cxx \ - -COMMON_H = src/CommonInfrastructure/DDSCommunicator.h \ - src/CommonInfrastructure/OSAPI.h \ - src/CommonInfrastructure/DDSTypeWrapper.h \ - src/CommonInfrastructure/ChocolateLotStateEntities.h \ - src/CommonInfrastructure/EnumPrintHelpers.h \ - -SOURCES_IDL = src/Generated/ChocolateFactory.cxx \ - src/Generated/ChocolateFactoryPlugin.cxx \ - src/Generated/ChocolateFactorySupport.cxx - -MESSRC = src/ManufacturingExecutionSystem/MESInterface.cxx \ - src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.cxx - -RECIPESRC = src/RecipeGenerator/RecipePublisherInterface.cxx \ - src/RecipeGenerator/RecipeGenerator.cxx - -STATION_CONTROLLERSRC = src/StationControllerInterface.cxx \ - src/StationController.cxx - -HEADERS_IDL = src/Generated/ChocolateFactory.h \ - src/Generated/ChocolateFactoryPlugin.h \ - src/Generated/ChocolateFactorySupport.h - -DIRECTORIES = objs.dir objs/$(ARCH).dir objs/$(ARCH)/ManufacturingExecutionSystem.dir \ - objs/$(ARCH)/RecipeGenerator.dir objs/$(ARCH)/StationController.dir \ - objs/$(ARCH)/Common.dir -SOURCES_NODIR = $(notdir $(COMMONSRC)) $(notdir $(SOURCES_IDL)) -COMMONOBJS = $(SOURCES_NODIR:%.cxx=objs/$(ARCH)/Common/%.o) -EXEC = ManufacturingExecutionSystem - -MESSRC_NODIR = $(notdir $(MESSRC)) -MESOBJS = $(MESSRC_NODIR:%.cxx=objs/$(ARCH)/ManufacturingExecutionSystem/%.o) $(COMMONOBJS) - -RECIPESRC_NODIR = $(notdir $(RECIPESRC)) -RECIPEOBJS = $(RECIPESRC_NODIR:%.cxx=objs/$(ARCH)/RecipeGenerator/%.o) $(COMMONOBJS) -RECIPEEXEC = RecipeGenerator - -STATION_CONTROLLERSRC_NODIR = $(notdir $(STATION_CONTROLLERSRC)) -STATION_CONTROLLEROBJS = $(STATION_CONTROLLERSRC_NODIR:%.cxx=objs/$(ARCH)/StationController/%.o) $(COMMONOBJS) -STATION_CONTROLLEREXEC = StationController - -############################################################################### -# Build Rules -############################################################################### -$(ARCH): ManufacturingExecutionSystem RecipeGenerator StationController - -ManufacturingExecutionSystem: $(DIRECTORIES) $(MESOBJS) $(EXEC:%=objs/$(ARCH)/ManufacturingExecutionSystem/%.o) \ - $(EXEC:%=objs/$(ARCH)/ManufacturingExecutionSystem/%.out) - -RecipeGenerator: $(RECIPEOBJS) $(@:%=objs/$(ARCH)/RecipeGenerator/%.o) \ - $(RECIPEEXEC:%=objs/$(ARCH)/RecipeGenerator/%.out) - -StationController: $(STATION_CONTROLLEROBJS) $(@:%=objs/$(ARCH)/StationController/%.o) \ - $(STATION_CONTROLLEREXEC:%=objs/$(ARCH)/StationController/%.out) - -# Building the manufacturing execution system application -objs/$(ARCH)/ManufacturingExecutionSystem/%.out: objs/$(ARCH)/ManufacturingExecutionSystem/%.o - $(CXXLD) $(CXXLDFLAGS) -o $(@:%.out=%) $(MESOBJS) $(LIBS) - -# Building the recipe generator application -objs/$(ARCH)/RecipeGenerator/%.out: objs/$(ARCH)/RecipeGenerator/%.o - $(CXXLD) $(CXXLDFLAGS) -o $(@:%.out=%) $(RECIPEOBJS) $(LIBS) - -# Building the station controller application -objs/$(ARCH)/StationController/%.out: objs/$(ARCH)/StationController/%.o - $(CXXLD) $(CXXLDFLAGS) -o $(@:%.out=%) $(STATION_CONTROLLEROBJS) $(STATION_CONTROLLERLIBS) - - -objs/$(ARCH)/Common/%.o: src/CommonInfrastructure/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/Common/%.o: src/Generated/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/ManufacturingExecutionSystem/%.o: src/ManufacturingExecutionSystem/%.cxx $(COMMON_H) $(HEADERS_IDL) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/RecipeGenerator/%.o: src/RecipeGenerator/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/StationController/%.o: src/StationController/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -# Rule to rebuild the generated files when the .idl file change -$(SOURCES_IDL) $(HEADERS_IDL): src/Idl/ChocolateFactory.idl - @mkdir -p src/Generated -ifeq ($(OS_ARCH), i86Win32) - call $(NDDSHOME)/scripts/rtiddsgen.bat -d src/idl src/ChocolateFactory.idl -replace -language C++ -else - $(NDDSHOME)/scripts/rtiddsgen -namespace -d src/Generated src/Idl/ChocolateFactory.idl -replace -language C++ -endif - -generate: $(SOURCES_IDL) $(HEADERS_IDL) - -# Here is how we create those subdirectories automatically. -%.dir : - @echo "Checking directory $*" - @if [ ! -d $* ]; then \ - echo "Making directory $*"; \ - mkdir -p $* ; \ - fi; - -############################################################################### -# Clean target: removes the objs dir -############################################################################### -clean: - @rm -Rf objs/$(ARCH) - @echo "Successfully deleted object and executable files for architecture $(ARCH)" - @echo "To delete ALL the architectures and any generated file use target 'veryclean'" - -veryclean: - @rm -Rf objs - @rm -Rf src/idl - @echo "Deleted all executables, objects and generated files" diff --git a/ChocolateFactory/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 b/ChocolateFactory/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 deleted file mode 100644 index 94eb1523..00000000 --- a/ChocolateFactory/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################### -## (c) Copyright, Real-Time Innovations, All rights reserved. ## -## ## -## Permission to modify and use for internal purposes granted. ## -## This software is provided "as is", without warranty, express or implied. ## -## ## -############################################################################### - -# Note: -# - To use this Makefile, you must have the 'NDDSHOME' environment variable -# set to the location of RTI Connext. -# -# - You need to invoke the make command from the root directory of this example. -# -# - To enable debugging information, set the Makefile variable 'DEBUG' to '1'. -# Example: -# make -f make/Makefile.i86Linux2.6gcc4.4.5 DEBUG=1 - - -# Defines required Make variables. They will be used in the Makefile.common -# to define the rules to define the build process for this application. -ARCH=i86Linux2.6gcc4.4.5 - -CXX = g++ -CXXFLAGS = -DRTI_UNIX -DRTI_LINUX -m32 -CXXLD = g++ -CXXLDFLAGS = -m32 -static-libgcc -SYSLIBS = -ldl -lnsl -lm -lpthread -lrt - -# The rest of the rules are in the 'Makefile.common' -include make/Makefile.common - diff --git a/ChocolateFactory/ExampleCode/scripts/AllStationControllers.bat b/ChocolateFactory/ExampleCode/scripts/AllStationControllers.bat deleted file mode 100755 index afe67127..00000000 --- a/ChocolateFactory/ExampleCode/scripts/AllStationControllers.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -setlocal - -set dir=%~dp0 -set executable_name=StationController - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%PATH% - -cd %dir%\..\win32\Release\i86Win32VS2010\ - -start %executable_name% --controller-type 1 %* -start %executable_name% --controller-type 2 %* -start %executable_name% --controller-type 3 %* -start %executable_name% --controller-type 4 %* -start %executable_name% --controller-type 5 %* diff --git a/ChocolateFactory/ExampleCode/scripts/AllStationControllers.sh b/ChocolateFactory/ExampleCode/scripts/AllStationControllers.sh deleted file mode 100755 index 84e7a2e5..00000000 --- a/ChocolateFactory/ExampleCode/scripts/AllStationControllers.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="StationController" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/StationController - -if [ -f $bin_dir/$executable_name ] -then - cd $bin_dir - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH - gnome-terminal -x bash -c "./$executable_name --controller-type 1 $*" - gnome-terminal -x bash -c "./$executable_name --controller-type 2 $*" - gnome-terminal -x bash -c "./$executable_name --controller-type 3 $*" - gnome-terminal -x bash -c "./$executable_name --controller-type 4 $*" - gnome-terminal -x bash -c "./$executable_name --controller-type 5 $*" -else - echo "***************************************************************" - echo $executable_name executable does not exist in: - echo $bin_dir - echo "" - echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" - echo "***************************************************************" -fi diff --git a/ChocolateFactory/ExampleCode/scripts/Build.pl b/ChocolateFactory/ExampleCode/scripts/Build.pl new file mode 100644 index 00000000..82d5f5f7 --- /dev/null +++ b/ChocolateFactory/ExampleCode/scripts/Build.pl @@ -0,0 +1,116 @@ +################################################################################ +# (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. +# RTI grants Licensee a license to use, modify, compile, and create derivative +# works of the Software. Licensee has the right to distribute object form only +# for use with RTI products. The Software is provided "as is", with no warranty +# of any type, including any warranty for fitness for any purpose. RTI is under +# no obligation to maintain or support the Software. RTI shall not be liable +# for any incidental or consequential damages arising out of the use or +# inability to use the software. +################################################################################ + +#!C:/Perl64/bin/perl.exe -w + +use Cwd; + +# The first command prompt argument is the directory to check +$ARCHITECTURE = $ARGV[0]; + +if ($ARCHITECTURE eq "") { + print "ERROR: You have to write an architecture to run this script, e.g.:\n"; + print "\tperl ./scripts/Build.pl i86Win32VS2010\n"; + exit(-1); +} +if (!defined $ENV{'NDDSHOME'}) { + + print "ERROR: You have to set NDDSHOME environment variable\n"; + exit(-1); +} +system "cmake -H./src -B./projects -DARCHITECTURE=" . $ARCHITECTURE; +if ( $? != 0 ) { + print "ERROR trying to execute cmake\n"; + exit(1); +} + +# $OS is the operating system +$OS = $^O; + +# if the operating system is windows, then we will use the msbuild compiler, +# else will use make +if ($OS =~ /[\s\S]*?Win[\s\S]*?/) { + system "msbuild ./projects/ChocolateFactory.sln"; + if ( $? != 0 ) { + print "ERROR compiling ./projects/ChocolateFactory.sln example\n"; + exit(1); + } + create_running_scripts("./scripts/ChocolateFactory_windows.txt", + "StationController", $ARCHITECTURE, "StationController"); + create_running_scripts("./scripts/ChocolateFactory_windows.txt", + "RecipeGenerator", $ARCHITECTURE, "RecipeGenerator"); + create_running_scripts("./scripts/ChocolateFactory_windows.txt", + "ManufacturingExecutionSystem", $ARCHITECTURE, "MES"); + create_running_scripts("./scripts/ChocolateFactory_windows.txt", + "StationController", $ARCHITECTURE, "AllStationController"); + print "\nCreated running scripts\n"; +} elsif ($OS eq "linux") { + chdir "./projects"; + system "make"; + if ( $? != 0 ) { + print "ERROR compiling ChocolateFactory example\n"; + exit(1); + } + chdir ".."; + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "StationController", $ARCHITECTURE, "StationController"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "RecipeGenerator", $ARCHITECTURE, "RecipeGenerator"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "ManufacturingExecutionSystem", $ARCHITECTURE, "MES"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "StationController", $ARCHITECTURE, "AllStationController"); + print "\nCreated running scripts\n"; +} elsif ($OS eq "darwin") { + chdir "./projects"; + system "make"; + if ( $? != 0 ) { + print "ERROR compiling ChocolateFactory example\n"; + exit(1); + } + chdir ".."; + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "StationController", $ARCHITECTURE, "StationController"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "RecipeGenerator", $ARCHITECTURE, "RecipeGenerator"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "ManufacturingExecutionSystem", $ARCHITECTURE, "MES"); + create_running_scripts("./scripts/ChocolateFactory_linux.txt", + "StationController", $ARCHITECTURE, "AllStationController"); + print "\nCreated running scripts\n"; +} + +sub create_running_scripts { + my ($template_name, $exe_name, $arch, $script_name) = @_; + open(my $fh, '<:utf8', $template_name) + or die "Could not open file '$template_name' $!"; + + # To copy all the file in a string + local $/ = undef; + $buffer = <$fh>; + $buffer =~ s/\$\{ARCHITECTURE\}/$arch/g; + $buffer =~ s/\$\{EXE_NAME\}/$exe_name/g; + close $fh; + + if ($OS =~ /[\s\S]*?Win[\s\S]*?/) { + $new_file = "./scripts/$script_name" . ".bat"; + $exe_name = $exe_name . ".exe"; + } else { + $new_file = "./scripts/$script_name" . ".sh"; + } + + open(my $fh, '>:utf8', $new_file) + or die "Could not create file <$script_name> $!"; + chmod 0775, $new_file; + print $fh $buffer; + close $fh; +} + diff --git a/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_linux.txt b/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_linux.txt new file mode 100644 index 00000000..48886629 --- /dev/null +++ b/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_linux.txt @@ -0,0 +1,31 @@ +#!/bin/sh + +filename=$0 +script_dir=`dirname $filename` +script_name=`basename $0` +executable_name=${EXE_NAME} +bin_dir=${script_dir}/../src/bin/${ARCHITECTURE} + +if [ -f $bin_dir/$executable_name ] +then + cd $bin_dir + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH + if [ "$script_name" = "AllStationController.sh" ] + then + gnome-terminal -x bash -c "./$executable_name --controller-type 1 $*" + gnome-terminal -x bash -c "./$executable_name --controller-type 2 $*" + gnome-terminal -x bash -c "./$executable_name --controller-type 3 $*" + gnome-terminal -x bash -c "./$executable_name --controller-type 4 $*" + gnome-terminal -x bash -c "./$executable_name --controller-type 5 $*" + else + ./$executable_name $* + fi +else + echo "***************************************************************" + echo $executable_name executable does not exist in: + echo $bin_dir + echo "" + echo Please, try to recompile the application using the command: + echo " $ perl ./scripts/Build.pl " + echo "***************************************************************" +fi diff --git a/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_windows.txt b/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_windows.txt new file mode 100644 index 00000000..00be6eeb --- /dev/null +++ b/ChocolateFactory/ExampleCode/scripts/ChocolateFactory_windows.txt @@ -0,0 +1,20 @@ +@echo off +setlocal + +set dir=%~dp0 +set script_name=%~n0 +set executable_name=${EXE_NAME} + +set Path=%NDDSHOME%\lib\${ARCHITECTURE};%PATH% + +cd %dir%\..\src\bin\${ARCHITECTURE}\ + +if "%script_name%" == "AllStationController" ( + start %executable_name% --controller-type 1 %* + start %executable_name% --controller-type 2 %* + start %executable_name% --controller-type 3 %* + start %executable_name% --controller-type 4 %* + start %executable_name% --controller-type 5 %* +) else ( + call %executable_name% %* +) diff --git a/ChocolateFactory/ExampleCode/scripts/MES.bat b/ChocolateFactory/ExampleCode/scripts/MES.bat deleted file mode 100755 index 45b26a4c..00000000 --- a/ChocolateFactory/ExampleCode/scripts/MES.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -setlocal - -set dir=%~dp0 -set executable_name=ManufacturingExecutionSystem - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%PATH% - -cd %dir%\..\win32\Release\i86Win32VS2010\ - -call %executable_name% %* \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/scripts/MES.sh b/ChocolateFactory/ExampleCode/scripts/MES.sh deleted file mode 100755 index 84acc332..00000000 --- a/ChocolateFactory/ExampleCode/scripts/MES.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="ManufacturingExecutionSystem" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/ManufacturingExecutionSystem - -if [ -f $bin_dir/$executable_name ] -then - cd $bin_dir - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH - ./$executable_name $* -else - echo "***************************************************************" - echo $executable_name executable does not exist in: - echo $bin_dir - echo "" - echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" - echo "***************************************************************" -fi diff --git a/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.bat b/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.bat deleted file mode 100755 index b8b900a8..00000000 --- a/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -setlocal - -set dir=%~dp0 -set executable_name=RecipeGenerator - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%PATH% - -cd %dir%\..\win32\Release\i86Win32VS2010\ - -call %executable_name% %* \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/scripts/StationController.bat b/ChocolateFactory/ExampleCode/scripts/StationController.bat deleted file mode 100755 index 88093e5b..00000000 --- a/ChocolateFactory/ExampleCode/scripts/StationController.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -setlocal - -set dir=%~dp0 -set executable_name=StationController - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%PATH% - -cd %dir%\..\win32\Release\i86Win32VS2010\ - -call %executable_name% %* diff --git a/ChocolateFactory/ExampleCode/scripts/StationController.sh b/ChocolateFactory/ExampleCode/scripts/StationController.sh deleted file mode 100755 index dda89d3c..00000000 --- a/ChocolateFactory/ExampleCode/scripts/StationController.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="StationController" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/StationController - -if [ -f $bin_dir/$executable_name ] -then - cd $bin_dir - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH - echo $LD_LIBRARY_PATH - ./$executable_name $* -else - echo "***************************************************************" - echo $executable_name executable does not exist in: - echo $bin_dir - echo "" - echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" - echo "***************************************************************" -fi diff --git a/ChocolateFactory/ExampleCode/src/CMakeLists.txt b/ChocolateFactory/ExampleCode/src/CMakeLists.txt new file mode 100644 index 00000000..e7be7b06 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/CMakeLists.txt @@ -0,0 +1,44 @@ +project(ChocolateFactory) + +# Minimum Required Version of CMake is 2.8.12 for Windows +# and 2.8.8 for the rest of platforms. +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + cmake_minimum_required(VERSION 2.8.12) +else() + cmake_minimum_required(VERSION 2.8.7) +endif() + +# NDDS version +set(RTI_NDDS_VERSION_MAJOR 5) +set(RTI_NDDS_VERSION_MINOR 1) +set(RTI_NDDS_VERSION_RELEASE 0) +set(RTI_NDDS_VERSION_REVISION 00) + + +# Add subdirectories +########################################## +# chocolate_factory library +# ------------------------ +# Add cmake scripts directory to the modules path +# ----------------------------------------------- +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake) + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES Debug Release) + set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" + CACHE STRING "Reset the configurations to what we need" FORCE) +endif() + +find_package(ConnextDDS REQUIRED) + +# ChocolateFactory specific configuration +# ---------------------------- +set(ChocolateFactory_BIN_DIR ${CMAKE_CURRENT_LIST_DIR}/bin/${ARCHITECTURE}) + +set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ChocolateFactory_BIN_DIR}) + +add_subdirectory(ManufacturingExecutionSystem) +add_subdirectory(RecipeGenerator) +add_subdirectory(StationController) +#including library +add_subdirectory(Generated) diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.cxx index 249ba0e6..339de013 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "ChocolateLotStateEntities.h" #include "EnumPrintHelpers.h" @@ -461,7 +462,7 @@ std::vector< DdsAutoType > *lots) // Return a value of true that lot updates have been received haveLotUpdates = true; - // Making copies of this type for clean API because we do not need + // Making copies of this type for clean API because we do not need // lowest latency for lot updates DdsAutoType lot = lotStateUpdates[i]; lots->push_back(lot); diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.h b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.h index 20cc6df5..c0c68f70 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.h +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/ChocolateLotStateEntities.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef CHOCOLATE_LOT_STATE_ENTITIES_H #define CHOCOLATE_LOT_STATE_ENTITIES_H @@ -140,4 +140,4 @@ class ChocolateLotStateWriter -#endif \ No newline at end of file +#endif diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 1d09d09a..26853f43 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -1,15 +1,16 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "DDSCommunicator.h" -using namespace DDS; +using namespace DDS; // ------------------------------------------------------------------------- // // Destruction of a DDS communication interface. This first deletes all the @@ -72,18 +73,18 @@ DDSCommunicator::~DDSCommunicator() // Creating a DomainParticipant with a specified domain ID DomainParticipant* DDSCommunicator::CreateParticipant(long domain) { - DomainParticipant* participant = + _participant = TheParticipantFactory->create_participant(domain, PARTICIPANT_QOS_DEFAULT, NULL, STATUS_MASK_NONE); - if (participant == NULL) + if (_participant == NULL) { std::stringstream errss; errss << "Failed to create DomainParticipant object"; throw errss.str(); } - return participant; + return _participant; } // ------------------------------------------------------------------------- // @@ -158,9 +159,9 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, fileNames[i].c_str()); } - DDS_ReturnCode_t retcode = TheParticipantFactory->set_qos(factoryQos); + ReturnCode_t retcode = TheParticipantFactory->set_qos(factoryQos); - if (retcode != DDS_RETCODE_OK) + if (retcode != RETCODE_OK) { std::stringstream errss; errss << "Failed to create DomainParticipant object"; @@ -207,8 +208,8 @@ Publisher* DDSCommunicator::CreatePublisher() // can actually send data. // _pub = GetParticipant()->create_publisher( - DDS_PUBLISHER_QOS_DEFAULT, - NULL, DDS_STATUS_MASK_NONE); + PUBLISHER_QOS_DEFAULT, + NULL, STATUS_MASK_NONE); if (_pub == NULL) { @@ -243,7 +244,7 @@ Publisher* DDSCommunicator::CreatePublisher( _pub = GetParticipant()->create_publisher_with_profile( qosLibrary.c_str(), qosProfile.c_str(), - NULL, DDS_STATUS_MASK_NONE); + NULL, STATUS_MASK_NONE); if (_pub == NULL) { @@ -277,8 +278,8 @@ Subscriber* DDSCommunicator::CreateSubscriber() // create multiple DDS DataReaders. // _sub = GetParticipant()->create_subscriber( - DDS_SUBSCRIBER_QOS_DEFAULT, - NULL, DDS_STATUS_MASK_NONE); + SUBSCRIBER_QOS_DEFAULT, + NULL, STATUS_MASK_NONE); if (_sub == NULL) { @@ -315,7 +316,7 @@ Subscriber* DDSCommunicator::CreateSubscriber( _sub = GetParticipant()->create_subscriber_with_profile( qosLibrary.c_str(), qosProfile.c_str(), - NULL, DDS_STATUS_MASK_NONE); + NULL, STATUS_MASK_NONE); if (_sub == NULL) { std::stringstream errss; diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h index 8cc791f4..aba19d0f 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef DDS_COMMUNICATOR_H #define DDS_COMMUNICATOR_H diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h index a74c1933..884c2aed 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef DDS_TYPE_WRAPPER_H #define DDS_TYPE_WRAPPER_H diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.cxx index d6fe1e17..8a9adf61 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "EnumPrintHelpers.h" using namespace com::rti::chocolatefactory::generated; diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.h b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.h index 9d55b114..c024c13f 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.h +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/EnumPrintHelpers.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef ENUM_PRINT_HELPERS_H #define ENUM_PRINT_HELPERS_H diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.cxx index 977c5d7b..0bebad8d 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "../CommonInfrastructure/OSAPI.h" OSThread::OSThread( diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.h b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.h index 893117dd..d07799e8 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.h +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/OSAPI.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef OSAPI_H #define OSAPI_H diff --git a/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml b/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml index 038e3a07..9351fdc8 100644 --- a/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml +++ b/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml @@ -1,25 +1,24 @@ + - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -28,52 +27,10 @@ RTI Connext user manual. - + - - 65507 - - + - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -27,57 +27,10 @@ RTI Connext user manual. - + - - - 65507 - - - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -30,20 +29,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - @@ -68,35 +53,6 @@ RTI Connext user manual. - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - diff --git a/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml b/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml index 72f19e46..82a90c69 100644 --- a/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml +++ b/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml @@ -1,16 +1,15 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -30,20 +29,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - @@ -68,35 +53,6 @@ RTI Connext user manual. - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - diff --git a/ChocolateFactory/ExampleCode/src/Generated/CMakeLists.txt b/ChocolateFactory/ExampleCode/src/Generated/CMakeLists.txt new file mode 100644 index 00000000..aaed5535 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/CMakeLists.txt @@ -0,0 +1,49 @@ +######################## +# SharedDataTypes +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/Generated +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE SharedDataTypes_sources + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactory.cxx + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactory.h + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactoryPlugin.cxx + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactoryPlugin.h + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactorySupport.cxx + ${CMAKE_SOURCE_DIR}/Generated/ChocolateFactorySupport.h + ) + +# Create object library +add_library(SharedDataTypes ${SharedDataTypes_sources}) +add_dependencies(SharedDataTypes RUN_RTIDDSGEN) + +target_link_libraries(SharedDataTypes + ${CONNEXTDDS_LIBRARIES} +) + +set_target_properties(SharedDataTypes PROPERTIES PREFIX "") + + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(SharedDataTypes PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ) +endforeach() diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.cxx b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.cxx new file mode 100644 index 00000000..0c84205a --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.cxx @@ -0,0 +1,1420 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + + +#ifndef NDDS_STANDALONE_TYPE + #ifdef __cplusplus + #ifndef ndds_cpp_h + #include "ndds/ndds_cpp.h" + #endif + #ifndef dds_c_log_impl_h + #include "dds_c/dds_c_log_impl.h" + #endif + #else + #ifndef ndds_c_h + #include "ndds/ndds_c.h" + #endif + #endif + + #ifndef cdr_type_h + #include "cdr/cdr_type.h" + #endif + + #ifndef osapi_heap_h + #include "osapi/osapi_heap.h" + #endif +#else + #include "ndds_standalone_type.h" +#endif + + + +#include "ChocolateFactory.h" + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ +/* ========================================================================= */ +const char *StationControllerKindTYPENAME = "com::rti::chocolatefactory::generated::StationControllerKind"; + +DDS_TypeCode* StationControllerKind_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + static DDS_TypeCode_Member StationControllerKind_g_tc_members[6] = + { + { + (char *)"INVALID_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + INVALID_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"SUGAR_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + SUGAR_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"COCOA_BUTTER_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + COCOA_BUTTER_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"COCOA_LIQUOR_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + COCOA_LIQUOR_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"VANILLA_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + VANILLA_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"MILK_CONTROLLER",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + MILK_CONTROLLER, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + } + }; + + static DDS_TypeCode StationControllerKind_g_tc = + {{ + DDS_TK_ENUM, /* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + (char *)"com::rti::chocolatefactory::generated::StationControllerKind", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 6, /* Number of enumerators */ + StationControllerKind_g_tc_members, /* Enumerators */ + DDS_VM_NONE /* Ignored */ +} }; + + if (is_initialized) { + return &StationControllerKind_g_tc; + } + + is_initialized = RTI_TRUE; + return &StationControllerKind_g_tc; +} + + +RTIBool StationControllerKind_initialize( + StationControllerKind* sample) +{ + *sample = INVALID_CONTROLLER; + return RTI_TRUE; +} + +RTIBool StationControllerKind_initialize_ex( + StationControllerKind* sample,RTIBool allocatePointers,RTIBool allocateMemory) +{ + if (allocatePointers) {} /* To avoid warnings */ + if (allocateMemory) {} /* To avoid warnings */ + *sample = INVALID_CONTROLLER; + return RTI_TRUE; +} + +RTIBool StationControllerKind_initialize_w_params( + StationControllerKind* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + if (allocParams) {} /* To avoid warnings */ + *sample = INVALID_CONTROLLER; + return RTI_TRUE; +} + +void StationControllerKind_finalize( + StationControllerKind* sample) +{ + if (sample) {} /* To avoid warnings */ + /* empty */ +} + +void StationControllerKind_finalize_ex( + StationControllerKind* sample,RTIBool deletePointers) +{ + if (sample) {} /* To avoid warnings */ + if (deletePointers) {} /* To avoid warnings */ + /* empty */ +} + +void StationControllerKind_finalize_w_params( + StationControllerKind* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) {} /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + /* empty */ +} + +RTIBool StationControllerKind_copy( + StationControllerKind* dst, + const StationControllerKind* src) +{ + return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); +} + + +RTIBool StationControllerKind_getValues(StationControllerKindSeq * values) + +{ + int i = 0; + StationControllerKind * buffer; + + + if (!values->maximum(6)) { + return RTI_FALSE; + } + + if (!values->length(6)) { + return RTI_FALSE; + } + + buffer = values->get_contiguous_buffer(); + + buffer[i] = INVALID_CONTROLLER; + i++; + + buffer[i] = SUGAR_CONTROLLER; + i++; + + buffer[i] = COCOA_BUTTER_CONTROLLER; + i++; + + buffer[i] = COCOA_LIQUOR_CONTROLLER; + i++; + + buffer[i] = VANILLA_CONTROLLER; + i++; + + buffer[i] = MILK_CONTROLLER; + i++; + + + return RTI_TRUE; +} + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'StationControllerKind' sequence class. + */ +#define T StationControllerKind +#define TSeq StationControllerKindSeq +#define T_initialize_w_params StationControllerKind_initialize_w_params +#define T_finalize_w_params StationControllerKind_finalize_w_params +#define T_copy StationControllerKind_copy + +#ifndef NDDS_STANDALONE_TYPE +#include "dds_c/generic/dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" +#endif +#else +#include "dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp_sequence_TSeq.gen" +#endif +#endif + +#undef T_copy +#undef T_finalize_w_params +#undef T_initialize_w_params +#undef TSeq +#undef T +/* ========================================================================= */ +const char *LotStatusKindTYPENAME = "com::rti::chocolatefactory::generated::LotStatusKind"; + +DDS_TypeCode* LotStatusKind_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + static DDS_TypeCode_Member LotStatusKind_g_tc_members[4] = + { + { + (char *)"ASSIGNED_TO_SC",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + ASSIGNED_TO_SC, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"WAITING_AT_SC",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + WAITING_AT_SC, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"PROCESSING_AT_SC",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + PROCESSING_AT_SC, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"LOT_COMPLETED",/* Member name */ + { + 0,/* Ignored */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + NULL /* Ignored */ + }, + LOT_COMPLETED, /* Enumerator ordinal */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Ignored */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + } + }; + + static DDS_TypeCode LotStatusKind_g_tc = + {{ + DDS_TK_ENUM, /* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1, /* Ignored */ + (char *)"com::rti::chocolatefactory::generated::LotStatusKind", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 4, /* Number of enumerators */ + LotStatusKind_g_tc_members, /* Enumerators */ + DDS_VM_NONE /* Ignored */ +} }; + + if (is_initialized) { + return &LotStatusKind_g_tc; + } + + is_initialized = RTI_TRUE; + return &LotStatusKind_g_tc; +} + + +RTIBool LotStatusKind_initialize( + LotStatusKind* sample) +{ + *sample = ASSIGNED_TO_SC; + return RTI_TRUE; +} + +RTIBool LotStatusKind_initialize_ex( + LotStatusKind* sample,RTIBool allocatePointers,RTIBool allocateMemory) +{ + if (allocatePointers) {} /* To avoid warnings */ + if (allocateMemory) {} /* To avoid warnings */ + *sample = ASSIGNED_TO_SC; + return RTI_TRUE; +} + +RTIBool LotStatusKind_initialize_w_params( + LotStatusKind* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + if (allocParams) {} /* To avoid warnings */ + *sample = ASSIGNED_TO_SC; + return RTI_TRUE; +} + +void LotStatusKind_finalize( + LotStatusKind* sample) +{ + if (sample) {} /* To avoid warnings */ + /* empty */ +} + +void LotStatusKind_finalize_ex( + LotStatusKind* sample,RTIBool deletePointers) +{ + if (sample) {} /* To avoid warnings */ + if (deletePointers) {} /* To avoid warnings */ + /* empty */ +} + +void LotStatusKind_finalize_w_params( + LotStatusKind* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) {} /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + /* empty */ +} + +RTIBool LotStatusKind_copy( + LotStatusKind* dst, + const LotStatusKind* src) +{ + return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); +} + + +RTIBool LotStatusKind_getValues(LotStatusKindSeq * values) + +{ + int i = 0; + LotStatusKind * buffer; + + + if (!values->maximum(4)) { + return RTI_FALSE; + } + + if (!values->length(4)) { + return RTI_FALSE; + } + + buffer = values->get_contiguous_buffer(); + + buffer[i] = ASSIGNED_TO_SC; + i++; + + buffer[i] = WAITING_AT_SC; + i++; + + buffer[i] = PROCESSING_AT_SC; + i++; + + buffer[i] = LOT_COMPLETED; + i++; + + + return RTI_TRUE; +} + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'LotStatusKind' sequence class. + */ +#define T LotStatusKind +#define TSeq LotStatusKindSeq +#define T_initialize_w_params LotStatusKind_initialize_w_params +#define T_finalize_w_params LotStatusKind_finalize_w_params +#define T_copy LotStatusKind_copy + +#ifndef NDDS_STANDALONE_TYPE +#include "dds_c/generic/dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" +#endif +#else +#include "dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp_sequence_TSeq.gen" +#endif +#endif + +#undef T_copy +#undef T_finalize_w_params +#undef T_initialize_w_params +#undef TSeq +#undef T +/* ========================================================================= */ +const char *RecipeStepTYPENAME = "com::rti::chocolatefactory::generated::RecipeStep"; + +DDS_TypeCode* RecipeStep_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + + static DDS_TypeCode_Member RecipeStep_g_tc_members[2]= + { + { + (char *)"stationController",/* Member name */ + { + 0,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"seconds",/* Member name */ + { + 1,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + } + }; + + static DDS_TypeCode RecipeStep_g_tc = + {{ + DDS_TK_STRUCT,/* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1,/* Ignored */ + (char *)"com::rti::chocolatefactory::generated::RecipeStep", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 2, /* Number of members */ + RecipeStep_g_tc_members, /* Members */ + DDS_VM_NONE /* Ignored */ + }}; /* Type code for RecipeStep*/ + + if (is_initialized) { + return &RecipeStep_g_tc; + } + + + RecipeStep_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)com::rti::chocolatefactory::generated::StationControllerKind_get_typecode(); + RecipeStep_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; + + is_initialized = RTI_TRUE; + + return &RecipeStep_g_tc; +} + + +RTIBool RecipeStep_initialize( + RecipeStep* sample) { + return ::com::rti::chocolatefactory::generated::RecipeStep_initialize_ex(sample,RTI_TRUE,RTI_TRUE); +} + +RTIBool RecipeStep_initialize_ex( + RecipeStep* sample,RTIBool allocatePointers,RTIBool allocateMemory) +{ + struct DDS_TypeAllocationParams_t allocParams = + DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; + + allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; + allocParams.allocate_memory = (DDS_Boolean)allocateMemory; + + return ::com::rti::chocolatefactory::generated::RecipeStep_initialize_w_params( + sample,&allocParams); +} + +RTIBool RecipeStep_initialize_w_params( + RecipeStep* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + + + if (allocParams) {} /* To avoid warnings */ + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_initialize_w_params(&sample->stationController,allocParams)) { + return RTI_FALSE; + } + + + if (!RTICdrType_initLong(&sample->seconds)) { + return RTI_FALSE; + } + + + + return RTI_TRUE; +} + +void RecipeStep_finalize( + RecipeStep* sample) +{ + ::com::rti::chocolatefactory::generated::RecipeStep_finalize_ex(sample,RTI_TRUE); +} + +void RecipeStep_finalize_ex( + RecipeStep* sample,RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParams = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + + if (sample) { } /* To avoid warnings */ + + deallocParams.delete_pointers = (DDS_Boolean)deletePointers; + + ::com::rti::chocolatefactory::generated::RecipeStep_finalize_w_params( + sample,&deallocParams); +} + +void RecipeStep_finalize_w_params( + RecipeStep* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->stationController, deallocParams); + + + +} + +void RecipeStep_finalize_optional_members( + RecipeStep* sample, RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParamsTmp = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + struct DDS_TypeDeallocationParams_t * deallocParams = + &deallocParamsTmp; + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + + deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; + deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->stationController, deallocParams); + + + +} + +RTIBool RecipeStep_copy( + RecipeStep* dst, + const RecipeStep* src) +{ + + if (!com::rti::chocolatefactory::generated::StationControllerKind_copy( + &dst->stationController, &src->stationController)) { + return RTI_FALSE; + } + + + if (!RTICdrType_copyLong( + &dst->seconds, &src->seconds)) { + return RTI_FALSE; + } + + + + return RTI_TRUE; +} + + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'RecipeStep' sequence class. + */ +#define T RecipeStep +#define TSeq RecipeStepSeq +#define T_initialize_w_params ::com::rti::chocolatefactory::generated::RecipeStep_initialize_w_params +#define T_finalize_w_params ::com::rti::chocolatefactory::generated::RecipeStep_finalize_w_params +#define T_copy ::com::rti::chocolatefactory::generated::RecipeStep_copy + +#ifndef NDDS_STANDALONE_TYPE +#include "dds_c/generic/dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" +#endif +#else +#include "dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp_sequence_TSeq.gen" +#endif +#endif + +#undef T_copy +#undef T_finalize_w_params +#undef T_initialize_w_params +#undef TSeq +#undef T + +/* ========================================================================= */ +const char *ChocolateRecipeTYPENAME = "com::rti::chocolatefactory::generated::ChocolateRecipe"; + +DDS_TypeCode* ChocolateRecipe_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + static DDS_TypeCode ChocolateRecipe_g_tc_recipeName_string = DDS_INITIALIZE_STRING_TYPECODE((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)); + static DDS_TypeCode ChocolateRecipe_g_tc_steps_sequence = DDS_INITIALIZE_SEQUENCE_TYPECODE((com::rti::chocolatefactory::generated::MAX_RECIPE_STEPS),NULL); + + static DDS_TypeCode_Member ChocolateRecipe_g_tc_members[2]= + { + { + (char *)"recipeName",/* Member name */ + { + 0,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_KEY_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"steps",/* Member name */ + { + 1,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + } + }; + + static DDS_TypeCode ChocolateRecipe_g_tc = + {{ + DDS_TK_STRUCT,/* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1,/* Ignored */ + (char *)"com::rti::chocolatefactory::generated::ChocolateRecipe", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 2, /* Number of members */ + ChocolateRecipe_g_tc_members, /* Members */ + DDS_VM_NONE /* Ignored */ + }}; /* Type code for ChocolateRecipe*/ + + if (is_initialized) { + return &ChocolateRecipe_g_tc; + } + + ChocolateRecipe_g_tc_steps_sequence._data._typeCode = (RTICdrTypeCode *)com::rti::chocolatefactory::generated::RecipeStep_get_typecode(); + + ChocolateRecipe_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&ChocolateRecipe_g_tc_recipeName_string; + ChocolateRecipe_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&ChocolateRecipe_g_tc_steps_sequence; + + is_initialized = RTI_TRUE; + + return &ChocolateRecipe_g_tc; +} + + +RTIBool ChocolateRecipe_initialize( + ChocolateRecipe* sample) { + return ::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_ex(sample,RTI_TRUE,RTI_TRUE); +} + +RTIBool ChocolateRecipe_initialize_ex( + ChocolateRecipe* sample,RTIBool allocatePointers,RTIBool allocateMemory) +{ + struct DDS_TypeAllocationParams_t allocParams = + DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; + + allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; + allocParams.allocate_memory = (DDS_Boolean)allocateMemory; + + return ::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_w_params( + sample,&allocParams); +} + +RTIBool ChocolateRecipe_initialize_w_params( + ChocolateRecipe* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + + void* buffer = NULL; + if (buffer) {} /* To avoid warnings */ + + + if (allocParams) {} /* To avoid warnings */ + + + if (allocParams->allocate_memory) { + sample->recipeName = DDS_String_alloc(((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH))); + if (sample->recipeName == NULL) { + return RTI_FALSE; + } + } else { + if (sample->recipeName != NULL) { + sample->recipeName[0] = '\0'; + } + } + + + if (allocParams->allocate_memory) { + com::rti::chocolatefactory::generated::RecipeStepSeq_initialize(&sample->steps); + com::rti::chocolatefactory::generated::RecipeStepSeq_set_element_allocation_params(&sample->steps,allocParams); + if (!com::rti::chocolatefactory::generated::RecipeStepSeq_set_maximum(&sample->steps, + ((com::rti::chocolatefactory::generated::MAX_RECIPE_STEPS)))) { + return RTI_FALSE; + } + } else { + com::rti::chocolatefactory::generated::RecipeStepSeq_set_length(&sample->steps,0); + } + + + + return RTI_TRUE; +} + +void ChocolateRecipe_finalize( + ChocolateRecipe* sample) +{ + ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_ex(sample,RTI_TRUE); +} + +void ChocolateRecipe_finalize_ex( + ChocolateRecipe* sample,RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParams = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + + if (sample) { } /* To avoid warnings */ + + deallocParams.delete_pointers = (DDS_Boolean)deletePointers; + + ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_w_params( + sample,&deallocParams); +} + +void ChocolateRecipe_finalize_w_params( + ChocolateRecipe* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + if (sample->recipeName != NULL) { + DDS_String_free(sample->recipeName); + sample->recipeName = NULL; + } + + + com::rti::chocolatefactory::generated::RecipeStepSeq_set_element_deallocation_params(&sample->steps,deallocParams); + com::rti::chocolatefactory::generated::RecipeStepSeq_finalize(&sample->steps); + + +} + +void ChocolateRecipe_finalize_optional_members( + ChocolateRecipe* sample, RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParamsTmp = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + struct DDS_TypeDeallocationParams_t * deallocParams = + &deallocParamsTmp; + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + + deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; + deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; + + + + { + DDS_UnsignedLong i, length; + length = com::rti::chocolatefactory::generated::RecipeStepSeq_get_length( + &sample->steps); + + for (i = 0; i < length; i++) { + com::rti::chocolatefactory::generated::RecipeStep_finalize_optional_members( + com::rti::chocolatefactory::generated::RecipeStepSeq_get_reference( + &sample->steps, i), deallocParams->delete_pointers); + } + } + + +} + +RTIBool ChocolateRecipe_copy( + ChocolateRecipe* dst, + const ChocolateRecipe* src) +{ + + if (!RTICdrType_copyString( + dst->recipeName, src->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::RecipeStepSeq_copy(&dst->steps, + &src->steps)) { + return RTI_FALSE; + } + + + + return RTI_TRUE; +} + + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'ChocolateRecipe' sequence class. + */ +#define T ChocolateRecipe +#define TSeq ChocolateRecipeSeq +#define T_initialize_w_params ::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_w_params +#define T_finalize_w_params ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_w_params +#define T_copy ::com::rti::chocolatefactory::generated::ChocolateRecipe_copy + +#ifndef NDDS_STANDALONE_TYPE +#include "dds_c/generic/dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" +#endif +#else +#include "dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp_sequence_TSeq.gen" +#endif +#endif + +#undef T_copy +#undef T_finalize_w_params +#undef T_initialize_w_params +#undef TSeq +#undef T + +/* ========================================================================= */ +const char *ChocolateLotStateTYPENAME = "com::rti::chocolatefactory::generated::ChocolateLotState"; + +DDS_TypeCode* ChocolateLotState_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + static DDS_TypeCode ChocolateLotState_g_tc_recipeName_string = DDS_INITIALIZE_STRING_TYPECODE((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)); + static DDS_TypeCode ChocolateLotState_g_tc_ingredients_string = DDS_INITIALIZE_STRING_TYPECODE((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)); + static DDS_TypeCode ChocolateLotState_g_tc_ingredients_sequence = DDS_INITIALIZE_SEQUENCE_TYPECODE((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST),NULL); + + static DDS_TypeCode_Member ChocolateLotState_g_tc_members[6]= + { + { + (char *)"lotID",/* Member name */ + { + 0,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_KEY_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"controller",/* Member name */ + { + 1,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_KEY_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"recipeName",/* Member name */ + { + 2,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"nextController",/* Member name */ + { + 3,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"lotStatus",/* Member name */ + { + 4,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + }, + { + (char *)"ingredients",/* Member name */ + { + 5,/* Representation ID */ + DDS_BOOLEAN_FALSE,/* Is a pointer? */ + -1, /* Bitfield bits */ + NULL/* Member type code is assigned later */ + }, + 0, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + RTI_CDR_REQUIRED_MEMBER, /* Member flags */ + DDS_PRIVATE_MEMBER,/* Ignored */ + 1, + NULL/* Ignored */ + } + }; + + static DDS_TypeCode ChocolateLotState_g_tc = + {{ + DDS_TK_STRUCT,/* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1,/* Ignored */ + (char *)"com::rti::chocolatefactory::generated::ChocolateLotState", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 6, /* Number of members */ + ChocolateLotState_g_tc_members, /* Members */ + DDS_VM_NONE /* Ignored */ + }}; /* Type code for ChocolateLotState*/ + + if (is_initialized) { + return &ChocolateLotState_g_tc; + } + + ChocolateLotState_g_tc_ingredients_sequence._data._typeCode = (RTICdrTypeCode *)&ChocolateLotState_g_tc_ingredients_string; + + ChocolateLotState_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; + ChocolateLotState_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)com::rti::chocolatefactory::generated::StationControllerKind_get_typecode(); + ChocolateLotState_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)&ChocolateLotState_g_tc_recipeName_string; + ChocolateLotState_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)com::rti::chocolatefactory::generated::StationControllerKind_get_typecode(); + ChocolateLotState_g_tc_members[4]._representation._typeCode = (RTICdrTypeCode *)com::rti::chocolatefactory::generated::LotStatusKind_get_typecode(); + ChocolateLotState_g_tc_members[5]._representation._typeCode = (RTICdrTypeCode *)&ChocolateLotState_g_tc_ingredients_sequence; + + is_initialized = RTI_TRUE; + + return &ChocolateLotState_g_tc; +} + + +RTIBool ChocolateLotState_initialize( + ChocolateLotState* sample) { + return ::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_ex(sample,RTI_TRUE,RTI_TRUE); +} + +RTIBool ChocolateLotState_initialize_ex( + ChocolateLotState* sample,RTIBool allocatePointers,RTIBool allocateMemory) +{ + struct DDS_TypeAllocationParams_t allocParams = + DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; + + allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; + allocParams.allocate_memory = (DDS_Boolean)allocateMemory; + + return ::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_w_params( + sample,&allocParams); +} + +RTIBool ChocolateLotState_initialize_w_params( + ChocolateLotState* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + + void* buffer = NULL; + if (buffer) {} /* To avoid warnings */ + + + if (allocParams) {} /* To avoid warnings */ + + + if (!RTICdrType_initLong(&sample->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_initialize_w_params(&sample->controller,allocParams)) { + return RTI_FALSE; + } + + + if (allocParams->allocate_memory) { + sample->recipeName = DDS_String_alloc(((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH))); + if (sample->recipeName == NULL) { + return RTI_FALSE; + } + } else { + if (sample->recipeName != NULL) { + sample->recipeName[0] = '\0'; + } + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_initialize_w_params(&sample->nextController,allocParams)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKind_initialize_w_params(&sample->lotStatus,allocParams)) { + return RTI_FALSE; + } + + + if (allocParams->allocate_memory) { + DDS_StringSeq_initialize(&sample->ingredients); + if (!DDS_StringSeq_set_maximum(&sample->ingredients, + ((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST)))) { + return RTI_FALSE; + } + buffer = DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients); + if (buffer == NULL) { + return RTI_FALSE; + } + if (!RTICdrType_initStringArray(buffer, ((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST)),((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH))+1, + RTI_CDR_CHAR_TYPE)) { + return RTI_FALSE; + } + } else { + DDS_StringSeq_set_length(&sample->ingredients, 0); + } + + + + return RTI_TRUE; +} + +void ChocolateLotState_finalize( + ChocolateLotState* sample) +{ + ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_ex(sample,RTI_TRUE); +} + +void ChocolateLotState_finalize_ex( + ChocolateLotState* sample,RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParams = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + + if (sample) { } /* To avoid warnings */ + + deallocParams.delete_pointers = (DDS_Boolean)deletePointers; + + ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_w_params( + sample,&deallocParams); +} + +void ChocolateLotState_finalize_w_params( + ChocolateLotState* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->controller, deallocParams); + + + if (sample->recipeName != NULL) { + DDS_String_free(sample->recipeName); + sample->recipeName = NULL; + } + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->nextController, deallocParams); + + + com::rti::chocolatefactory::generated::LotStatusKind_finalize_w_params(&sample->lotStatus, deallocParams); + + + DDS_StringSeq_finalize(&sample->ingredients); + + +} + +void ChocolateLotState_finalize_optional_members( + ChocolateLotState* sample, RTIBool deletePointers) +{ + struct DDS_TypeDeallocationParams_t deallocParamsTmp = + DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; + struct DDS_TypeDeallocationParams_t * deallocParams = + &deallocParamsTmp; + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + + deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; + deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; + + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->controller, deallocParams); + + + + com::rti::chocolatefactory::generated::StationControllerKind_finalize_w_params(&sample->nextController, deallocParams); + + + com::rti::chocolatefactory::generated::LotStatusKind_finalize_w_params(&sample->lotStatus, deallocParams); + + + +} + +RTIBool ChocolateLotState_copy( + ChocolateLotState* dst, + const ChocolateLotState* src) +{ + + if (!RTICdrType_copyLong( + &dst->lotID, &src->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_copy( + &dst->controller, &src->controller)) { + return RTI_FALSE; + } + + + if (!RTICdrType_copyString( + dst->recipeName, src->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_copy( + &dst->nextController, &src->nextController)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKind_copy( + &dst->lotStatus, &src->lotStatus)) { + return RTI_FALSE; + } + + + if (!DDS_StringSeq_copy(&dst->ingredients, + &src->ingredients)) { + return RTI_FALSE; + } + + + + return RTI_TRUE; +} + + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'ChocolateLotState' sequence class. + */ +#define T ChocolateLotState +#define TSeq ChocolateLotStateSeq +#define T_initialize_w_params ::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_w_params +#define T_finalize_w_params ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_w_params +#define T_copy ::com::rti::chocolatefactory::generated::ChocolateLotState_copy + +#ifndef NDDS_STANDALONE_TYPE +#include "dds_c/generic/dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" +#endif +#else +#include "dds_c_sequence_TSeq.gen" +#ifdef __cplusplus +#include "dds_cpp_sequence_TSeq.gen" +#endif +#endif + +#undef T_copy +#undef T_finalize_w_params +#undef T_initialize_w_params +#undef TSeq +#undef T + + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.h b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.h new file mode 100644 index 00000000..12eade44 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.h @@ -0,0 +1,487 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + +#ifndef ChocolateFactory_1774920665_h +#define ChocolateFactory_1774920665_h + +#ifndef NDDS_STANDALONE_TYPE + #ifdef __cplusplus + #ifndef ndds_cpp_h + #include "ndds/ndds_cpp.h" + #endif + #else + #ifndef ndds_c_h + #include "ndds/ndds_c.h" + #endif + #endif +#else + #include "ndds_standalone_type.h" +#endif + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ + +static const char * RECIPE_TOPIC = "ChocolateRecipes"; +static const char * CHOCOLATE_LOT_TOPIC = "ChocolateLotState"; +static const char * QOS_LIBRARY = "RTIExampleQosLibrary"; +static const char * QOS_PROFILE_STATE_DATA = "FactoryStateData"; +static const DDS_Long MAX_INGREDIENT_LIST = 9; +static const DDS_Long MAX_RECIPE_STEPS = 9; +static const DDS_Long MAX_STRING_LENGTH = 256; +typedef enum StationControllerKind +{ + INVALID_CONTROLLER, + SUGAR_CONTROLLER, + COCOA_BUTTER_CONTROLLER, + COCOA_LIQUOR_CONTROLLER, + VANILLA_CONTROLLER, + MILK_CONTROLLER +} StationControllerKind; + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + + +NDDSUSERDllExport DDS_TypeCode* StationControllerKind_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(StationControllerKindSeq, StationControllerKind); + +NDDSUSERDllExport +RTIBool StationControllerKind_initialize( + StationControllerKind* self); + +NDDSUSERDllExport +RTIBool StationControllerKind_initialize_ex( + StationControllerKind* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool StationControllerKind_initialize_w_params( + StationControllerKind* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void StationControllerKind_finalize( + StationControllerKind* self); + +NDDSUSERDllExport +void StationControllerKind_finalize_ex( + StationControllerKind* self,RTIBool deletePointers); + +NDDSUSERDllExport +void StationControllerKind_finalize_w_params( + StationControllerKind* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void StationControllerKind_finalize_optional_members( + StationControllerKind* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool StationControllerKind_copy( + StationControllerKind* dst, + const StationControllerKind* src); + + +NDDSUSERDllExport +RTIBool StationControllerKind_getValues(StationControllerKindSeq * values); + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +typedef enum LotStatusKind +{ + ASSIGNED_TO_SC, + WAITING_AT_SC, + PROCESSING_AT_SC, + LOT_COMPLETED +} LotStatusKind; + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + + +NDDSUSERDllExport DDS_TypeCode* LotStatusKind_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(LotStatusKindSeq, LotStatusKind); + +NDDSUSERDllExport +RTIBool LotStatusKind_initialize( + LotStatusKind* self); + +NDDSUSERDllExport +RTIBool LotStatusKind_initialize_ex( + LotStatusKind* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool LotStatusKind_initialize_w_params( + LotStatusKind* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void LotStatusKind_finalize( + LotStatusKind* self); + +NDDSUSERDllExport +void LotStatusKind_finalize_ex( + LotStatusKind* self,RTIBool deletePointers); + +NDDSUSERDllExport +void LotStatusKind_finalize_w_params( + LotStatusKind* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void LotStatusKind_finalize_optional_members( + LotStatusKind* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool LotStatusKind_copy( + LotStatusKind* dst, + const LotStatusKind* src); + + +NDDSUSERDllExport +RTIBool LotStatusKind_getValues(LotStatusKindSeq * values); + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +#define com_rti_chocolatefactory_generated_RecipeStep_LAST_MEMBER_ID 1 + +extern const char *RecipeStepTYPENAME; + + + +#ifdef __cplusplus + struct RecipeStepSeq; + +#endif + + + +class RecipeStep +{ +public: +#ifdef __cplusplus + typedef struct RecipeStepSeq Seq; + +#endif + + com::rti::chocolatefactory::generated::StationControllerKind stationController; + + DDS_Long seconds; + + +}; + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + + +NDDSUSERDllExport DDS_TypeCode* RecipeStep_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(RecipeStepSeq, RecipeStep); + +NDDSUSERDllExport +RTIBool RecipeStep_initialize( + RecipeStep* self); + +NDDSUSERDllExport +RTIBool RecipeStep_initialize_ex( + RecipeStep* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool RecipeStep_initialize_w_params( + RecipeStep* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void RecipeStep_finalize( + RecipeStep* self); + +NDDSUSERDllExport +void RecipeStep_finalize_ex( + RecipeStep* self,RTIBool deletePointers); + +NDDSUSERDllExport +void RecipeStep_finalize_w_params( + RecipeStep* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void RecipeStep_finalize_optional_members( + RecipeStep* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool RecipeStep_copy( + RecipeStep* dst, + const RecipeStep* src); + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +#define com_rti_chocolatefactory_generated_ChocolateRecipe_LAST_MEMBER_ID 1 + +extern const char *ChocolateRecipeTYPENAME; + + + +#ifdef __cplusplus + struct ChocolateRecipeSeq; + +#ifndef NDDS_STANDALONE_TYPE + class ChocolateRecipeTypeSupport; + class ChocolateRecipeDataWriter; + class ChocolateRecipeDataReader; +#endif + +#endif + + + +class ChocolateRecipe +{ +public: +#ifdef __cplusplus + typedef struct ChocolateRecipeSeq Seq; + +#ifndef NDDS_STANDALONE_TYPE + typedef ChocolateRecipeTypeSupport TypeSupport; + typedef ChocolateRecipeDataWriter DataWriter; + typedef ChocolateRecipeDataReader DataReader; +#endif + +#endif + + char* recipeName; /* maximum length = ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) */ + + com::rti::chocolatefactory::generated::RecipeStepSeq steps; + + +}; + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + + +NDDSUSERDllExport DDS_TypeCode* ChocolateRecipe_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(ChocolateRecipeSeq, ChocolateRecipe); + +NDDSUSERDllExport +RTIBool ChocolateRecipe_initialize( + ChocolateRecipe* self); + +NDDSUSERDllExport +RTIBool ChocolateRecipe_initialize_ex( + ChocolateRecipe* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool ChocolateRecipe_initialize_w_params( + ChocolateRecipe* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void ChocolateRecipe_finalize( + ChocolateRecipe* self); + +NDDSUSERDllExport +void ChocolateRecipe_finalize_ex( + ChocolateRecipe* self,RTIBool deletePointers); + +NDDSUSERDllExport +void ChocolateRecipe_finalize_w_params( + ChocolateRecipe* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void ChocolateRecipe_finalize_optional_members( + ChocolateRecipe* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool ChocolateRecipe_copy( + ChocolateRecipe* dst, + const ChocolateRecipe* src); + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +#define com_rti_chocolatefactory_generated_ChocolateLotState_LAST_MEMBER_ID 5 + +extern const char *ChocolateLotStateTYPENAME; + + + +#ifdef __cplusplus + struct ChocolateLotStateSeq; + +#ifndef NDDS_STANDALONE_TYPE + class ChocolateLotStateTypeSupport; + class ChocolateLotStateDataWriter; + class ChocolateLotStateDataReader; +#endif + +#endif + + + +class ChocolateLotState +{ +public: +#ifdef __cplusplus + typedef struct ChocolateLotStateSeq Seq; + +#ifndef NDDS_STANDALONE_TYPE + typedef ChocolateLotStateTypeSupport TypeSupport; + typedef ChocolateLotStateDataWriter DataWriter; + typedef ChocolateLotStateDataReader DataReader; +#endif + +#endif + + DDS_Long lotID; + + com::rti::chocolatefactory::generated::StationControllerKind controller; + + char* recipeName; /* maximum length = ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) */ + + com::rti::chocolatefactory::generated::StationControllerKind nextController; + + com::rti::chocolatefactory::generated::LotStatusKind lotStatus; + + DDS_StringSeq ingredients; + + +}; + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + + +NDDSUSERDllExport DDS_TypeCode* ChocolateLotState_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(ChocolateLotStateSeq, ChocolateLotState); + +NDDSUSERDllExport +RTIBool ChocolateLotState_initialize( + ChocolateLotState* self); + +NDDSUSERDllExport +RTIBool ChocolateLotState_initialize_ex( + ChocolateLotState* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool ChocolateLotState_initialize_w_params( + ChocolateLotState* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void ChocolateLotState_finalize( + ChocolateLotState* self); + +NDDSUSERDllExport +void ChocolateLotState_finalize_ex( + ChocolateLotState* self,RTIBool deletePointers); + +NDDSUSERDllExport +void ChocolateLotState_finalize_w_params( + ChocolateLotState* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void ChocolateLotState_finalize_optional_members( + ChocolateLotState* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool ChocolateLotState_copy( + ChocolateLotState* dst, + const ChocolateLotState* src); + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ + + +#endif /* ChocolateFactory_1774920665_h */ diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.cxx b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.cxx new file mode 100644 index 00000000..6c08f438 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.cxx @@ -0,0 +1,4316 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + + +#include + +#ifdef __cplusplus +#ifndef ndds_cpp_h + #include "ndds/ndds_cpp.h" +#endif +#else +#ifndef ndds_c_h + #include "ndds/ndds_c.h" +#endif +#endif + +#ifndef osapi_type_h + #include "osapi/osapi_type.h" +#endif +#ifndef osapi_heap_h + #include "osapi/osapi_heap.h" +#endif + +#ifndef osapi_utility_h + #include "osapi/osapi_utility.h" +#endif + +#ifndef cdr_type_h + #include "cdr/cdr_type.h" +#endif + +#ifndef cdr_type_object_h + #include "cdr/cdr_typeObject.h" +#endif + +#ifndef cdr_encapsulation_h + #include "cdr/cdr_encapsulation.h" +#endif + +#ifndef cdr_stream_h + #include "cdr/cdr_stream.h" +#endif + +#ifndef pres_typePlugin_h + #include "pres/pres_typePlugin.h" +#endif + + + +#include "ChocolateFactoryPlugin.h" + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ + + +/* ------------------------------------------------------------------------ + Enum Type: StationControllerKind + * ------------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------------ + * (De)Serialization Methods + * ------------------------------------------------------------------------ */ + + +RTIBool StationControllerKindPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + + if(serialize_encapsulation) { + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(serialize_sample) { + + if (!RTICdrStream_serializeEnum(stream, sample)) + { + return RTI_FALSE; + } + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool +StationControllerKindPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + DDS_Enum enum_tmp; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(deserialize_sample) { + + if (!RTICdrStream_deserializeEnum(stream, &enum_tmp)) + { + return RTI_FALSE; + } + switch (enum_tmp) { + + case INVALID_CONTROLLER: + *sample=INVALID_CONTROLLER; + break; + case SUGAR_CONTROLLER: + *sample=SUGAR_CONTROLLER; + break; + case COCOA_BUTTER_CONTROLLER: + *sample=COCOA_BUTTER_CONTROLLER; + break; + case COCOA_LIQUOR_CONTROLLER: + *sample=COCOA_LIQUOR_CONTROLLER; + break; + case VANILLA_CONTROLLER: + *sample=VANILLA_CONTROLLER; + break; + case MILK_CONTROLLER: + *sample=MILK_CONTROLLER; + break; + default: + { + stream->_xTypesState.unassignable = RTI_TRUE; + return RTI_FALSE; + } + } + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool StationControllerKindPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if(skip_encapsulation) { + if (!RTICdrStream_skipEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(skip_sample) { + + if (!RTICdrStream_skipEnum(stream)) { + return RTI_FALSE; + } + + + } + + + if(skip_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +unsigned int StationControllerKindPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + + if (endpoint_data) {} /* To avoid warnings */ + + if (include_encapsulation) { + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + current_alignment += RTICdrType_getEnumMaxSizeSerialized(current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + + return current_alignment - initial_alignment; +} + + +unsigned int StationControllerKindPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + current_alignment += ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + +unsigned int +StationControllerKindPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const StationControllerKind * sample) +{ + unsigned int initial_alignment = current_alignment; + + if (sample) {} /* To avoid warnings */ + + current_alignment += ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + + + + + +/* ------------------------------------------------------------------------ + Key Management functions: + * ------------------------------------------------------------------------ */ + + +RTIBool StationControllerKindPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialize( + endpoint_data, sample, stream, + serialize_encapsulation, encapsulation_id, + serialize_key, endpoint_plugin_qos); +} + + +RTIBool StationControllerKindPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_sample( + endpoint_data, sample, stream, deserialize_encapsulation, + deserialize_key, endpoint_plugin_qos); +} + + +unsigned int StationControllerKindPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + current_alignment += ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + +RTIBool +StationControllerKindPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_sample( + endpoint_data, sample, stream, deserialize_encapsulation, + deserialize_key, endpoint_plugin_qos); +} + + +/* ---------------------------------------------------------------------------- + Support functions: + * ---------------------------------------------------------------------------- */ + + +void StationControllerKindPluginSupport_print_data( + const StationControllerKind *sample, + const char *description, int indent_level) +{ + if (description != NULL) { + RTICdrType_printIndent(indent_level); + RTILog_debug("%s:\n", description); + } + + if (sample == NULL) { + RTICdrType_printIndent(indent_level+1); + RTILog_debug("NULL\n"); + return; + } + + RTICdrType_printEnum((RTICdrEnum *)sample, "StationControllerKind", indent_level + 1); +} + + + +/* ------------------------------------------------------------------------ + Enum Type: LotStatusKind + * ------------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------------ + * (De)Serialization Methods + * ------------------------------------------------------------------------ */ + + +RTIBool LotStatusKindPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + + if(serialize_encapsulation) { + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(serialize_sample) { + + if (!RTICdrStream_serializeEnum(stream, sample)) + { + return RTI_FALSE; + } + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool +LotStatusKindPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + DDS_Enum enum_tmp; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(deserialize_sample) { + + if (!RTICdrStream_deserializeEnum(stream, &enum_tmp)) + { + return RTI_FALSE; + } + switch (enum_tmp) { + + case ASSIGNED_TO_SC: + *sample=ASSIGNED_TO_SC; + break; + case WAITING_AT_SC: + *sample=WAITING_AT_SC; + break; + case PROCESSING_AT_SC: + *sample=PROCESSING_AT_SC; + break; + case LOT_COMPLETED: + *sample=LOT_COMPLETED; + break; + default: + { + stream->_xTypesState.unassignable = RTI_TRUE; + return RTI_FALSE; + } + } + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool LotStatusKindPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if(skip_encapsulation) { + if (!RTICdrStream_skipEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(skip_sample) { + + if (!RTICdrStream_skipEnum(stream)) { + return RTI_FALSE; + } + + + } + + + if(skip_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +unsigned int LotStatusKindPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + + if (endpoint_data) {} /* To avoid warnings */ + + if (include_encapsulation) { + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + current_alignment += RTICdrType_getEnumMaxSizeSerialized(current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + + return current_alignment - initial_alignment; +} + + +unsigned int LotStatusKindPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + current_alignment += ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + +unsigned int +LotStatusKindPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const LotStatusKind * sample) +{ + unsigned int initial_alignment = current_alignment; + + if (sample) {} /* To avoid warnings */ + + current_alignment += ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + + + + + +/* ------------------------------------------------------------------------ + Key Management functions: + * ------------------------------------------------------------------------ */ + + +RTIBool LotStatusKindPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_serialize( + endpoint_data, sample, stream, + serialize_encapsulation, encapsulation_id, + serialize_key, endpoint_plugin_qos); +} + + +RTIBool LotStatusKindPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_deserialize_sample( + endpoint_data, sample, stream, deserialize_encapsulation, + deserialize_key, endpoint_plugin_qos); +} + + +unsigned int LotStatusKindPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + unsigned int initial_alignment = current_alignment; + + current_alignment += ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_max_size( + endpoint_data,include_encapsulation, + encapsulation_id, current_alignment); + + return current_alignment - initial_alignment; +} + + +RTIBool +LotStatusKindPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + return ::com::rti::chocolatefactory::generated::LotStatusKindPlugin_deserialize_sample( + endpoint_data, sample, stream, deserialize_encapsulation, + deserialize_key, endpoint_plugin_qos); +} + + +/* ---------------------------------------------------------------------------- + Support functions: + * ---------------------------------------------------------------------------- */ + + +void LotStatusKindPluginSupport_print_data( + const LotStatusKind *sample, + const char *description, int indent_level) +{ + if (description != NULL) { + RTICdrType_printIndent(indent_level); + RTILog_debug("%s:\n", description); + } + + if (sample == NULL) { + RTICdrType_printIndent(indent_level+1); + RTILog_debug("NULL\n"); + return; + } + + RTICdrType_printEnum((RTICdrEnum *)sample, "LotStatusKind", indent_level + 1); +} + + +/* -------------------------------------------------------------------------------------- + * Type RecipeStep + * -------------------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +RecipeStep* +RecipeStepPluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params){ + RecipeStep *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, RecipeStep); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::RecipeStep_initialize_w_params(sample,alloc_params)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +RecipeStep * +RecipeStepPluginSupport_create_data_ex(RTIBool allocate_pointers){ + RecipeStep *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, RecipeStep); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::RecipeStep_initialize_ex(sample,allocate_pointers, RTI_TRUE)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +RecipeStep * +RecipeStepPluginSupport_create_data(void) +{ + return ::com::rti::chocolatefactory::generated::RecipeStepPluginSupport_create_data_ex(RTI_TRUE); +} + + +void +RecipeStepPluginSupport_destroy_data_w_params( + RecipeStep *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params) { + + ::com::rti::chocolatefactory::generated::RecipeStep_finalize_w_params(sample,dealloc_params); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +RecipeStepPluginSupport_destroy_data_ex( + RecipeStep *sample,RTIBool deallocate_pointers) { + + ::com::rti::chocolatefactory::generated::RecipeStep_finalize_ex(sample,deallocate_pointers); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +RecipeStepPluginSupport_destroy_data( + RecipeStep *sample) { + + ::com::rti::chocolatefactory::generated::RecipeStepPluginSupport_destroy_data_ex(sample,RTI_TRUE); + +} + + +RTIBool +RecipeStepPluginSupport_copy_data( + RecipeStep *dst, + const RecipeStep *src) +{ + return ::com::rti::chocolatefactory::generated::RecipeStep_copy(dst,src); +} + + +void +RecipeStepPluginSupport_print_data( + const RecipeStep *sample, + const char *desc, + unsigned int indent_level) +{ + + + RTICdrType_printIndent(indent_level); + + if (desc != NULL) { + RTILog_debug("%s:\n", desc); + } else { + RTILog_debug("\n"); + } + + if (sample == NULL) { + RTILog_debug("NULL\n"); + return; + } + + + com::rti::chocolatefactory::generated::StationControllerKindPluginSupport_print_data( + &sample->stationController, "stationController", indent_level + 1); + + + RTICdrType_printLong( + &sample->seconds, "seconds", indent_level + 1); + + + +} + + + + +RTIBool +RecipeStepPlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *dst, + const RecipeStep *src) +{ + if (endpoint_data) {} /* To avoid warnings */ + return ::com::rti::chocolatefactory::generated::RecipeStepPluginSupport_copy_data(dst,src); +} + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +unsigned int +RecipeStepPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + + +RTIBool +RecipeStepPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + RTIBool retval = RTI_TRUE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(serialize_sample) { + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialize( + endpoint_data, + &sample->stationController, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + if (!RTICdrStream_serializeLong( + stream, &sample->seconds)) { + return RTI_FALSE; + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return retval; +} + + +RTIBool +RecipeStepPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(deserialize_sample) { + ::com::rti::chocolatefactory::generated::RecipeStep_initialize_ex(sample, RTI_FALSE, RTI_FALSE); + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_sample( + endpoint_data, + &sample->stationController, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!RTICdrStream_deserializeLong( + stream, &sample->seconds)) { + goto fin; + } + + } + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + +RTIBool +RecipeStepPlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + RecipeStep **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_sample( + endpoint_data, (sample != NULL)?*sample:NULL, + stream, deserialize_encapsulation, deserialize_sample, + endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; + +} + + + + +RTIBool RecipeStepPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(skip_encapsulation) { + if (!RTICdrStream_skipEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (skip_sample) { + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!RTICdrStream_skipLong(stream)) { + goto fin; + } + + + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(skip_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +unsigned int +RecipeStepPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +unsigned int +RecipeStepPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_min_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +/* Returns the size of the sample in its serialized form (in bytes). + * It can also be an estimation in excess of the real buffer needed + * during a call to the serialize() function. + * The value reported does not have to include the space for the + * encapsulation flags. + */ +unsigned int +RecipeStepPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const RecipeStep * sample) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + if (sample) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_size( + endpoint_data,RTI_FALSE, encapsulation_id, + current_alignment, &sample->stationController); + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + + + + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + + +PRESTypePluginKeyKind +RecipeStepPlugin_get_key_kind(void) +{ + + return PRES_TYPEPLUGIN_NO_KEY; + +} + + +RTIBool +RecipeStepPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(serialize_key) { + + if (!::com::rti::chocolatefactory::generated::RecipeStepPlugin_serialize( + endpoint_data, + sample, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool RecipeStepPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!::com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_sample( + endpoint_data, sample, stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + +RTIBool RecipeStepPlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + RecipeStep **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_key_sample( + endpoint_data, (sample != NULL)?*sample:NULL, stream, + deserialize_encapsulation, deserialize_key, endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; +} + + + +unsigned int +RecipeStepPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int encapsulation_size = current_alignment; + + + unsigned int initial_alignment = current_alignment; + + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += ::com::rti::chocolatefactory::generated::RecipeStepPlugin_get_serialized_sample_max_size( + endpoint_data,RTI_FALSE, encapsulation_id, current_alignment); + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +RTIBool +RecipeStepPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (stream == NULL) goto fin; /* To avoid warnings */ + + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!::com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_sample( + endpoint_data, sample, stream, RTI_FALSE, + RTI_TRUE, endpoint_plugin_qos)) { + return RTI_FALSE; + } + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + +/* ------------------------------------------------------------------------ + * Plug-in Installation Methods + * ------------------------------------------------------------------------ */ + +/* -------------------------------------------------------------------------------------- + * Type ChocolateRecipe + * -------------------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +ChocolateRecipe* +ChocolateRecipePluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params){ + ChocolateRecipe *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, ChocolateRecipe); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_w_params(sample,alloc_params)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +ChocolateRecipe * +ChocolateRecipePluginSupport_create_data_ex(RTIBool allocate_pointers){ + ChocolateRecipe *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, ChocolateRecipe); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_ex(sample,allocate_pointers, RTI_TRUE)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +ChocolateRecipe * +ChocolateRecipePluginSupport_create_data(void) +{ + return ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_create_data_ex(RTI_TRUE); +} + + +void +ChocolateRecipePluginSupport_destroy_data_w_params( + ChocolateRecipe *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params) { + + ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_w_params(sample,dealloc_params); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +ChocolateRecipePluginSupport_destroy_data_ex( + ChocolateRecipe *sample,RTIBool deallocate_pointers) { + + ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_ex(sample,deallocate_pointers); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +ChocolateRecipePluginSupport_destroy_data( + ChocolateRecipe *sample) { + + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_destroy_data_ex(sample,RTI_TRUE); + +} + + +RTIBool +ChocolateRecipePluginSupport_copy_data( + ChocolateRecipe *dst, + const ChocolateRecipe *src) +{ + return ::com::rti::chocolatefactory::generated::ChocolateRecipe_copy(dst,src); +} + + +void +ChocolateRecipePluginSupport_print_data( + const ChocolateRecipe *sample, + const char *desc, + unsigned int indent_level) +{ + + + RTICdrType_printIndent(indent_level); + + if (desc != NULL) { + RTILog_debug("%s:\n", desc); + } else { + RTILog_debug("\n"); + } + + if (sample == NULL) { + RTILog_debug("NULL\n"); + return; + } + + + if (&sample->recipeName==NULL) { + RTICdrType_printString( + NULL, "recipeName", indent_level + 1); + } else { + RTICdrType_printString( + sample->recipeName, "recipeName", indent_level + 1); + } + + + if (&sample->steps == NULL) { + RTICdrType_printIndent(indent_level+1); + RTILog_debug("steps: NULL\n"); + } else { + + if (com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps) != NULL) { + RTICdrType_printArray( + com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps), + com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrTypePrintFunction)com::rti::chocolatefactory::generated::RecipeStepPluginSupport_print_data, + "steps", indent_level + 1); + } else { + RTICdrType_printPointerArray( + com::rti::chocolatefactory::generated::RecipeStepSeq_get_discontiguous_bufferI(&sample->steps), + com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + (RTICdrTypePrintFunction)com::rti::chocolatefactory::generated::RecipeStepPluginSupport_print_data, + "steps", indent_level + 1); + } + + } + + + +} + +ChocolateRecipe * +ChocolateRecipePluginSupport_create_key_ex(RTIBool allocate_pointers){ + ChocolateRecipe *key = NULL; + + RTIOsapiHeap_allocateStructure( + &key, ChocolateRecipeKeyHolder); + + ::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_ex(key,allocate_pointers,RTI_TRUE); + return key; +} + + +ChocolateRecipe * +ChocolateRecipePluginSupport_create_key(void) +{ + return ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_create_key_ex(RTI_TRUE); +} + + +void +ChocolateRecipePluginSupport_destroy_key_ex( + ChocolateRecipeKeyHolder *key,RTIBool deallocate_pointers) +{ + ::com::rti::chocolatefactory::generated::ChocolateRecipe_finalize_ex(key,deallocate_pointers); + + RTIOsapiHeap_freeStructure(key); +} + + +void +ChocolateRecipePluginSupport_destroy_key( + ChocolateRecipeKeyHolder *key) { + + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_destroy_key_ex(key,RTI_TRUE); + +} + + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + + + +PRESTypePluginParticipantData +ChocolateRecipePlugin_on_participant_attached( + void *registration_data, + const struct PRESTypePluginParticipantInfo *participant_info, + RTIBool top_level_registration, + void *container_plugin_context, + RTICdrTypeCode *type_code) +{ + + if (registration_data) {} /* To avoid warnings */ + if (participant_info) {} /* To avoid warnings */ + if (top_level_registration) {} /* To avoid warnings */ + if (container_plugin_context) {} /* To avoid warnings */ + if (type_code) {} /* To avoid warnings */ + return PRESTypePluginDefaultParticipantData_new(participant_info); + +} + + +void +ChocolateRecipePlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data) +{ + + PRESTypePluginDefaultParticipantData_delete(participant_data); +} + + +PRESTypePluginEndpointData +ChocolateRecipePlugin_on_endpoint_attached( + PRESTypePluginParticipantData participant_data, + const struct PRESTypePluginEndpointInfo *endpoint_info, + RTIBool top_level_registration, + void *containerPluginContext) +{ + PRESTypePluginEndpointData epd = NULL; + + unsigned int serializedSampleMaxSize; + + unsigned int serializedKeyMaxSize; + + if (top_level_registration) {} /* To avoid warnings */ + if (containerPluginContext) {} /* To avoid warnings */ + + + epd = PRESTypePluginDefaultEndpointData_new( + participant_data, + endpoint_info, + (PRESTypePluginDefaultEndpointDataCreateSampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_create_data, + (PRESTypePluginDefaultEndpointDataDestroySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_destroy_data, + (PRESTypePluginDefaultEndpointDataCreateKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_create_key, + (PRESTypePluginDefaultEndpointDataDestroyKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_destroy_key); + + if (epd == NULL) { + return NULL; + } + + serializedKeyMaxSize = ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_key_max_size( + epd,RTI_FALSE,RTI_CDR_ENCAPSULATION_ID_CDR_BE,0); + + if (!PRESTypePluginDefaultEndpointData_createMD5Stream( + epd,serializedKeyMaxSize)) + { + PRESTypePluginDefaultEndpointData_delete(epd); + return NULL; + } + + + + if (endpoint_info->endpointKind == PRES_TYPEPLUGIN_ENDPOINT_WRITER) { + serializedSampleMaxSize = ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_max_size( + epd,RTI_FALSE,RTI_CDR_ENCAPSULATION_ID_CDR_BE,0); + + PRESTypePluginDefaultEndpointData_setMaxSizeSerializedSample(epd, serializedSampleMaxSize); + + if (PRESTypePluginDefaultEndpointData_createWriterPool( + epd, + endpoint_info, + (PRESTypePluginGetSerializedSampleMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_max_size, epd, + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_size, + epd) == RTI_FALSE) { + PRESTypePluginDefaultEndpointData_delete(epd); + return NULL; + } + } + + + + return epd; +} + + +void +ChocolateRecipePlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data) +{ + + PRESTypePluginDefaultEndpointData_delete(endpoint_data); +} + + +void +ChocolateRecipePlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + void *handle) +{ + + ChocolateRecipe_finalize_optional_members(sample, RTI_TRUE); + + PRESTypePluginDefaultEndpointData_returnSample( + endpoint_data, sample, handle); +} + + + +RTIBool +ChocolateRecipePlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *dst, + const ChocolateRecipe *src) +{ + if (endpoint_data) {} /* To avoid warnings */ + return ::com::rti::chocolatefactory::generated::ChocolateRecipePluginSupport_copy_data(dst,src); +} + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +unsigned int +ChocolateRecipePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + + +RTIBool +ChocolateRecipePlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + RTIBool retval = RTI_TRUE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(serialize_sample) { + + if (!RTICdrStream_serializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + if (com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps) != NULL) { + if (!RTICdrStream_serializeNonPrimitiveSequence( + stream, + com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps), + com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + ((com::rti::chocolatefactory::generated::MAX_RECIPE_STEPS)), + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrStreamSerializeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_serialize, + RTI_FALSE, encapsulation_id,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + return RTI_FALSE; + } + } else { + if (!RTICdrStream_serializeNonPrimitivePointerSequence( + stream, + (const void **)com::rti::chocolatefactory::generated::RecipeStepSeq_get_discontiguous_bufferI(&sample->steps), + com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + ((com::rti::chocolatefactory::generated::MAX_RECIPE_STEPS)), + (RTICdrStreamSerializeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_serialize, + RTI_FALSE, encapsulation_id,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + return RTI_FALSE; + } + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return retval; +} + + +RTIBool +ChocolateRecipePlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(deserialize_sample) { + ::com::rti::chocolatefactory::generated::ChocolateRecipe_initialize_ex(sample, RTI_FALSE, RTI_FALSE); + + if (!RTICdrStream_deserializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps) != NULL) { + if (!RTICdrStream_deserializeNonPrimitiveSequence( + stream, + com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps), + &sequence_length, + com::rti::chocolatefactory::generated::RecipeStepSeq_get_maximum(&sample->steps), + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrStreamDeserializeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_sample, + RTI_FALSE,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + goto fin; + } + } else { + if (!RTICdrStream_deserializeNonPrimitivePointerSequence( + stream, + (void **)com::rti::chocolatefactory::generated::RecipeStepSeq_get_discontiguous_bufferI(&sample->steps), + &sequence_length, + com::rti::chocolatefactory::generated::RecipeStepSeq_get_maximum(&sample->steps), + (RTICdrStreamDeserializeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_deserialize_sample, + RTI_FALSE,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + goto fin; + } + } + if (!com::rti::chocolatefactory::generated::RecipeStepSeq_set_length( + &sample->steps, sequence_length)) { + return RTI_FALSE; + } + } + + + } + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + +RTIBool +ChocolateRecipePlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_deserialize_sample( + endpoint_data, (sample != NULL)?*sample:NULL, + stream, deserialize_encapsulation, deserialize_sample, + endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; + +} + + + + +RTIBool ChocolateRecipePlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(skip_encapsulation) { + if (!RTICdrStream_skipEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (skip_sample) { + + if (!RTICdrStream_skipString(stream, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipNonPrimitiveSequence( + stream, + &sequence_length, + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrStreamSkipFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_skip, + RTI_FALSE,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + goto fin; + } + } + + + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(skip_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +unsigned int +ChocolateRecipePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getStringMaxSizeSerialized( + current_alignment, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1); + + + current_alignment += RTICdrType_getNonPrimitiveSequenceMaxSizeSerialized( + current_alignment, ((com::rti::chocolatefactory::generated::MAX_RECIPE_STEPS)), + com::rti::chocolatefactory::generated::RecipeStepPlugin_get_serialized_sample_max_size,RTI_FALSE,encapsulation_id,endpoint_data); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +unsigned int +ChocolateRecipePlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getStringMaxSizeSerialized( + current_alignment, 1); + + + current_alignment += RTICdrType_getNonPrimitiveSequenceMaxSizeSerialized( + current_alignment, 0, + com::rti::chocolatefactory::generated::RecipeStepPlugin_get_serialized_sample_min_size,RTI_FALSE,encapsulation_id,endpoint_data); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +/* Returns the size of the sample in its serialized form (in bytes). + * It can also be an estimation in excess of the real buffer needed + * during a call to the serialize() function. + * The value reported does not have to include the space for the + * encapsulation flags. + */ +unsigned int +ChocolateRecipePlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const ChocolateRecipe * sample) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + if (sample) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getStringSerializedSize( + current_alignment, sample->recipeName); + + + if (com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps) != NULL) { + current_alignment += RTICdrStream_getNonPrimitiveSequenceSerializedSize( + current_alignment, com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrTypeGetSerializedSampleSizeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_get_serialized_sample_size, + RTI_FALSE,encapsulation_id, + com::rti::chocolatefactory::generated::RecipeStepSeq_get_contiguous_bufferI(&sample->steps), + endpoint_data); + } else { + current_alignment += RTICdrStream_getNonPrimitivePointerSequenceSerializedSize( + current_alignment, com::rti::chocolatefactory::generated::RecipeStepSeq_get_length(&sample->steps), + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrTypeGetSerializedSampleSizeFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_get_serialized_sample_size, + RTI_FALSE,encapsulation_id, + (const void **)com::rti::chocolatefactory::generated::RecipeStepSeq_get_discontiguous_bufferI(&sample->steps), + endpoint_data); + } + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + + + + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + + +PRESTypePluginKeyKind +ChocolateRecipePlugin_get_key_kind(void) +{ + + return PRES_TYPEPLUGIN_USER_KEY; + +} + + +RTIBool +ChocolateRecipePlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(serialize_key) { + + if (!RTICdrStream_serializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool ChocolateRecipePlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!RTICdrStream_deserializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + +RTIBool ChocolateRecipePlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_deserialize_key_sample( + endpoint_data, (sample != NULL)?*sample:NULL, stream, + deserialize_encapsulation, deserialize_key, endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; +} + + + +unsigned int +ChocolateRecipePlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int encapsulation_size = current_alignment; + + + unsigned int initial_alignment = current_alignment; + + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getStringMaxSizeSerialized( + current_alignment, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +RTIBool +ChocolateRecipePlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if (stream == NULL) goto fin; /* To avoid warnings */ + + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!RTICdrStream_deserializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipNonPrimitiveSequence( + stream, + &sequence_length, + sizeof(com::rti::chocolatefactory::generated::RecipeStep), + (RTICdrStreamSkipFunction)com::rti::chocolatefactory::generated::RecipeStepPlugin_skip, + RTI_FALSE,RTI_TRUE, + endpoint_data,endpoint_plugin_qos)) { + goto fin; + } + } + + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + + +RTIBool +ChocolateRecipePlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipeKeyHolder *dst, + const ChocolateRecipe *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyString( + dst->recipeName, src->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +ChocolateRecipePlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *dst, const + ChocolateRecipeKeyHolder *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyString( + dst->recipeName, src->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +ChocolateRecipePlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const ChocolateRecipe *instance) +{ + struct RTICdrStream * md5Stream = NULL; + + md5Stream = PRESTypePluginDefaultEndpointData_getMD5Stream(endpoint_data); + + if (md5Stream == NULL) { + return RTI_FALSE; + } + + RTIOsapiMemory_zero( + RTICdrStream_getBuffer(md5Stream), + RTICdrStream_getBufferLength(md5Stream)); + RTICdrStream_resetPosition(md5Stream); + RTICdrStream_setDirtyBit(md5Stream, RTI_TRUE); + + if (!::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_serialize_key( + endpoint_data,instance,md5Stream, RTI_FALSE, RTI_CDR_ENCAPSULATION_ID_CDR_BE, RTI_TRUE,NULL)) { + return RTI_FALSE; + } + + if (PRESTypePluginDefaultEndpointData_getMaxSizeSerializedKey(endpoint_data) > (unsigned int)(MIG_RTPS_KEY_HASH_MAX_LENGTH)) { + RTICdrStream_computeMD5(md5Stream, keyhash->value); + } else { + RTIOsapiMemory_zero(keyhash->value,MIG_RTPS_KEY_HASH_MAX_LENGTH); + RTIOsapiMemory_copy( + keyhash->value, + RTICdrStream_getBuffer(md5Stream), + RTICdrStream_getCurrentPositionOffset(md5Stream)); + } + + keyhash->length = MIG_RTPS_KEY_HASH_MAX_LENGTH; + return RTI_TRUE; +} + + +RTIBool +ChocolateRecipePlugin_serialized_sample_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + DDS_KeyHash_t *keyhash, + RTIBool deserialize_encapsulation, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + ChocolateRecipe * sample = NULL; + + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if (stream == NULL) goto fin; /* To avoid warnings */ + + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + } + + + sample = (ChocolateRecipe *) + PRESTypePluginDefaultEndpointData_getTempSample(endpoint_data); + + if (sample == NULL) { + return RTI_FALSE; + } + + + if (!RTICdrStream_deserializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + if (!::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_instance_to_keyhash( + endpoint_data, keyhash, sample)) { + return RTI_FALSE; + } + + return RTI_TRUE; +} + + +/* ------------------------------------------------------------------------ + * Plug-in Installation Methods + * ------------------------------------------------------------------------ */ + +struct PRESTypePlugin *ChocolateRecipePlugin_new(void) +{ + struct PRESTypePlugin *plugin = NULL; + const struct PRESTypePluginVersion PLUGIN_VERSION = + PRES_TYPE_PLUGIN_VERSION_2_0; + + RTIOsapiHeap_allocateStructure( + &plugin, struct PRESTypePlugin); + if (plugin == NULL) { + return NULL; + } + + plugin->version = PLUGIN_VERSION; + + /* set up parent's function pointers */ + plugin->onParticipantAttached = + (PRESTypePluginOnParticipantAttachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_on_participant_attached; + plugin->onParticipantDetached = + (PRESTypePluginOnParticipantDetachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_on_participant_detached; + plugin->onEndpointAttached = + (PRESTypePluginOnEndpointAttachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_on_endpoint_attached; + plugin->onEndpointDetached = + (PRESTypePluginOnEndpointDetachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_on_endpoint_detached; + + plugin->copySampleFnc = + (PRESTypePluginCopySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_copy_sample; + plugin->createSampleFnc = + (PRESTypePluginCreateSampleFunction) + ChocolateRecipePlugin_create_sample; + plugin->destroySampleFnc = + (PRESTypePluginDestroySampleFunction) + ChocolateRecipePlugin_destroy_sample; + + plugin->serializeFnc = + (PRESTypePluginSerializeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_serialize; + plugin->deserializeFnc = + (PRESTypePluginDeserializeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_deserialize; + plugin->getSerializedSampleMaxSizeFnc = + (PRESTypePluginGetSerializedSampleMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_max_size; + plugin->getSerializedSampleMinSizeFnc = + (PRESTypePluginGetSerializedSampleMinSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_min_size; + + + plugin->getSampleFnc = + (PRESTypePluginGetSampleFunction) + ChocolateRecipePlugin_get_sample; + plugin->returnSampleFnc = + (PRESTypePluginReturnSampleFunction) + ChocolateRecipePlugin_return_sample; + + plugin->getKeyKindFnc = + (PRESTypePluginGetKeyKindFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_key_kind; + + + plugin->getSerializedKeyMaxSizeFnc = + (PRESTypePluginGetSerializedKeyMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_key_max_size; + plugin->serializeKeyFnc = + (PRESTypePluginSerializeKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_serialize_key; + plugin->deserializeKeyFnc = + (PRESTypePluginDeserializeKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_deserialize_key; + plugin->deserializeKeySampleFnc = + (PRESTypePluginDeserializeKeySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_deserialize_key_sample; + + plugin->instanceToKeyHashFnc = + (PRESTypePluginInstanceToKeyHashFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_instance_to_keyhash; + plugin->serializedSampleToKeyHashFnc = + (PRESTypePluginSerializedSampleToKeyHashFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_serialized_sample_to_keyhash; + + plugin->getKeyFnc = + (PRESTypePluginGetKeyFunction) + ChocolateRecipePlugin_get_key; + plugin->returnKeyFnc = + (PRESTypePluginReturnKeyFunction) + ChocolateRecipePlugin_return_key; + + plugin->instanceToKeyFnc = + (PRESTypePluginInstanceToKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_instance_to_key; + plugin->keyToInstanceFnc = + (PRESTypePluginKeyToInstanceFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_key_to_instance; + plugin->serializedKeyToKeyHashFnc = NULL; /* Not supported yet */ + + plugin->typeCode = (struct RTICdrTypeCode *)::com::rti::chocolatefactory::generated::ChocolateRecipe_get_typecode(); + + plugin->languageKind = PRES_TYPEPLUGIN_DDS_TYPE; + + /* Serialized buffer */ + plugin->getBuffer = + (PRESTypePluginGetBufferFunction) + ChocolateRecipePlugin_get_buffer; + plugin->returnBuffer = + (PRESTypePluginReturnBufferFunction) + ChocolateRecipePlugin_return_buffer; + plugin->getSerializedSampleSizeFnc = + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_get_serialized_sample_size; + + plugin->endpointTypeName = ChocolateRecipeTYPENAME; + + return plugin; +} + +void +ChocolateRecipePlugin_delete(struct PRESTypePlugin *plugin) +{ + RTIOsapiHeap_freeStructure(plugin); +} + +/* -------------------------------------------------------------------------------------- + * Type ChocolateLotState + * -------------------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +ChocolateLotState* +ChocolateLotStatePluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params){ + ChocolateLotState *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, ChocolateLotState); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_w_params(sample,alloc_params)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +ChocolateLotState * +ChocolateLotStatePluginSupport_create_data_ex(RTIBool allocate_pointers){ + ChocolateLotState *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, ChocolateLotState); + + if(sample != NULL) { + if (!::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_ex(sample,allocate_pointers, RTI_TRUE)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +ChocolateLotState * +ChocolateLotStatePluginSupport_create_data(void) +{ + return ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_create_data_ex(RTI_TRUE); +} + + +void +ChocolateLotStatePluginSupport_destroy_data_w_params( + ChocolateLotState *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params) { + + ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_w_params(sample,dealloc_params); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +ChocolateLotStatePluginSupport_destroy_data_ex( + ChocolateLotState *sample,RTIBool deallocate_pointers) { + + ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_ex(sample,deallocate_pointers); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +ChocolateLotStatePluginSupport_destroy_data( + ChocolateLotState *sample) { + + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_destroy_data_ex(sample,RTI_TRUE); + +} + + +RTIBool +ChocolateLotStatePluginSupport_copy_data( + ChocolateLotState *dst, + const ChocolateLotState *src) +{ + return ::com::rti::chocolatefactory::generated::ChocolateLotState_copy(dst,src); +} + + +void +ChocolateLotStatePluginSupport_print_data( + const ChocolateLotState *sample, + const char *desc, + unsigned int indent_level) +{ + + + RTICdrType_printIndent(indent_level); + + if (desc != NULL) { + RTILog_debug("%s:\n", desc); + } else { + RTILog_debug("\n"); + } + + if (sample == NULL) { + RTILog_debug("NULL\n"); + return; + } + + + RTICdrType_printLong( + &sample->lotID, "lotID", indent_level + 1); + + + com::rti::chocolatefactory::generated::StationControllerKindPluginSupport_print_data( + &sample->controller, "controller", indent_level + 1); + + + if (&sample->recipeName==NULL) { + RTICdrType_printString( + NULL, "recipeName", indent_level + 1); + } else { + RTICdrType_printString( + sample->recipeName, "recipeName", indent_level + 1); + } + + + com::rti::chocolatefactory::generated::StationControllerKindPluginSupport_print_data( + &sample->nextController, "nextController", indent_level + 1); + + + com::rti::chocolatefactory::generated::LotStatusKindPluginSupport_print_data( + &sample->lotStatus, "lotStatus", indent_level + 1); + + + if (&sample->ingredients == NULL) { + RTICdrType_printIndent(indent_level+1); + RTILog_debug("ingredients: NULL\n"); + } else { + + if (DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients) != NULL) { + RTICdrType_printStringArray( + DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + "ingredients", indent_level + 1, + RTI_CDR_CHAR_TYPE); + } else { + RTICdrType_printStringPointerArray( + DDS_StringSeq_get_discontiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + "ingredients", indent_level + 1, + RTI_CDR_CHAR_TYPE); + } + + } + + + +} + +ChocolateLotState * +ChocolateLotStatePluginSupport_create_key_ex(RTIBool allocate_pointers){ + ChocolateLotState *key = NULL; + + RTIOsapiHeap_allocateStructure( + &key, ChocolateLotStateKeyHolder); + + ::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_ex(key,allocate_pointers,RTI_TRUE); + return key; +} + + +ChocolateLotState * +ChocolateLotStatePluginSupport_create_key(void) +{ + return ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_create_key_ex(RTI_TRUE); +} + + +void +ChocolateLotStatePluginSupport_destroy_key_ex( + ChocolateLotStateKeyHolder *key,RTIBool deallocate_pointers) +{ + ::com::rti::chocolatefactory::generated::ChocolateLotState_finalize_ex(key,deallocate_pointers); + + RTIOsapiHeap_freeStructure(key); +} + + +void +ChocolateLotStatePluginSupport_destroy_key( + ChocolateLotStateKeyHolder *key) { + + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_destroy_key_ex(key,RTI_TRUE); + +} + + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + + + +PRESTypePluginParticipantData +ChocolateLotStatePlugin_on_participant_attached( + void *registration_data, + const struct PRESTypePluginParticipantInfo *participant_info, + RTIBool top_level_registration, + void *container_plugin_context, + RTICdrTypeCode *type_code) +{ + + if (registration_data) {} /* To avoid warnings */ + if (participant_info) {} /* To avoid warnings */ + if (top_level_registration) {} /* To avoid warnings */ + if (container_plugin_context) {} /* To avoid warnings */ + if (type_code) {} /* To avoid warnings */ + return PRESTypePluginDefaultParticipantData_new(participant_info); + +} + + +void +ChocolateLotStatePlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data) +{ + + PRESTypePluginDefaultParticipantData_delete(participant_data); +} + + +PRESTypePluginEndpointData +ChocolateLotStatePlugin_on_endpoint_attached( + PRESTypePluginParticipantData participant_data, + const struct PRESTypePluginEndpointInfo *endpoint_info, + RTIBool top_level_registration, + void *containerPluginContext) +{ + PRESTypePluginEndpointData epd = NULL; + + unsigned int serializedSampleMaxSize; + + unsigned int serializedKeyMaxSize; + + if (top_level_registration) {} /* To avoid warnings */ + if (containerPluginContext) {} /* To avoid warnings */ + + + epd = PRESTypePluginDefaultEndpointData_new( + participant_data, + endpoint_info, + (PRESTypePluginDefaultEndpointDataCreateSampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_create_data, + (PRESTypePluginDefaultEndpointDataDestroySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_destroy_data, + (PRESTypePluginDefaultEndpointDataCreateKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_create_key, + (PRESTypePluginDefaultEndpointDataDestroyKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_destroy_key); + + if (epd == NULL) { + return NULL; + } + + serializedKeyMaxSize = ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_key_max_size( + epd,RTI_FALSE,RTI_CDR_ENCAPSULATION_ID_CDR_BE,0); + + if (!PRESTypePluginDefaultEndpointData_createMD5Stream( + epd,serializedKeyMaxSize)) + { + PRESTypePluginDefaultEndpointData_delete(epd); + return NULL; + } + + + + if (endpoint_info->endpointKind == PRES_TYPEPLUGIN_ENDPOINT_WRITER) { + serializedSampleMaxSize = ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_max_size( + epd,RTI_FALSE,RTI_CDR_ENCAPSULATION_ID_CDR_BE,0); + + PRESTypePluginDefaultEndpointData_setMaxSizeSerializedSample(epd, serializedSampleMaxSize); + + if (PRESTypePluginDefaultEndpointData_createWriterPool( + epd, + endpoint_info, + (PRESTypePluginGetSerializedSampleMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_max_size, epd, + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_size, + epd) == RTI_FALSE) { + PRESTypePluginDefaultEndpointData_delete(epd); + return NULL; + } + } + + + + return epd; +} + + +void +ChocolateLotStatePlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data) +{ + + PRESTypePluginDefaultEndpointData_delete(endpoint_data); +} + + +void +ChocolateLotStatePlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + void *handle) +{ + + ChocolateLotState_finalize_optional_members(sample, RTI_TRUE); + + PRESTypePluginDefaultEndpointData_returnSample( + endpoint_data, sample, handle); +} + + + +RTIBool +ChocolateLotStatePlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *dst, + const ChocolateLotState *src) +{ + if (endpoint_data) {} /* To avoid warnings */ + return ::com::rti::chocolatefactory::generated::ChocolateLotStatePluginSupport_copy_data(dst,src); +} + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +unsigned int +ChocolateLotStatePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + + +RTIBool +ChocolateLotStatePlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + RTIBool retval = RTI_TRUE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(serialize_sample) { + + if (!RTICdrStream_serializeLong( + stream, &sample->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialize( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + if (!RTICdrStream_serializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialize( + endpoint_data, + &sample->nextController, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKindPlugin_serialize( + endpoint_data, + &sample->lotStatus, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + if (DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients) != NULL) { + if (!RTICdrStream_serializeStringSequence( + stream, + DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + ((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST)), + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)) { + return RTI_FALSE; + } + } else { + if (!RTICdrStream_serializeStringPointerSequence( + stream, + (const void **)DDS_StringSeq_get_discontiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + ((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST)), + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)) { + return RTI_FALSE; + } + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return retval; +} + + +RTIBool +ChocolateLotStatePlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + + if(deserialize_sample) { + ::com::rti::chocolatefactory::generated::ChocolateLotState_initialize_ex(sample, RTI_FALSE, RTI_FALSE); + + if (!RTICdrStream_deserializeLong( + stream, &sample->lotID)) { + goto fin; + } + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_sample( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!RTICdrStream_deserializeString( + stream, sample->recipeName, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_sample( + endpoint_data, + &sample->nextController, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKindPlugin_deserialize_sample( + endpoint_data, + &sample->lotStatus, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients) != NULL) { + if (!RTICdrStream_deserializeStringSequence( + stream, + DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients), + &sequence_length, + DDS_StringSeq_get_maximum(&sample->ingredients), + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)){ + goto fin; + } + } else { + if (!RTICdrStream_deserializeStringPointerSequence( + stream, + (void **)DDS_StringSeq_get_discontiguous_bufferI(&sample->ingredients), + &sequence_length, + DDS_StringSeq_get_maximum(&sample->ingredients), + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)){ + goto fin; + } + } + if (!DDS_StringSeq_set_length(&sample->ingredients, sequence_length)) { + return RTI_FALSE; + } + } + + + } + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + +RTIBool +ChocolateLotStatePlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos) +{ + + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_deserialize_sample( + endpoint_data, (sample != NULL)?*sample:NULL, + stream, deserialize_encapsulation, deserialize_sample, + endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; + +} + + + + +RTIBool ChocolateLotStatePlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(skip_encapsulation) { + if (!RTICdrStream_skipEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (skip_sample) { + + if (!RTICdrStream_skipLong(stream)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!RTICdrStream_skipString(stream, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipStringSequence( + stream, + &sequence_length, + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)){ + goto fin; + } + } + + + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(skip_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +unsigned int +ChocolateLotStatePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getStringMaxSizeSerialized( + current_alignment, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_max_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_max_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getStringSequenceMaxSizeSerialized( + current_alignment,((com::rti::chocolatefactory::generated::MAX_INGREDIENT_LIST)),((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1,RTI_CDR_CHAR_TYPE); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +unsigned int +ChocolateLotStatePlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_min_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getStringMaxSizeSerialized( + current_alignment, 1); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_min_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_min_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + current_alignment += RTICdrType_getStringSequenceMaxSizeSerialized( + current_alignment,0,1,RTI_CDR_CHAR_TYPE); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +/* Returns the size of the sample in its serialized form (in bytes). + * It can also be an estimation in excess of the real buffer needed + * during a call to the serialize() function. + * The value reported does not have to include the space for the + * encapsulation flags. + */ +unsigned int +ChocolateLotStatePlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const ChocolateLotState * sample) +{ + + unsigned int initial_alignment = current_alignment; + + unsigned int encapsulation_size = current_alignment; + + if (endpoint_data) {} /* To avoid warnings */ + if (sample) {} /* To avoid warnings */ + + + if (include_encapsulation) { + + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_size( + endpoint_data,RTI_FALSE, encapsulation_id, + current_alignment, &sample->controller); + + + current_alignment += RTICdrType_getStringSerializedSize( + current_alignment, sample->recipeName); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_sample_size( + endpoint_data,RTI_FALSE, encapsulation_id, + current_alignment, &sample->nextController); + + + current_alignment += com::rti::chocolatefactory::generated::LotStatusKindPlugin_get_serialized_sample_size( + endpoint_data,RTI_FALSE, encapsulation_id, + current_alignment, &sample->lotStatus); + + + if (DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients) != NULL) { + current_alignment += RTICdrStream_getStringSequenceSerializedSize( + current_alignment, + DDS_StringSeq_get_contiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + RTI_CDR_CHAR_TYPE); + } else { + current_alignment += RTICdrStream_getStringPointerSequenceSerializedSize( + current_alignment, + (const void **)DDS_StringSeq_get_discontiguous_bufferI(&sample->ingredients), + DDS_StringSeq_get_length(&sample->ingredients), + RTI_CDR_CHAR_TYPE); + } + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + + + + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + + +PRESTypePluginKeyKind +ChocolateLotStatePlugin_get_key_kind(void) +{ + + return PRES_TYPEPLUGIN_USER_KEY; + +} + + +RTIBool +ChocolateLotStatePlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(serialize_encapsulation) { + + if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if(serialize_key) { + + if (!RTICdrStream_serializeLong( + stream, &sample->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialize_key( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, encapsulation_id, + RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool ChocolateLotStatePlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if(deserialize_encapsulation) { + /* Deserialize encapsulation */ + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!RTICdrStream_deserializeLong( + stream, &sample->lotID)) { + return RTI_FALSE; + } + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_deserialize_key_sample( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + +RTIBool ChocolateLotStatePlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + RTIBool result; + if (drop_sample) {} /* To avoid warnings */ + + stream->_xTypesState.unassignable = RTI_FALSE; + + result = ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_deserialize_key_sample( + endpoint_data, (sample != NULL)?*sample:NULL, stream, + deserialize_encapsulation, deserialize_key, endpoint_plugin_qos); + + if (result) { + if (stream->_xTypesState.unassignable) { + result = RTI_FALSE; + } + } + + return result; +} + + + +unsigned int +ChocolateLotStatePlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment) +{ + + unsigned int encapsulation_size = current_alignment; + + + unsigned int initial_alignment = current_alignment; + + + if (endpoint_data) {} /* To avoid warnings */ + + + if (include_encapsulation) { + if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) { + return 1; + } + + + RTICdrStream_getEncapsulationSize(encapsulation_size); + encapsulation_size -= current_alignment; + current_alignment = 0; + initial_alignment = 0; + + } + + + current_alignment += RTICdrType_getLongMaxSizeSerialized( + current_alignment); + + + current_alignment += com::rti::chocolatefactory::generated::StationControllerKindPlugin_get_serialized_key_max_size( + endpoint_data,RTI_FALSE,encapsulation_id,current_alignment); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +RTIBool +ChocolateLotStatePlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + + if (endpoint_data) {} /* To avoid warnings */ + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + if (stream == NULL) goto fin; /* To avoid warnings */ + + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + + } + + if (deserialize_key) { + + if (!RTICdrStream_deserializeLong( + stream, &sample->lotID)) { + return RTI_FALSE; + } + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialized_sample_to_key( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + if (!RTICdrStream_skipString(stream, ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + if (!com::rti::chocolatefactory::generated::LotStatusKindPlugin_skip( + endpoint_data, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipStringSequence( + stream, + &sequence_length, + ((com::rti::chocolatefactory::generated::MAX_STRING_LENGTH)) + 1, + RTI_CDR_CHAR_TYPE)){ + goto fin; + } + } + + + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + + + +RTIBool +ChocolateLotStatePlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotStateKeyHolder *dst, + const ChocolateLotState *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyLong( + &dst->lotID, &src->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_copy( + &dst->controller, &src->controller)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +ChocolateLotStatePlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *dst, const + ChocolateLotStateKeyHolder *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyLong( + &dst->lotID, &src->lotID)) { + return RTI_FALSE; + } + + + if (!com::rti::chocolatefactory::generated::StationControllerKind_copy( + &dst->controller, &src->controller)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +ChocolateLotStatePlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const ChocolateLotState *instance) +{ + struct RTICdrStream * md5Stream = NULL; + + md5Stream = PRESTypePluginDefaultEndpointData_getMD5Stream(endpoint_data); + + if (md5Stream == NULL) { + return RTI_FALSE; + } + + RTIOsapiMemory_zero( + RTICdrStream_getBuffer(md5Stream), + RTICdrStream_getBufferLength(md5Stream)); + RTICdrStream_resetPosition(md5Stream); + RTICdrStream_setDirtyBit(md5Stream, RTI_TRUE); + + if (!::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_serialize_key( + endpoint_data,instance,md5Stream, RTI_FALSE, RTI_CDR_ENCAPSULATION_ID_CDR_BE, RTI_TRUE,NULL)) { + return RTI_FALSE; + } + + if (PRESTypePluginDefaultEndpointData_getMaxSizeSerializedKey(endpoint_data) > (unsigned int)(MIG_RTPS_KEY_HASH_MAX_LENGTH)) { + RTICdrStream_computeMD5(md5Stream, keyhash->value); + } else { + RTIOsapiMemory_zero(keyhash->value,MIG_RTPS_KEY_HASH_MAX_LENGTH); + RTIOsapiMemory_copy( + keyhash->value, + RTICdrStream_getBuffer(md5Stream), + RTICdrStream_getCurrentPositionOffset(md5Stream)); + } + + keyhash->length = MIG_RTPS_KEY_HASH_MAX_LENGTH; + return RTI_TRUE; +} + + +RTIBool +ChocolateLotStatePlugin_serialized_sample_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + DDS_KeyHash_t *keyhash, + RTIBool deserialize_encapsulation, + void *endpoint_plugin_qos) +{ + char * position = NULL; + + RTIBool done = RTI_FALSE; + ChocolateLotState * sample = NULL; + + if (endpoint_plugin_qos) {} /* To avoid warnings */ + + + if (stream == NULL) goto fin; /* To avoid warnings */ + + + if(deserialize_encapsulation) { + if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) { + return RTI_FALSE; + } + + position = RTICdrStream_resetAlignment(stream); + } + + + sample = (ChocolateLotState *) + PRESTypePluginDefaultEndpointData_getTempSample(endpoint_data); + + if (sample == NULL) { + return RTI_FALSE; + } + + + if (!RTICdrStream_deserializeLong( + stream, &sample->lotID)) { + return RTI_FALSE; + } + + if (!com::rti::chocolatefactory::generated::StationControllerKindPlugin_serialized_sample_to_key( + endpoint_data, + &sample->controller, + stream, + RTI_FALSE, RTI_TRUE, + endpoint_plugin_qos)) { + return RTI_FALSE; + } + + + done = RTI_TRUE; +fin: + if (done != RTI_TRUE && + RTICdrStream_getRemainder(stream) >= + RTI_CDR_PARAMETER_HEADER_ALIGNMENT) { + return RTI_FALSE; + } + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + if (!::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_instance_to_keyhash( + endpoint_data, keyhash, sample)) { + return RTI_FALSE; + } + + return RTI_TRUE; +} + + +/* ------------------------------------------------------------------------ + * Plug-in Installation Methods + * ------------------------------------------------------------------------ */ + +struct PRESTypePlugin *ChocolateLotStatePlugin_new(void) +{ + struct PRESTypePlugin *plugin = NULL; + const struct PRESTypePluginVersion PLUGIN_VERSION = + PRES_TYPE_PLUGIN_VERSION_2_0; + + RTIOsapiHeap_allocateStructure( + &plugin, struct PRESTypePlugin); + if (plugin == NULL) { + return NULL; + } + + plugin->version = PLUGIN_VERSION; + + /* set up parent's function pointers */ + plugin->onParticipantAttached = + (PRESTypePluginOnParticipantAttachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_on_participant_attached; + plugin->onParticipantDetached = + (PRESTypePluginOnParticipantDetachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_on_participant_detached; + plugin->onEndpointAttached = + (PRESTypePluginOnEndpointAttachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_on_endpoint_attached; + plugin->onEndpointDetached = + (PRESTypePluginOnEndpointDetachedCallback) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_on_endpoint_detached; + + plugin->copySampleFnc = + (PRESTypePluginCopySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_copy_sample; + plugin->createSampleFnc = + (PRESTypePluginCreateSampleFunction) + ChocolateLotStatePlugin_create_sample; + plugin->destroySampleFnc = + (PRESTypePluginDestroySampleFunction) + ChocolateLotStatePlugin_destroy_sample; + + plugin->serializeFnc = + (PRESTypePluginSerializeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_serialize; + plugin->deserializeFnc = + (PRESTypePluginDeserializeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_deserialize; + plugin->getSerializedSampleMaxSizeFnc = + (PRESTypePluginGetSerializedSampleMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_max_size; + plugin->getSerializedSampleMinSizeFnc = + (PRESTypePluginGetSerializedSampleMinSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_min_size; + + + plugin->getSampleFnc = + (PRESTypePluginGetSampleFunction) + ChocolateLotStatePlugin_get_sample; + plugin->returnSampleFnc = + (PRESTypePluginReturnSampleFunction) + ChocolateLotStatePlugin_return_sample; + + plugin->getKeyKindFnc = + (PRESTypePluginGetKeyKindFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_key_kind; + + + plugin->getSerializedKeyMaxSizeFnc = + (PRESTypePluginGetSerializedKeyMaxSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_key_max_size; + plugin->serializeKeyFnc = + (PRESTypePluginSerializeKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_serialize_key; + plugin->deserializeKeyFnc = + (PRESTypePluginDeserializeKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_deserialize_key; + plugin->deserializeKeySampleFnc = + (PRESTypePluginDeserializeKeySampleFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_deserialize_key_sample; + + plugin->instanceToKeyHashFnc = + (PRESTypePluginInstanceToKeyHashFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_instance_to_keyhash; + plugin->serializedSampleToKeyHashFnc = + (PRESTypePluginSerializedSampleToKeyHashFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_serialized_sample_to_keyhash; + + plugin->getKeyFnc = + (PRESTypePluginGetKeyFunction) + ChocolateLotStatePlugin_get_key; + plugin->returnKeyFnc = + (PRESTypePluginReturnKeyFunction) + ChocolateLotStatePlugin_return_key; + + plugin->instanceToKeyFnc = + (PRESTypePluginInstanceToKeyFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_instance_to_key; + plugin->keyToInstanceFnc = + (PRESTypePluginKeyToInstanceFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_key_to_instance; + plugin->serializedKeyToKeyHashFnc = NULL; /* Not supported yet */ + + plugin->typeCode = (struct RTICdrTypeCode *)::com::rti::chocolatefactory::generated::ChocolateLotState_get_typecode(); + + plugin->languageKind = PRES_TYPEPLUGIN_DDS_TYPE; + + /* Serialized buffer */ + plugin->getBuffer = + (PRESTypePluginGetBufferFunction) + ChocolateLotStatePlugin_get_buffer; + plugin->returnBuffer = + (PRESTypePluginReturnBufferFunction) + ChocolateLotStatePlugin_return_buffer; + plugin->getSerializedSampleSizeFnc = + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_get_serialized_sample_size; + + plugin->endpointTypeName = ChocolateLotStateTYPENAME; + + return plugin; +} + +void +ChocolateLotStatePlugin_delete(struct PRESTypePlugin *plugin) +{ + RTIOsapiHeap_freeStructure(plugin); +} + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.h b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.h new file mode 100644 index 00000000..64452ac5 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.h @@ -0,0 +1,1002 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + +#ifndef ChocolateFactoryPlugin_1774920665_h +#define ChocolateFactoryPlugin_1774920665_h + +#include "ChocolateFactory.h" + + + +struct RTICdrStream; + +#ifndef pres_typePlugin_h +#include "pres/pres_typePlugin.h" +#endif + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) +/* If the code is building on Windows, start exporting symbols. +*/ +#undef NDDSUSERDllExport +#define NDDSUSERDllExport __declspec(dllexport) +#endif + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ + + +/* ------------------------------------------------------------------------ + * (De)Serialization Methods + * ------------------------------------------------------------------------ */ + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const StationControllerKind *sample, struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +StationControllerKindPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +StationControllerKindPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +StationControllerKindPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const StationControllerKind * sample); + + +/* ------------------------------------------------------------------------ + Key Management functions: + * ------------------------------------------------------------------------ */ + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +StationControllerKindPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +StationControllerKindPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + StationControllerKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + + + +/* ---------------------------------------------------------------------------- + Support functions: + * ---------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern void +StationControllerKindPluginSupport_print_data( + const StationControllerKind *sample, const char *desc, int indent_level); + + + +/* ------------------------------------------------------------------------ + * (De)Serialization Methods + * ------------------------------------------------------------------------ */ + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const LotStatusKind *sample, struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +LotStatusKindPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +LotStatusKindPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +LotStatusKindPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const LotStatusKind * sample); + + +/* ------------------------------------------------------------------------ + Key Management functions: + * ------------------------------------------------------------------------ */ + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +LotStatusKindPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +LotStatusKindPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + LotStatusKind *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + + + +/* ---------------------------------------------------------------------------- + Support functions: + * ---------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern void +LotStatusKindPluginSupport_print_data( + const LotStatusKind *sample, const char *desc, int indent_level); + + + +#define RecipeStepPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample +#define RecipeStepPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer +#define RecipeStepPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer + + +#define RecipeStepPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample +#define RecipeStepPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern RecipeStep* +RecipeStepPluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params); + +NDDSUSERDllExport extern RecipeStep* +RecipeStepPluginSupport_create_data_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern RecipeStep* +RecipeStepPluginSupport_create_data(void); + +NDDSUSERDllExport extern RTIBool +RecipeStepPluginSupport_copy_data( + RecipeStep *out, + const RecipeStep *in); + +NDDSUSERDllExport extern void +RecipeStepPluginSupport_destroy_data_w_params( + RecipeStep *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params); + +NDDSUSERDllExport extern void +RecipeStepPluginSupport_destroy_data_ex( + RecipeStep *sample,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +RecipeStepPluginSupport_destroy_data( + RecipeStep *sample); + +NDDSUSERDllExport extern void +RecipeStepPluginSupport_print_data( + const RecipeStep *sample, + const char *desc, + unsigned int indent); + + + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *out, + const RecipeStep *in); + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + RecipeStep **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + + + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +RecipeStepPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +RecipeStepPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +RecipeStepPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const RecipeStep * sample); + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginKeyKind +RecipeStepPlugin_get_key_kind(void); + +NDDSUSERDllExport extern unsigned int +RecipeStepPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + RecipeStep * sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + RecipeStep ** sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +RecipeStepPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + RecipeStep *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +/* The type used to store keys for instances of type struct + * ChocolateRecipe. + * + * By default, this type is struct ChocolateRecipe + * itself. However, if for some reason this choice is not practical for your + * system (e.g. if sizeof(struct ChocolateRecipe) + * is very large), you may redefine this typedef in terms of another type of + * your choosing. HOWEVER, if you define the KeyHolder type to be something + * other than struct ChocolateRecipe, the + * following restriction applies: the key of struct + * ChocolateRecipe must consist of a + * single field of your redefined KeyHolder type and that field must be the + * first field in struct ChocolateRecipe. +*/ +typedef class ChocolateRecipe ChocolateRecipeKeyHolder; + + +#define ChocolateRecipePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample +#define ChocolateRecipePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer +#define ChocolateRecipePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer + +#define ChocolateRecipePlugin_get_key PRESTypePluginDefaultEndpointData_getKey +#define ChocolateRecipePlugin_return_key PRESTypePluginDefaultEndpointData_returnKey + + +#define ChocolateRecipePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample +#define ChocolateRecipePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern ChocolateRecipe* +ChocolateRecipePluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params); + +NDDSUSERDllExport extern ChocolateRecipe* +ChocolateRecipePluginSupport_create_data_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern ChocolateRecipe* +ChocolateRecipePluginSupport_create_data(void); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePluginSupport_copy_data( + ChocolateRecipe *out, + const ChocolateRecipe *in); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_destroy_data_w_params( + ChocolateRecipe *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_destroy_data_ex( + ChocolateRecipe *sample,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_destroy_data( + ChocolateRecipe *sample); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_print_data( + const ChocolateRecipe *sample, + const char *desc, + unsigned int indent); + + +NDDSUSERDllExport extern ChocolateRecipe* +ChocolateRecipePluginSupport_create_key_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern ChocolateRecipe* +ChocolateRecipePluginSupport_create_key(void); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_destroy_key_ex( + ChocolateRecipeKeyHolder *key,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +ChocolateRecipePluginSupport_destroy_key( + ChocolateRecipeKeyHolder *key); + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginParticipantData +ChocolateRecipePlugin_on_participant_attached( + void *registration_data, + const struct PRESTypePluginParticipantInfo *participant_info, + RTIBool top_level_registration, + void *container_plugin_context, + RTICdrTypeCode *typeCode); + +NDDSUSERDllExport extern void +ChocolateRecipePlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data); + +NDDSUSERDllExport extern PRESTypePluginEndpointData +ChocolateRecipePlugin_on_endpoint_attached( + PRESTypePluginParticipantData participant_data, + const struct PRESTypePluginEndpointInfo *endpoint_info, + RTIBool top_level_registration, + void *container_plugin_context); + +NDDSUSERDllExport extern void +ChocolateRecipePlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data); + +NDDSUSERDllExport extern void +ChocolateRecipePlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + void *handle); + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *out, + const ChocolateRecipe *in); + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +ChocolateRecipePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +ChocolateRecipePlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +ChocolateRecipePlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const ChocolateRecipe * sample); + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginKeyKind +ChocolateRecipePlugin_get_key_kind(void); + +NDDSUSERDllExport extern unsigned int +ChocolateRecipePlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe * sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe ** sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipeKeyHolder *key, + const ChocolateRecipe *instance); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + ChocolateRecipe *instance, + const ChocolateRecipeKeyHolder *key); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const ChocolateRecipe *instance); + +NDDSUSERDllExport extern RTIBool +ChocolateRecipePlugin_serialized_sample_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + DDS_KeyHash_t *keyhash, + RTIBool deserialize_encapsulation, + void *endpoint_plugin_qos); + +/* Plugin Functions */ +NDDSUSERDllExport extern struct PRESTypePlugin* +ChocolateRecipePlugin_new(void); + +NDDSUSERDllExport extern void +ChocolateRecipePlugin_delete(struct PRESTypePlugin *); + +/* The type used to store keys for instances of type struct + * ChocolateLotState. + * + * By default, this type is struct ChocolateLotState + * itself. However, if for some reason this choice is not practical for your + * system (e.g. if sizeof(struct ChocolateLotState) + * is very large), you may redefine this typedef in terms of another type of + * your choosing. HOWEVER, if you define the KeyHolder type to be something + * other than struct ChocolateLotState, the + * following restriction applies: the key of struct + * ChocolateLotState must consist of a + * single field of your redefined KeyHolder type and that field must be the + * first field in struct ChocolateLotState. +*/ +typedef class ChocolateLotState ChocolateLotStateKeyHolder; + + +#define ChocolateLotStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample +#define ChocolateLotStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer +#define ChocolateLotStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer + +#define ChocolateLotStatePlugin_get_key PRESTypePluginDefaultEndpointData_getKey +#define ChocolateLotStatePlugin_return_key PRESTypePluginDefaultEndpointData_returnKey + + +#define ChocolateLotStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample +#define ChocolateLotStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern ChocolateLotState* +ChocolateLotStatePluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params); + +NDDSUSERDllExport extern ChocolateLotState* +ChocolateLotStatePluginSupport_create_data_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern ChocolateLotState* +ChocolateLotStatePluginSupport_create_data(void); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePluginSupport_copy_data( + ChocolateLotState *out, + const ChocolateLotState *in); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_destroy_data_w_params( + ChocolateLotState *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_destroy_data_ex( + ChocolateLotState *sample,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_destroy_data( + ChocolateLotState *sample); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_print_data( + const ChocolateLotState *sample, + const char *desc, + unsigned int indent); + + +NDDSUSERDllExport extern ChocolateLotState* +ChocolateLotStatePluginSupport_create_key_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern ChocolateLotState* +ChocolateLotStatePluginSupport_create_key(void); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_destroy_key_ex( + ChocolateLotStateKeyHolder *key,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +ChocolateLotStatePluginSupport_destroy_key( + ChocolateLotStateKeyHolder *key); + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginParticipantData +ChocolateLotStatePlugin_on_participant_attached( + void *registration_data, + const struct PRESTypePluginParticipantInfo *participant_info, + RTIBool top_level_registration, + void *container_plugin_context, + RTICdrTypeCode *typeCode); + +NDDSUSERDllExport extern void +ChocolateLotStatePlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data); + +NDDSUSERDllExport extern PRESTypePluginEndpointData +ChocolateLotStatePlugin_on_endpoint_attached( + PRESTypePluginParticipantData participant_data, + const struct PRESTypePluginEndpointInfo *endpoint_info, + RTIBool top_level_registration, + void *container_plugin_context); + +NDDSUSERDllExport extern void +ChocolateLotStatePlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data); + +NDDSUSERDllExport extern void +ChocolateLotStatePlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + void *handle); + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *out, + const ChocolateLotState *in); + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +ChocolateLotStatePlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +ChocolateLotStatePlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +ChocolateLotStatePlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const ChocolateLotState * sample); + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginKeyKind +ChocolateLotStatePlugin_get_key_kind(void); + +NDDSUSERDllExport extern unsigned int +ChocolateLotStatePlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState * sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState ** sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotStateKeyHolder *key, + const ChocolateLotState *instance); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + ChocolateLotState *instance, + const ChocolateLotStateKeyHolder *key); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const ChocolateLotState *instance); + +NDDSUSERDllExport extern RTIBool +ChocolateLotStatePlugin_serialized_sample_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + DDS_KeyHash_t *keyhash, + RTIBool deserialize_encapsulation, + void *endpoint_plugin_qos); + +/* Plugin Functions */ +NDDSUSERDllExport extern struct PRESTypePlugin* +ChocolateLotStatePlugin_new(void); + +NDDSUSERDllExport extern void +ChocolateLotStatePlugin_delete(struct PRESTypePlugin *); + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ + + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) +/* If the code is building on Windows, stop exporting symbols. +*/ +#undef NDDSUSERDllExport +#define NDDSUSERDllExport +#endif + +#endif /* ChocolateFactoryPlugin_1774920665_h */ diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.cxx b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.cxx new file mode 100644 index 00000000..24bf47de --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.cxx @@ -0,0 +1,279 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + +#include "ChocolateFactorySupport.h" +#include "ChocolateFactoryPlugin.h" + + + +#ifdef __cplusplus + #ifndef dds_c_log_impl_h + #include "dds_c/dds_c_log_impl.h" + #endif +#endif + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ + + + +/* ========================================================================= */ +/** + <> + + Defines: TData, + TDataWriter, + TDataReader, + TTypeSupport + + Configure and implement 'ChocolateRecipe' support classes. + + Note: Only the #defined classes get defined +*/ + +/* ----------------------------------------------------------------- */ +/* DDSDataWriter +*/ + +/** + <> + + Defines: TDataWriter, TData +*/ + +/* Requires */ +#define TTYPENAME ChocolateRecipeTYPENAME + +/* Defines */ +#define TDataWriter ChocolateRecipeDataWriter +#define TData ::com::rti::chocolatefactory::generated::ChocolateRecipe + + +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_data_TDataWriter.gen" +#else +#include "dds_c/generic/dds_c_data_TDataWriter.gen" +#endif + + +#undef TDataWriter +#undef TData + +#undef TTYPENAME + +/* ----------------------------------------------------------------- */ +/* DDSDataReader +*/ + +/** + <> + + Defines: TDataReader, TDataSeq, TData +*/ + +/* Requires */ +#define TTYPENAME ChocolateRecipeTYPENAME + +/* Defines */ +#define TDataReader ChocolateRecipeDataReader +#define TDataSeq ChocolateRecipeSeq +#define TData ::com::rti::chocolatefactory::generated::ChocolateRecipe + + +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_data_TDataReader.gen" +#else +#include "dds_c/generic/dds_c_data_TDataReader.gen" +#endif + + +#undef TDataReader +#undef TDataSeq +#undef TData + +#undef TTYPENAME + +/* ----------------------------------------------------------------- */ +/* TypeSupport + + <> + + Requires: TTYPENAME, + TPlugin_new + TPlugin_delete + Defines: TTypeSupport, TData, TDataReader, TDataWriter +*/ + +/* Requires */ +#define TTYPENAME ChocolateRecipeTYPENAME +#define TPlugin_new ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_new +#define TPlugin_delete ::com::rti::chocolatefactory::generated::ChocolateRecipePlugin_delete + +/* Defines */ +#define TTypeSupport ChocolateRecipeTypeSupport +#define TData ::com::rti::chocolatefactory::generated::ChocolateRecipe +#define TDataReader ChocolateRecipeDataReader +#define TDataWriter ChocolateRecipeDataWriter +#ifdef __cplusplus + + + +#include "dds_cpp/generic/dds_cpp_data_TTypeSupport.gen" + + + +#else +#include "dds_c/generic/dds_c_data_TTypeSupport.gen" +#endif +#undef TTypeSupport +#undef TData +#undef TDataReader +#undef TDataWriter + +#undef TTYPENAME +#undef TPlugin_new +#undef TPlugin_delete + + + + + +/* ========================================================================= */ +/** + <> + + Defines: TData, + TDataWriter, + TDataReader, + TTypeSupport + + Configure and implement 'ChocolateLotState' support classes. + + Note: Only the #defined classes get defined +*/ + +/* ----------------------------------------------------------------- */ +/* DDSDataWriter +*/ + +/** + <> + + Defines: TDataWriter, TData +*/ + +/* Requires */ +#define TTYPENAME ChocolateLotStateTYPENAME + +/* Defines */ +#define TDataWriter ChocolateLotStateDataWriter +#define TData ::com::rti::chocolatefactory::generated::ChocolateLotState + + +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_data_TDataWriter.gen" +#else +#include "dds_c/generic/dds_c_data_TDataWriter.gen" +#endif + + +#undef TDataWriter +#undef TData + +#undef TTYPENAME + +/* ----------------------------------------------------------------- */ +/* DDSDataReader +*/ + +/** + <> + + Defines: TDataReader, TDataSeq, TData +*/ + +/* Requires */ +#define TTYPENAME ChocolateLotStateTYPENAME + +/* Defines */ +#define TDataReader ChocolateLotStateDataReader +#define TDataSeq ChocolateLotStateSeq +#define TData ::com::rti::chocolatefactory::generated::ChocolateLotState + + +#ifdef __cplusplus +#include "dds_cpp/generic/dds_cpp_data_TDataReader.gen" +#else +#include "dds_c/generic/dds_c_data_TDataReader.gen" +#endif + + +#undef TDataReader +#undef TDataSeq +#undef TData + +#undef TTYPENAME + +/* ----------------------------------------------------------------- */ +/* TypeSupport + + <> + + Requires: TTYPENAME, + TPlugin_new + TPlugin_delete + Defines: TTypeSupport, TData, TDataReader, TDataWriter +*/ + +/* Requires */ +#define TTYPENAME ChocolateLotStateTYPENAME +#define TPlugin_new ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_new +#define TPlugin_delete ::com::rti::chocolatefactory::generated::ChocolateLotStatePlugin_delete + +/* Defines */ +#define TTypeSupport ChocolateLotStateTypeSupport +#define TData ::com::rti::chocolatefactory::generated::ChocolateLotState +#define TDataReader ChocolateLotStateDataReader +#define TDataWriter ChocolateLotStateDataWriter +#ifdef __cplusplus + + + +#include "dds_cpp/generic/dds_cpp_data_TTypeSupport.gen" + + + +#else +#include "dds_c/generic/dds_c_data_TTypeSupport.gen" +#endif +#undef TTypeSupport +#undef TData +#undef TDataReader +#undef TDataWriter + +#undef TTYPENAME +#undef TPlugin_new +#undef TPlugin_delete + + + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.h b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.h new file mode 100644 index 00000000..8c0f128d --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.h @@ -0,0 +1,131 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from ChocolateFactory.idl using "rtiddsgen". + The rtiddsgen tool is part of the RTI Connext distribution. + For more information, type 'rtiddsgen -help' at a command shell + or consult the RTI Connext manual. +*/ + +#ifndef ChocolateFactorySupport_1774920665_h +#define ChocolateFactorySupport_1774920665_h + +/* Uses */ +#include "ChocolateFactory.h" + + + +#ifdef __cplusplus +#ifndef ndds_cpp_h + #include "ndds/ndds_cpp.h" +#endif +#else +#ifndef ndds_c_h + #include "ndds/ndds_c.h" +#endif +#endif + + +namespace com{ + +namespace rti{ + +namespace chocolatefactory{ + +namespace generated{ + + +/* ========================================================================= */ +/** + Uses: T + + Defines: TTypeSupport, TDataWriter, TDataReader + + Organized using the well-documented "Generics Pattern" for + implementing generics in C and C++. +*/ + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + +#ifdef __cplusplus + +DDS_TYPESUPPORT_CPP(ChocolateRecipeTypeSupport, ChocolateRecipe); + +DDS_DATAWRITER_CPP(ChocolateRecipeDataWriter, ChocolateRecipe); +DDS_DATAREADER_CPP(ChocolateRecipeDataReader, ChocolateRecipeSeq, ChocolateRecipe); + + +#else + +DDS_TYPESUPPORT_C(ChocolateRecipeTypeSupport, ChocolateRecipe); +DDS_DATAWRITER_C(ChocolateRecipeDataWriter, ChocolateRecipe); +DDS_DATAREADER_C(ChocolateRecipeDataReader, ChocolateRecipeSeq, ChocolateRecipe); + +#endif + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + + +/* ========================================================================= */ +/** + Uses: T + + Defines: TTypeSupport, TDataWriter, TDataReader + + Organized using the well-documented "Generics Pattern" for + implementing generics in C and C++. +*/ + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, start exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport __declspec(dllexport) +#endif + +#ifdef __cplusplus + +DDS_TYPESUPPORT_CPP(ChocolateLotStateTypeSupport, ChocolateLotState); + +DDS_DATAWRITER_CPP(ChocolateLotStateDataWriter, ChocolateLotState); +DDS_DATAREADER_CPP(ChocolateLotStateDataReader, ChocolateLotStateSeq, ChocolateLotState); + + +#else + +DDS_TYPESUPPORT_C(ChocolateLotStateTypeSupport, ChocolateLotState); +DDS_DATAWRITER_C(ChocolateLotStateDataWriter, ChocolateLotState); +DDS_DATAREADER_C(ChocolateLotStateDataReader, ChocolateLotStateSeq, ChocolateLotState); + +#endif + +#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT) + /* If the code is building on Windows, stop exporting symbols. + */ + #undef NDDSUSERDllExport + #define NDDSUSERDllExport +#endif + + +} /* namespace generated */ + +} /* namespace chocolatefactory */ + +} /* namespace rti */ + +} /* namespace com */ + + +#endif /* ChocolateFactorySupport_1774920665_h */ diff --git a/ChocolateFactory/ExampleCode/src/Idl/ChocolateFactory.idl b/ChocolateFactory/ExampleCode/src/Idl/ChocolateFactory.idl index 0aafb48f..bf73f9ee 100644 --- a/ChocolateFactory/ExampleCode/src/Idl/ChocolateFactory.idl +++ b/ChocolateFactory/ExampleCode/src/Idl/ChocolateFactory.idl @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ module com { module rti { module chocolatefactory { diff --git a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/CMakeLists.txt b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/CMakeLists.txt new file mode 100644 index 00000000..c9b33c5f --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/CMakeLists.txt @@ -0,0 +1,62 @@ +######################## +# ManufacturingExecutionSystem +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/ManufacturingExecutionSystem + ${CMAKE_SOURCE_DIR}/CommonInfrastructure +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE ManufacturingExecutionSystem_sources + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.cxx + ${CMAKE_SOURCE_DIR}/ManufacturingExecutionSystem/*.h + ${CMAKE_SOURCE_DIR}/ManufacturingExecutionSystem/*.cxx + ) + +add_executable(ManufacturingExecutionSystem + ${ManufacturingExecutionSystem_sources} +) + +add_dependencies(ManufacturingExecutionSystem SharedDataTypes) + +if(ARCHITECTURE MATCHES "Win32") + target_link_libraries(ManufacturingExecutionSystem + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes.lib + ) + SET_TARGET_PROPERTIES( ManufacturingExecutionSystem + PROPERTIES LINK_FLAGS "/LIBPATH:${ChocolateFactory_BIN_DIR}" ) +elseif (ARCHITECTURE MATCHES "Linux") + target_link_libraries(ManufacturingExecutionSystem + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +elseif (ARCHITECTURE MATCHES "Darwin") + target_link_libraries(ManufacturingExecutionSystem + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +endif() + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(ManufacturingExecutionSystem PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ) +endforeach() diff --git a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.cxx b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.cxx index ef9c15cf..449ba40b 100644 --- a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.cxx +++ b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "MESInterface.h" using namespace DDS; diff --git a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.h b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.h index 1ef49902..e8da4790 100644 --- a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.h +++ b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/MESInterface.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef MES_INTERFACE_H #define MES_INTERFACE_H @@ -107,4 +107,4 @@ class MESInterface }; -#endif \ No newline at end of file +#endif diff --git a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.cxx b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.cxx index f654b41f..fb15a7c3 100644 --- a/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.cxx +++ b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.user b/ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.vcxproj.user similarity index 100% rename from ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.user rename to ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.vcxproj.user diff --git a/ChocolateFactory/ExampleCode/src/RecipeGenerator/CMakeLists.txt b/ChocolateFactory/ExampleCode/src/RecipeGenerator/CMakeLists.txt new file mode 100644 index 00000000..b1b7f400 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/RecipeGenerator/CMakeLists.txt @@ -0,0 +1,67 @@ +######################## +# RecipeGenerator +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/RecipeGenerator + ${CMAKE_SOURCE_DIR}/CommonInfrastructure +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE ReceipeGenerator_sources + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSTypeWrapper.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSCommunicator.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSCommunicator.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/OSAPI.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/OSAPI.h + ${CMAKE_SOURCE_DIR}/RecipeGenerator/*.h + ${CMAKE_SOURCE_DIR}/RecipeGenerator/*.cxx + ) + + +add_executable(RecipeGenerator + ${ReceipeGenerator_sources} +) + +add_dependencies(RecipeGenerator SharedDataTypes) + +if(ARCHITECTURE MATCHES "Win32") + target_link_libraries(RecipeGenerator + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes.lib + ) + SET_TARGET_PROPERTIES( RecipeGenerator + PROPERTIES LINK_FLAGS "/LIBPATH:${ChocolateFactory_BIN_DIR}" ) +elseif (ARCHITECTURE MATCHES "Linux") + target_link_libraries(RecipeGenerator + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +elseif (ARCHITECTURE MATCHES "Darwin") + target_link_libraries(RecipeGenerator + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +endif() + + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(RecipeGenerator PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ) +endforeach() diff --git a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipeGenerator.cxx b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipeGenerator.cxx index f1ec387e..0a6f71a6 100644 --- a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipeGenerator.cxx +++ b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipeGenerator.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.cxx b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.cxx index 490d40e9..17af9651 100644 --- a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.cxx +++ b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "RecipePublisherInterface.h" diff --git a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.h b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.h index fc1e0db3..b9a2199b 100644 --- a/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.h +++ b/ChocolateFactory/ExampleCode/src/RecipeGenerator/RecipePublisherInterface.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef RECIPE_PUBLISHER_INTERFACE_H #define RECIPE_PUBLISHER_INTERFACE_H @@ -79,4 +79,4 @@ class RecipePublisherInterface com::rti::chocolatefactory::generated::ChocolateRecipeDataWriter *_writer; }; -#endif \ No newline at end of file +#endif diff --git a/ChocolateFactory/ExampleCode/src/StationController/CMakeLists.txt b/ChocolateFactory/ExampleCode/src/StationController/CMakeLists.txt new file mode 100644 index 00000000..bd8441a5 --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/StationController/CMakeLists.txt @@ -0,0 +1,63 @@ +######################## +# StationController +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/StationController + ${CMAKE_SOURCE_DIR}/CommonInfrastructure +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE StationController_sources + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.cxx + ${CMAKE_SOURCE_DIR}/StationController/*.h + ${CMAKE_SOURCE_DIR}/StationController/*.cxx + ) + + +add_executable(StationController + ${StationController_sources} +) + +add_dependencies(StationController SharedDataTypes) + +if(ARCHITECTURE MATCHES "Win32") + target_link_libraries(StationController + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes.lib + ) + SET_TARGET_PROPERTIES( StationController + PROPERTIES LINK_FLAGS "/LIBPATH:${ChocolateFactory_BIN_DIR}" ) +elseif (ARCHITECTURE MATCHES "Linux") + target_link_libraries(StationController + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +elseif (ARCHITECTURE MATCHES "Darwin") + target_link_libraries(StationController + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +endif() + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(StationController PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${ChocolateFactory_BIN_DIR} + ) +endforeach() diff --git a/ChocolateFactory/ExampleCode/src/StationController/StationController.cxx b/ChocolateFactory/ExampleCode/src/StationController/StationController.cxx index 8f407b63..a3ded05f 100644 --- a/ChocolateFactory/ExampleCode/src/StationController/StationController.cxx +++ b/ChocolateFactory/ExampleCode/src/StationController/StationController.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/ChocolateFactory/ExampleCode/src/StationController/StationController.h b/ChocolateFactory/ExampleCode/src/StationController/StationController.h index 71402a97..27ee98c1 100644 --- a/ChocolateFactory/ExampleCode/src/StationController/StationController.h +++ b/ChocolateFactory/ExampleCode/src/StationController/StationController.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef STATION_CONTROLLER_H #define STATION_CONTROLLER_H @@ -45,4 +45,4 @@ class StationController _stationControllerKind; }; -#endif \ No newline at end of file +#endif diff --git a/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.cxx b/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.cxx index 77944921..0f5e9cca 100644 --- a/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.cxx +++ b/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.h b/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.h index 433c2152..3422669d 100644 --- a/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.h +++ b/ChocolateFactory/ExampleCode/src/StationController/StationControllerInterface.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef STATION_CONTROLLER_INTERFACE_H #define STATION_CONTROLLER_INTERFACE_H diff --git a/ChocolateFactory/ExampleCode/src/cmake/FindConnextDDS.cmake b/ChocolateFactory/ExampleCode/src/cmake/FindConnextDDS.cmake new file mode 100644 index 00000000..af84b8af --- /dev/null +++ b/ChocolateFactory/ExampleCode/src/cmake/FindConnextDDS.cmake @@ -0,0 +1,112 @@ +##################################### +# FindConnextDDS.cmake +##################################### + +# We need NDDSHOME set to know the location of the RTI Connext DDS installation +if (NOT DEFINED NDDSHOME) + if (DEFINED ENV{NDDSHOME}) + set(NDDSHOME $ENV{NDDSHOME}) + else() + message(FATAL_ERROR "$NDDSHOME not specified. Please set -DNDDSHOME= to your RTI Connext DDS installation directory") + endif() +endif() + +# We need to know the RTI Connext DDS libraries to compile against +if (NOT DEFINED ARCHITECTURE) + if(DEFINED ENV{ARCHITECTURE}) + set(ARCHITECTURE $ENV{ARCHITECTURE}) + else() + message(FATAL_ERROR "$ARCHITECTURE not specified. Please set -DARCHITECTURE= to your RTI Connext DDS architecture") + endif() +endif() + +# Connext DDS Definitions +if (ARCHITECTURE MATCHES "Linux") + set(CONNEXTDDS_DEFINITIONS "-DRTI_UNIX -DRTI_LINUX") + if (CMAKE_BUILD_TYPE MATCHES "Debug") + set(CONNEXTDDS_DEFINITIONS ${CONNEXTDDS_DEFINITIONS} "-DRTI_PRECONDITION_TEST") + set(nddscore_libname libnddscorezd.a) + set(nddsc_libname libnddsczd.a) + set(nddscpp_libname libnddscppzd.a) + else() + set(nddscore_libname libnddscorez.a) + set(nddsc_libname libnddscz.a) + set(nddscpp_libname libnddscppz.a) + endif() + set(external_libs "-ldl -lm -lpthread -lrt") + add_custom_target( + RUN_RTIDDSGEN + COMMAND ${NDDSHOME}/scripts/rtiddsgen ${CMAKE_SOURCE_DIR}/Idl/ChocolateFactory.idl -namespace -replace -language C++ -d ${CMAKE_SOURCE_DIR}/Generated + ) +elseif(ARCHITECTURE MATCHES "Win32") + set(CONNEXTDDS_DEFINITIONS "-DWIN32_LEAN_AND_MEAN -DWIN32 -D_WINDOWS -DRTI_WIN32 -D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1 -D_CRT_SECURE_NO_WARNING") + if (CMAKE_BUILD_TYPE MATCHES "Debug") + set(CONNEXTDDS_DEFINITIONS ${CONNEXTDDS_DEFINITIONS} "-DRTI_PRECONDITION_TEST") + set(nddscore_libname nddscorezd.lib) + set(nddsc_libname nddsczd.lib) + set(nddscpp_libname nddscppzd.lib) + else() + set(nddscore_libname nddscorez.lib) + set(nddsc_libname nddscz.lib) + set(nddscpp_libname nddscppz.lib) + endif() + set(external_libs ws2_32 netapi32 version) + add_custom_target( + RUN_RTIDDSGEN + COMMAND ${NDDSHOME}/scripts/rtiddsgen ${CMAKE_SOURCE_DIR}/Idl/ChocolateFactory.idl -namespace -replace -language C++ -d ${CMAKE_SOURCE_DIR}/Generated + ) +elseif(ARCHITECTURE MATCHES "Darwin") + set(CONNEXTDDS_DEFINITIONS "-DRTI_UNIX -DRTI_DARWIN -DRTI_DARWIN10 -DRTI_64BIT -Wno-return-type-c-linkage") + if (CMAKE_CONFIGURATION_TYPES MATCHES "Debug") + set(CONNEXTDDS_DEFINITIONS ${CONNEXTDDS_DEFINITIONS} "-DRTI_PRECONDITION_TEST") + set(nddscore_libname libnddscorezd.a) + set(nddsc_libname libnddsczd.a) + set(nddscpp_libname libnddscppzd.a) + else() + set(nddscore_libname libnddscorez.a) + set(nddsc_libname libnddscz.a) + set(nddscpp_libname libnddscppz.a) + endif() + add_custom_target( + RUN_RTIDDSGEN + COMMAND ${NDDSHOME}/scripts/rtiddsgen ${CMAKE_SOURCE_DIR}/Idl/ChocolateFactory.idl -namespace -replace -language C++ -d ${CMAKE_SOURCE_DIR}/Generated + ) +endif() + + +# Find ndds_c.h header file +find_path(CONNEXTDDS_INCLUDE_DIRS + NAMES ndds_c.h + PATHS ${NDDSHOME}/include/ndds + ) + +# We need to include both include and include/ndds directories +set(CONNEXTDDS_INCLUDE_DIRS + ${NDDSHOME}/include + ${CONNEXTDDS_INCLUDE_DIRS} + ) + +# Add Core, C, and C++ libraries for the given architecture +find_library(nddscore_lib + NAMES ${nddscore_libname} + PATHS ${NDDSHOME}/lib/${ARCHITECTURE} + ) + +find_library(nddsc_lib + NAMES ${nddsc_libname} + PATHS ${NDDSHOME}/lib/${ARCHITECTURE} + ) + +find_library(nddscpp_lib + NAMES ${nddscpp_libname} + PATHS ${NDDSHOME}/lib/${ARCHITECTURE} + ) + +set(CONNEXTDDS_LIBRARIES + ${nddscpp_lib} + ${nddsc_lib} + ${nddscore_lib} + ${CMAKE_DL_LIBS} + ${external_libs} + ) + diff --git a/ChocolateFactory/ExampleCode/win32/ChocolateFactory-vs2010.sln b/ChocolateFactory/ExampleCode/win32/ChocolateFactory-vs2010.sln deleted file mode 100644 index 2c7c4eed..00000000 --- a/ChocolateFactory/ExampleCode/win32/ChocolateFactory-vs2010.sln +++ /dev/null @@ -1,37 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ManufacturingExecutionSystem", "MES.vcxproj", "{FA2857A7-83A2-426C-82A5-87F5A54EECFF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SharedDataTypes", "SharedDataTypes.vcxproj", "{E287142F-0D1E-49BF-B3BC-A218C1D1629F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RecipeGenerator", "RecipeGenerator.vcxproj", "{F5CD402E-66A5-E16C-4A72-08BEEA388FEA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StationController", "StationController.vcxproj", "{BF91B58A-6407-4AFE-A17D-8C541C298A4F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FA2857A7-83A2-426C-82A5-87F5A54EECFF}.Debug|Win32.ActiveCfg = Debug|Win32 - {FA2857A7-83A2-426C-82A5-87F5A54EECFF}.Debug|Win32.Build.0 = Debug|Win32 - {FA2857A7-83A2-426C-82A5-87F5A54EECFF}.Release|Win32.ActiveCfg = Release|Win32 - {FA2857A7-83A2-426C-82A5-87F5A54EECFF}.Release|Win32.Build.0 = Release|Win32 - {E287142F-0D1E-49BF-B3BC-A218C1D1629F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E287142F-0D1E-49BF-B3BC-A218C1D1629F}.Debug|Win32.Build.0 = Debug|Win32 - {E287142F-0D1E-49BF-B3BC-A218C1D1629F}.Release|Win32.ActiveCfg = Release|Win32 - {E287142F-0D1E-49BF-B3BC-A218C1D1629F}.Release|Win32.Build.0 = Release|Win32 - {F5CD402E-66A5-E16C-4A72-08BEEA388FEA}.Debug|Win32.ActiveCfg = Debug|Win32 - {F5CD402E-66A5-E16C-4A72-08BEEA388FEA}.Debug|Win32.Build.0 = Debug|Win32 - {F5CD402E-66A5-E16C-4A72-08BEEA388FEA}.Release|Win32.ActiveCfg = Release|Win32 - {F5CD402E-66A5-E16C-4A72-08BEEA388FEA}.Release|Win32.Build.0 = Release|Win32 - {BF91B58A-6407-4AFE-A17D-8C541C298A4F}.Debug|Win32.ActiveCfg = Debug|Win32 - {BF91B58A-6407-4AFE-A17D-8C541C298A4F}.Debug|Win32.Build.0 = Debug|Win32 - {BF91B58A-6407-4AFE-A17D-8C541C298A4F}.Release|Win32.ActiveCfg = Release|Win32 - {BF91B58A-6407-4AFE-A17D-8C541C298A4F}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/ChocolateFactory/ExampleCode/win32/MES.vcxproj b/ChocolateFactory/ExampleCode/win32/MES.vcxproj deleted file mode 100644 index 3a6c650b..00000000 --- a/ChocolateFactory/ExampleCode/win32/MES.vcxproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {FA2857A7-83A2-426C-82A5-87F5A54EECFF} - Win32Proj - FlightPlanPublisher - ManufacturingExecutionSystem - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - false - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - - NotUsing - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds - - - - - MultiThreadedDebug - - - Console - true - nddscppzd.lib;nddsczd.lib;nddscorezd.lib;netapi32.lib;WS2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - $(NDDSHOME)/lib/i86Win32VS2010 - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds - MultiThreaded - - - Console - false - true - true - $(NDDSHOME)/lib/i86Win32VS2010 - nddscppz.lib;nddscz.lib;nddscorez.lib;netapi32.lib;WS2_32.lib;advapi32.lib;shell32.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - {e287142f-0d1e-49bf-b3bc-a218c1d1629f} - - - - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/MES.vcxproj.filters b/ChocolateFactory/ExampleCode/win32/MES.vcxproj.filters deleted file mode 100644 index a1e64e85..00000000 --- a/ChocolateFactory/ExampleCode/win32/MES.vcxproj.filters +++ /dev/null @@ -1,71 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/MES.vcxproj.user b/ChocolateFactory/ExampleCode/win32/MES.vcxproj.user deleted file mode 100644 index b16c5808..00000000 --- a/ChocolateFactory/ExampleCode/win32/MES.vcxproj.user +++ /dev/null @@ -1,13 +0,0 @@ - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj b/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj deleted file mode 100644 index 67aad2a7..00000000 --- a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj +++ /dev/null @@ -1,153 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - RecipeGenerator - RadarDataRaw_publisher - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - - - .\objs\i86Win32VS2010\RadarDataRaw_publisher.tlb - - - - - Disabled - $(NDDSHOME)\include;$(NDDSHOME)\include\ndds;%(AdditionalIncludeDirectories) - WIN32;RTI_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - nddscppzd.lib;nddsczd.lib;nddscorezd.lib;netapi32.lib;advapi32.lib;user32.lib;WS2_32.lib;;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - $(NDDSHOME)\lib\i86Win32VS2010;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - .\objs\i86Win32VS2010\RadarDataRaw_publisher.tlb - - - - - MaxSpeed - OnlyExplicitInline - $(NDDSHOME)\include;$(NDDSHOME)\include\ndds;%(AdditionalIncludeDirectories) - WIN32;RTI_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - .\objs\i86Win32VS2010\ - .\objs\i86Win32VS2010\ - .\objs\i86Win32VS2010\ - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - nddscppz.lib;nddscz.lib;nddscorez.lib;netapi32.lib;advapi32.lib;user32.lib;WS2_32.lib;;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true - $(NDDSHOME)\lib\i86Win32VS2010;%(AdditionalLibraryDirectories) - .\objs\i86Win32VS2010\RadarDataRaw_publisher.pdb - Console - MachineX86 - - - - - - - - - - - - - - - - - - - Designer - - - - - - {e287142f-0d1e-49bf-b3bc-a218c1d1629f} - - - - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.filters b/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.filters deleted file mode 100644 index a5fa507d..00000000 --- a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.filters +++ /dev/null @@ -1,59 +0,0 @@ - - - - - {57764858-07bf-4a80-9a09-2de3f408d37c} - h;hpp;hxx;hm;inl - - - {34f77704-fc15-4416-868a-d8357f739211} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {60b2f9d4-0b30-4c2d-b3a3-c98cf7694b71} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.user b/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.user deleted file mode 100644 index 4b1bb4f9..00000000 --- a/ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.user +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj b/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj deleted file mode 100644 index a7b0ecc1..00000000 --- a/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - "$(NDDSHOME)\scripts\rtiddsgen" ..\src\Idl\ChocolateFactory.idl -replace -namespace -language C++ -d ..\src\Generated - "$(NDDSHOME)\scripts\rtiddsgen" ..\src\Idl\ChocolateFactory.idl -replace -namespace -language C++ -d ..\src\Generated - Generating .cxx files from .idl ... - Generating .cxx files from .idl ... - %(RootDir)%(Directory)..\Generated\%(Filename).h;%(RootDir)%(Directory)..\Generated\%(Filename).cxx;%(RootDir)%(Directory)..\Generated\%(Filename)Plugin.h;%(RootDir)%(Directory)..\Generated\%(Filename)Plugin.cxx;%(RootDir)%(Directory)..\Generated\%(Filename)Support.h;%(RootDir)%(Directory)..\Generated\%(Filename)Support.cxx;%(Outputs) - %(RootDir)%(Directory)..\Generated\%(Filename).h;%(RootDir)%(Directory)..\Generated\%(Filename).cxx;%(RootDir)%(Directory)..\Generated\%(Filename)Plugin.h;%(RootDir)%(Directory)..\Generated\%(Filename)Plugin.cxx;%(RootDir)%(Directory)..\Generated\%(Filename)Support.h;%(RootDir)%(Directory)..\Generated\%(Filename)Support.cxx;%(Outputs) - - - - - - - - - - - - - - - - - - - - {E287142F-0D1E-49BF-B3BC-A218C1D1629F} - Win32Proj - SharedDataTypes - - - - StaticLibrary - true - Unicode - - - StaticLibrary - false - true - Unicode - - - - - - - - - - - - - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - $(ProjectName) - - - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - $(ProjectName) - - - - - - Level3 - Disabled - RTI_WIN32;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDebug - $(NDDSHOME)\include;$(NDDSHOME)\include\ndds - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - RTI_WIN32;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(NDDSHOME)\include;$(NDDSHOME)\include\ndds - MultiThreaded - false - - - Windows - true - true - true - - - false - - - - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.filters b/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.filters deleted file mode 100644 index c87d2745..00000000 --- a/ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.filters +++ /dev/null @@ -1,61 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {73ca3dbc-c2b8-4e26-a10f-6feb5db8c638} - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - - - IDL - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj b/ChocolateFactory/ExampleCode/win32/StationController.vcxproj deleted file mode 100644 index 75ffe868..00000000 --- a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {BF91B58A-6407-4AFE-A17D-8C541C298A4F} - Win32Proj - TrackGUI - StationController - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - false - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - - NotUsing - Level3 - Disabled - _CRTDBG_MAPALLOC;WIN32;RTI_WIN32;_CRT_SECURE_NO_WARNINGS;wxUSE_GUI=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(ProjectDir)\..\thirdparty\proj-4.8.0\include;$(NDDSHOME)\include;$(NDDSHOME)\include\ndds;$(ProjectDir)\..\thirdparty\shapelib-1.3.0\include;$(ProjectDir)\..\thirdparty\wxWidgets-2.9.4\include;$(ProjectDir)\..\thirdparty\wxWidgets-2.9.4\include\msvc - - - MultiThreadedDebug - - - Console - true - $(ProjectDir)..\thirdparty\proj-4.8.0\lib\i86Win32VS2010;$(NDDSHOME)\lib\i86Win32VS2010;$(ProjectDir)..\thirdparty\shapelib-1.3.0\lib\i86Win32VS2010;$(ProjectDir)..\thirdparty\wxWidgets-2.9.4\lib\vc_lib - nddscppzd.lib;nddsczd.lib;nddscorezd.lib;netapi32.lib;comctl32.lib;rpcrt4.lib;winmm.lib;wsock32.lib;ws2_32.lib;%(AdditionalDependencies) - NotSet - - - - - Level3 - NotUsing - MaxSpeed - true - true - __WXMSW__;_WINDOWS;WIN32;RTI_WIN32;_CRT_SECURE_NO_WARNINGS;wxUSE_GUI=1;NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir)\..\thirdparty\wxWidgets-2.9.4\include\msvc;$(ProjectDir)\..\thirdparty\wxWidgets-2.9.4\include;$(ProjectDir)\..\thirdparty\shapelib-1.3.0\include;$(ProjectDir)\..\thirdparty\proj-4.8.0\include;$(NDDSHOME)\include;$(NDDSHOME)\include\ndds - MultiThreaded - - - - - - - Console - true - true - true - nddscppz.lib;nddscz.lib;nddscorez.lib;WS2_32.lib;netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;wsock32.lib;comctl32.lib;%(AdditionalDependencies) - $(ProjectDir)..\thirdparty\proj-4.8.0\lib\i86Win32VS2010;$(NDDSHOME)\lib\i86Win32VS2010;$(ProjectDir)..\thirdparty\wxWidgets-2.9.4\lib\vc_lib;$(ProjectDir)..\thirdparty\shapelib-1.3.0\lib\i86Win32VS2010 - NotSet - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e287142f-0d1e-49bf-b3bc-a218c1d1629f} - - - - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.filters b/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.filters deleted file mode 100644 index 231ea9af..00000000 --- a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.filters +++ /dev/null @@ -1,74 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.user b/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.user deleted file mode 100644 index 6e9425f3..00000000 --- a/ChocolateFactory/ExampleCode/win32/StationController.vcxproj.user +++ /dev/null @@ -1,13 +0,0 @@ - - - - path=%NDDSHOME%\lib\i86Win32VS2010;%PATH% - WindowsLocalDebugger - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - --controller-type 1 - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - \ No newline at end of file diff --git a/ChocolateFactory/README.txt b/ChocolateFactory/README.txt index ef00899c..ca5da73e 100644 --- a/ChocolateFactory/README.txt +++ b/ChocolateFactory/README.txt @@ -61,29 +61,42 @@ Getting Started Guide. We will refer to the location where you unzipped the example in this document as EXAMPLE_HOME. +IMPORTANT NOTE: the path EXAMPLE_HOME should not have blanks. + All source and build files are located in EXAMPLE_HOME/ExampleCode/. Before building or running, change directories into EXAMPLE_HOME/ExampleCode. -Windows Systems ---------------- - -On a Windows system, start by opening the file -win32\ChocolateFactory-.sln. - -This code is made up of a combination of libraries, source, and IDL files that -represent the interface to the application. The Visual Studio solution files -are set up to automatically generate the necessary code and link against the -required libraries. - -Linux Systems -------------- - -To build the applications on a Linux system, change directories to the -ExampleCode directory and use the command: - -gmake –f make/Makefile. -The platform you choose will be the combination of your processor, OS, and -compiler version. Right now this example only supports i86Linux2.6gcc4.5.5 +Build the example +----------------- +For building this example is needed to have installed CMake. You can download +from http://www.cmake.org/download/ . + +Then you have to run the CMake project in order to create your building files, +depending of the architecture you want to use. For this task you have to run in +a command prompt windows the Build.pl script is inside of scripts folder. +Remember you have to run this scripts in the EXAMPLE_HOME\ExampleCode directory. +You can use the next command: + perl ./scripts/Build.pl +where you can choose your own architecture. + +This script will create a 'projects' folder where your Visual Studio project, or +your makefile will be stored. You can modify these files if you want. + +Besides, the script will compile the example: + - In Windows: run the msbuild compiler with the created solution. + - In Linux: run the created makefile. + +Also, Build.pl script will create four custom running scripts. The running +scripts will be saved in the scripts directory following the template they have +in the same folder. + +The four custom script created are: + - RecipeGenerator + - ManufacturingExecutionSystem + - AllStationController + - StationController +All of them with the corresponding architecture you wrote calling the Build.pl +script. Run the Example --------------- diff --git a/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml b/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml index 90f577d0..614e561b 100644 --- a/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml +++ b/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml @@ -1,10 +1,20 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_profiles.xsd" + version="5.1.0"> diff --git a/DataSubsetWAN/ExampleCode/apps/scripts/alarm.lua b/DataSubsetWAN/ExampleCode/apps/scripts/alarm.lua index 69de7618..9ef2b2ff 100644 --- a/DataSubsetWAN/ExampleCode/apps/scripts/alarm.lua +++ b/DataSubsetWAN/ExampleCode/apps/scripts/alarm.lua @@ -1,5 +1,5 @@ --***************************************************************************** ---* (c) 2005-2013 Copyright, Real-Time Innovations, All rights reserved. * +--* (c) 2005-2014 Copyright, Real-Time Innovations, All rights reserved. * --* * --* Permission to modify and use for internal purposes granted. * --* This software is provided 'as is', without warranty, express or implied. * diff --git a/DataSubsetWAN/ExampleCode/routing/Filter-Update.xml b/DataSubsetWAN/ExampleCode/routing/Filter-Update.xml index a2bc8240..41efe7e1 100644 --- a/DataSubsetWAN/ExampleCode/routing/Filter-Update.xml +++ b/DataSubsetWAN/ExampleCode/routing/Filter-Update.xml @@ -1,3 +1,13 @@ + diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml index 0659bd6c..5d60434c 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml @@ -1,37 +1,36 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_routing_service.xsd" + version="5.1.0"> - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml index 62d4448b..329d46cf 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml @@ -1,37 +1,36 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_routing_service.xsd" + version="5.1.0"> - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml index 6e9f356c..28e4944b 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml @@ -1,37 +1,35 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_routing_service.xsd" + version="5.1.0"> - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 - - + - - RELIABLE_RELIABILITY_QOS - - - TRANSIENT_LOCAL_DURABILITY_QOS - KEEP_LAST_HISTORY_QOS 1 diff --git a/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml b/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml index c9712f28..e72b94d3 100644 --- a/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml +++ b/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml @@ -1,7 +1,17 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> diff --git a/DataSubsetWAN/ExampleCode/scripts/StartReceive.bat b/DataSubsetWAN/ExampleCode/scripts/StartReceive.bat index 81d4b6cf..65810e9c 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartReceive.bat +++ b/DataSubsetWAN/ExampleCode/scripts/StartReceive.bat @@ -1,8 +1,8 @@ @echo off setlocal -IF []==[%PROTOTYPER_HOME%] ( - @echo PROTOTYPER_HOME must be set to the prototyper install dir to run this example +IF []==[%NDDSHOME%] ( + @echo NDDSHOME must be set to the prototyper install dir to run this example ) set dir=%~dp0 @@ -11,4 +11,4 @@ set executable_name=rtiddsprototyper cd %dir%\..\apps -call %PROTOTYPER_HOME%\scripts\%executable_name% -cfgFile PrototyperConfig.xml -cfgName ParticipantLibrary::Receiver \ No newline at end of file +call %NDDSHOME%\scripts\%executable_name% -cfgFile PrototyperConfig.xml -cfgName ParticipantLibrary::Receiver \ No newline at end of file diff --git a/DataSubsetWAN/ExampleCode/scripts/StartReceive.sh b/DataSubsetWAN/ExampleCode/scripts/StartReceive.sh index 0fbbe2fb..489e837d 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartReceive.sh +++ b/DataSubsetWAN/ExampleCode/scripts/StartReceive.sh @@ -4,14 +4,14 @@ filename=$0 script_dir=`dirname $filename` executable_name="rtiddsprototyper" -if [ -f $PROTOTYPER_HOME/scripts/$executable_name ] +if [ -f "$NDDSHOME"/scripts/$executable_name ] then cd $script_dir/../apps - $PROTOTYPER_HOME/scripts/$executable_name \ + "$NDDSHOME"/scripts/$executable_name \ -cfgFile PrototyperConfig.xml \ -cfgName ParticipantLibrary::Receiver else echo "**************************************************************************" - echo "PROTOTYPER_HOME must be set to prototyper install dir to run this example" + echo "NDDSHOME must be set to prototyper install dir to run this example" echo "**************************************************************************" fi diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.bat b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.bat index 2c6b9e2e..5967c3fb 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.bat +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.bat @@ -2,7 +2,7 @@ setlocal IF []==[%ROUTER_HOME%] ( - @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.0.0 to run this example + @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.1.0 to run this example ) set dir=%~dp0 diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.sh b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.sh index 48b65d15..b708daa8 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.sh +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.sh @@ -23,6 +23,6 @@ then else echo "*****************************************************************" echo "The ROUTER_HOME environment variable must be set to" - echo "Connext_install_dir/RTI_Routing_service_5.0.0 to run this example" + echo "Connext_install_dir/RTI_Routing_service_5.1.0 to run this example" echo "*****************************************************************" fi diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.bat b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.bat index ecfe65b9..a11a1856 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.bat +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.bat @@ -2,7 +2,7 @@ setlocal IF []==[%ROUTER_HOME%] ( - @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.0.0 to run this example + @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.1.0 to run this example ) set dir=%~dp0 diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.sh b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.sh index 442f2d01..fdeb840f 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.sh +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.sh @@ -23,6 +23,6 @@ then else echo "******************************************************************" echo "The ROUTER_HOME environment variable must be set to" - echo "Connext_install_dir/RTI_Routing_service_5.0.0 to run this example" + echo "Connext_install_dir/RTI_Routing_service_5.1.0 to run this example" echo "******************************************************************" fi diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.bat b/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.bat index 32ad48ae..ef2793d7 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.bat +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.bat @@ -2,7 +2,7 @@ setlocal IF []==[%ROUTER_HOME%] ( - @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.0.0 to run this example + @echo The ROUTER_HOME environment variable must be set to Connext_install_dir/RTI_Routing_Service_5.1.0 to run this example ) set dir=%~dp0 diff --git a/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.sh b/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.sh index 24c9ecc8..81ce3533 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.sh +++ b/DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.sh @@ -23,6 +23,6 @@ then else echo "*****************************************************************" echo "The ROUTER_HOME environment variable must be set to" - echo "Connext_install_dir/RTI_Routing_service_5.0.0 to run this example" + echo "Connext_install_dir/RTI_Routing_service_5.1.0 to run this example" echo "*****************************************************************" fi diff --git a/DataSubsetWAN/ExampleCode/scripts/StartSend.bat b/DataSubsetWAN/ExampleCode/scripts/StartSend.bat index d6ee7e23..eb527581 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartSend.bat +++ b/DataSubsetWAN/ExampleCode/scripts/StartSend.bat @@ -1,8 +1,8 @@ @echo off setlocal -IF []==[%PROTOTYPER_HOME%] ( - @echo PROTOTYPER_HOME must be set to prototyper install dir to run this example +IF []==[%NDDSHOME%] ( + @echo NDDSHOME must be set to prototyper install dir to run this example ) set dir=%~dp0 @@ -11,4 +11,4 @@ set executable_name=rtiddsprototyper cd %dir%\..\apps -call %PROTOTYPER_HOME%\scripts\%executable_name% -cfgFile PrototyperConfig.xml -cfgName ParticipantLibrary::Sender -luaFile scripts\alarm.lua \ No newline at end of file +call %NDDSHOME%\scripts\%executable_name% -cfgFile PrototyperConfig.xml -cfgName ParticipantLibrary::Sender -luaFile scripts\alarm.lua \ No newline at end of file diff --git a/DataSubsetWAN/ExampleCode/scripts/StartSend.sh b/DataSubsetWAN/ExampleCode/scripts/StartSend.sh index f0bcef0f..5700e83a 100755 --- a/DataSubsetWAN/ExampleCode/scripts/StartSend.sh +++ b/DataSubsetWAN/ExampleCode/scripts/StartSend.sh @@ -4,15 +4,15 @@ filename=$0 script_dir=`dirname $filename` executable_name="rtiddsprototyper" -if [ -f $PROTOTYPER_HOME/scripts/$executable_name ] +if [ -f $NDDSHOME/scripts/$executable_name ] then cd $script_dir/../apps - $PROTOTYPER_HOME/scripts/$executable_name \ + $NDDSHOME/scripts/$executable_name \ -cfgFile PrototyperConfig.xml \ -cfgName ParticipantLibrary::Sender \ -luaFile scripts/alarm.lua else echo "**************************************************************************" - echo "PROTOTYPER_HOME must be set to prototyper install dir to run this example" + echo "NDDSHOME must be set to prototyper install dir to run this example" echo "**************************************************************************" fi diff --git a/DataSubsetWAN/README.txt b/DataSubsetWAN/README.txt index f2fb2fa4..a9dca410 100644 --- a/DataSubsetWAN/README.txt +++ b/DataSubsetWAN/README.txt @@ -44,30 +44,17 @@ will include the libraries that are required to run the example, and tools you can use to visualize and debug your distributed system. You can download RTI Connext here: http://www.rti.com/downloads/ -Download RTI Prototyper with Lua --------------------------------- - -This example depends on the RTI Prototyper with Lua experimental product. -This is not required to send data across a WAN, but the example uses this to -generate interesting-looking data. You can download this from here: -http://community.rti.com/downloads/experimental/rti-prototyper-with-lua - - How to Run this Example ----------------------- To run this example, on all platforms you must set two environment variables. The first thing you must do is set an environment variable called ROUTER_HOME. -This environment variable must point to the RTI_Routing_Service_5.0.0 +This environment variable must point to the RTI_Routing_Service_5.1.0 directory inside your RTI Connext DDS installation. For more information on how to set an environment variable, please see the RTI Core Libraries and Utilities Getting Started Guide. -For this example, you must also set an environment variable called -PROTOTYPER_HOME. This must be set to the directory where you installed RTI -Prototyper with Lua. - We will refer to the location where you unzipped the example in this document as EXAMPLE_HOME. diff --git a/README.md b/README.md index 11d9a862..0f2d9a66 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ a project to create code for real-world RTI Connext DDS use cases. The respository contains examples that illustrate a variety of DDS use cases, from vehicle tracking to manufacturing and automation. Some of the use case examples will be focused on real applications such as air traffic control, -and some will be focused on deployment scenarios such as connecting real-time -networks over the cloud. +and some will be focused on deployment scenarios such as monitoring remote +devices over a wide area network. The examples in this repository are meant to illustrate simplified real-world uses of the RTI Connext DDS product, focusing on: @@ -31,5 +31,5 @@ RTI Connext DDS software includes the world's leading implementation of the Object Management Group (OMG) Data Distribution Service (DDS). DDS is the only open standard for messaging that supports the unique needs of both enterprise and real-time systems. Its open interfaces and advanced integration -capabilities slash costs across a system’s lifecycle, from initial development -and integration through on-going maintenance and upgrades. \ No newline at end of file +capabilities slash costs across a system's lifecycle, from initial development +and integration through on-going maintenance and upgrades. diff --git a/VehicleTracking/ExampleCode/resource/replay/record_config.xml b/VehicleTracking/ExampleCode/resource/replay/record_config.xml index 509da674..c0b10f7b 100644 --- a/VehicleTracking/ExampleCode/resource/replay/record_config.xml +++ b/VehicleTracking/ExampleCode/resource/replay/record_config.xml @@ -1,22 +1,26 @@ - - + + + + + @@ -27,51 +31,9 @@ settings for high throughput data. --> - - - 65507 - + - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + + Replay flight data @@ -25,7 +26,7 @@ XML configuration for replaying all network data, using high-throughput settings 10 - AUTO + AUTOMATIC 0 @@ -39,7 +40,7 @@ XML configuration for replaying all network data, using high-throughput settings 0 - + - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -28,52 +28,10 @@ RTI Connext user manual. - + - - 65507 - - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -27,57 +27,10 @@ RTI Connext user manual. - + - - - 65507 - - - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -30,29 +29,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> - - - - + - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - @@ -91,22 +56,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - @@ -228,8 +161,7 @@ RTI Connext user manual. multicast. However, if somebody does enable multicast on a DataReader, this will prevent potential delays. --> - true - + true @@ -238,22 +170,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - diff --git a/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml b/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml index 3e7f7994..e67293bd 100644 --- a/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml +++ b/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml @@ -1,4 +1,14 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> - - - - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - @@ -93,22 +54,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - @@ -239,22 +168,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - diff --git a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanGenerator.cxx b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanGenerator.cxx index bcf7a3ed..2342bcae 100644 --- a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanGenerator.cxx +++ b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanGenerator.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.cxx b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.cxx index df03cc6f..c0384613 100644 --- a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.cxx +++ b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "FlightPlanPublisherInterface.h" diff --git a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.h b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.h index 337c231f..8e64246e 100644 --- a/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.h +++ b/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanPublisherInterface.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef FLIGHT_PLAN_PUBLISHER_INTERFACE_H #define FLIGHT_PLAN_PUBLISHER_INTERFACE_H @@ -83,4 +83,4 @@ class FlightPlanPublisherInterface FlightPlanDataWriter *_writer; }; -#endif \ No newline at end of file +#endif diff --git a/VehicleTracking/ExampleCode/src/Idl/AirTrafficControl.idl b/VehicleTracking/ExampleCode/src/Idl/AirTrafficControl.idl index c7f4c34b..16de8241 100644 --- a/VehicleTracking/ExampleCode/src/Idl/AirTrafficControl.idl +++ b/VehicleTracking/ExampleCode/src/Idl/AirTrafficControl.idl @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ module com { module rti { module atc { diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/GeneratorAdapter.h b/VehicleTracking/ExampleCode/src/RadarGenerator/GeneratorAdapter.h index d79a6ea9..2f3d250a 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/GeneratorAdapter.h +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/GeneratorAdapter.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef GENERATOR_ADAPTER_H #define GENERATOR_ADAPTER_H @@ -86,4 +87,4 @@ class RadarAdapter }; -#endif \ No newline at end of file +#endif diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarApp.h b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarApp.h index f2536ef4..dced40c8 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarApp.h +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarApp.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include "TrackGenerator.h" #include "RadarInterface.h" @@ -112,4 +113,4 @@ class DDSRadarListener : public TrackListener // The ID of this radar long _radarId; -}; \ No newline at end of file +}; diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarGenerator.cxx b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarGenerator.cxx index 71938fab..d6ecbd57 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarGenerator.cxx +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarGenerator.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.cxx b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.cxx index 90616322..9b1fb2f5 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.cxx +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include "../Generated/AirTrafficControl.h" diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.h b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.h index b980b1dc..7873fc6c 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.h +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef RADAR_INTERFACE_H #define RADAR_INTERFACE_H diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.cxx b/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.cxx index 00389bab..0ddce8b2 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.cxx +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include #include diff --git a/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.h b/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.h index e2078245..f16afcb5 100644 --- a/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.h +++ b/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef TRACK_GENERATOR_H #define TRACK_GENERATOR_H @@ -364,4 +365,4 @@ class TrackGenerator }; -#endif \ No newline at end of file +#endif diff --git a/VehicleTracking/ExampleCode/src/TrackGui/FlightInfo.h b/VehicleTracking/ExampleCode/src/TrackGui/FlightInfo.h index e142550e..aace5479 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/FlightInfo.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/FlightInfo.h @@ -1,3 +1,13 @@ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef FLIGHT_INFO_H #define FLIGHT_INFO_H diff --git a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.cxx b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.cxx index 921cfe26..b26ff780 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.cxx +++ b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "NetworkInterface.h" #include "../CommonInfrastructure/DDSTypeWrapper.h" #include "../CommonInfrastructure/OSAPI.h" diff --git a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h index 5dad4770..12fde583 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h @@ -1,3 +1,13 @@ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef NETWORK_INTERFACE_H #define NETWORK_INTERFACE_H diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackApp.h b/VehicleTracking/ExampleCode/src/TrackGui/TrackApp.h index 3d491ff9..41924061 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackApp.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackApp.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef TRACK_APP_H #define TRACK_APP_H @@ -118,4 +119,4 @@ class TrackApp: public wxApp }; -#endif \ No newline at end of file +#endif diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.cxx b/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.cxx index b8f5bd9f..9937887b 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.cxx +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "TrackGUI.h" #include "TrackPresenter.h" #include "TrackApp.h" diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.h b/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.h index a26e8b7c..bc5a0329 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef TRACK_GUI_H #define TRACK_GUI_H diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackGuiApp.cxx b/VehicleTracking/ExampleCode/src/TrackGui/TrackGuiApp.cxx index f77b03ae..811c2da2 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackGuiApp.cxx +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackGuiApp.cxx @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include #include "TrackApp.h" #include "TrackPresenter.h" diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.cxx b/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.cxx index adf588cb..417fab8a 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.cxx +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "TrackPresenter.h" #include "TrackApp.h" #include "TrackGUI.h" diff --git a/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.h b/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.h index 0ffcdc98..3480f652 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef TRACK_PRESENTER_H #define TRACK_PRESENTER_H diff --git a/VideoData/ExampleCode/make/Makefile.common b/VideoData/ExampleCode/make/Makefile.common deleted file mode 100644 index 63a8b0d0..00000000 --- a/VideoData/ExampleCode/make/Makefile.common +++ /dev/null @@ -1,184 +0,0 @@ -############################################################################### -## (c) Copyright, Real-Time Innovations, All rights reserved. ## -## ## -## Permission to modify and use for internal purposes granted. ## -## This software is provided "as is", without warranty, express or implied. ## -## ## -############################################################################### - -# This Makefile contains the common rules to build for all the architectures. -# It is included from the architecture-specific Makefile. -# This Makefile requires the following variables: -# - ARCH: Architecture to build (for example i86Linux2.6gcc4.4.5) -# -# Optional variables: -# - DEBUG: If set to '1', it turns on debugging information -# - SHAREDLIB: If set to '1', shared libraries will be used -# - CXX: compiler name. -# - CXXFLAGS: compiler flags: will be appended to $CXX command-line -# - CXXLD: linker name. -# - CXXLDFLAGS: linker flags: will be inserted at the beginning of CXXLD cmdline -# - SYSLIBS: additional system libraries to append to the CXXLD command-line - -############################################################################### -# Ensure this Makefile is invoked with the right variable set -############################################################################### -ifeq ($(ARCH), ) -all: - @echo "***************************************************************" - @echo "You cannot use this Makefile directly, instead use the" - @echo "architecture-specific Makefile. For example:" - @echo " gmake -f make/Makefile.i86Linux2.6gcc4.4.5" - @echo "***************************************************************" - @false -else -############################################################################### -# Ensure $NDDSHOME is defined -############################################################################### -ifeq ($(NDDSHOME), ) -all: - @echo "***************************************************************" - @echo "The environment variable 'NDDSHOME' is not set!" - @echo "To use this makefile you need to set NDDSHOME to the directory" - @echo "where you have RTI Connext installed." - @echo "***************************************************************" - @false -endif -endif - - -# Define the sources and NDDS search path -INCLUDES = -Isrc/CommonInfrastructure -Isrc/Generated -I$(NDDSHOME)/include \ - -I$(NDDSHOME)/include/ndds -I/usr/include/gstreamer-0.10 \ - -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include \ - -I/usr/include/libxml2 - - -############################################################################### -# Modify build flags for debug/release -############################################################################### -ifeq ($(DEBUG),1) -CXXFLAGS += -g -O0 -D__STDC_CONSTANT_MACROS -ifeq ($(SHAREDLIB),1) -NDDSLIBS = -lnddscppd -lnddscd -lnddscored -else -NDDSLIBS = -lnddscppzd -lnddsczd -lnddscorezd -endif -else -CXXFLAGS += -O2 -D__STDC_CONSTANT_MACROS -ifeq ($(SHAREDLIB),1) -NDDSLIBS = -lnddscpp -lnddsc -lnddscore -else -NDDSLIBS = -lnddscppz -lnddscz -lnddscorez -endif -endif - -LIBS = -L$(NDDSHOME)/lib/$(ARCH) -L/usr/lib $(NDDSLIBS) $(SYSLIBS) -lglib-2.0 -lgstreamer-0.10 -lgstapp-0.10 - -COMMONSRC = src/CommonInfrastructure/DDSCommunicator.cxx \ - src/CommonInfrastructure/OSAPI.cxx \ - src/CommonInfrastructure/VideoBuffer.cxx \ - src/CommonInfrastructure/VideoSource.cxx \ - src/CommonInfrastructure/VideoOutput.cxx \ - src/CommonInfrastructure/SimCList.cxx - -COMMON_H = src/CommonInfrastructure/DDSCommunicator.h \ - src/CommonInfrastructure/OSAPI.h \ - src/CommonInfrastructure/DDSTypeWrapper.h \ - src/CommonInfrastructure/VideoBuffer.h \ - src/CommonInfrastructure/VideoSource.h - -SOURCES_IDL = src/Generated/VideoData.cxx \ - src/Generated/VideoDataPlugin.cxx \ - src/Generated/VideoDataSupport.cxx - -VIDEOPUB_H = src/VideoPublisher/VideoPublisher.h - -VIDEOPUBSRC = src/VideoPublisher/VideoPublisher.cxx \ - src/VideoPublisher/VideoPublisherInterface.cxx - -VIDEOSUB_H = src/VideoSubscriber/VideoSubscriber.h - -VIDEOSUBSRC = src/VideoSubscriber/VideoSubscriber.cxx \ - src/VideoSubscriber/VideoSubscriberInterface.cxx - -HEADERS_IDL = src/Generated/VideoData.h \ - src/Generated/VideoDataPlugin.h \ - src/Generated/VideoDataSupport.h - -DIRECTORIES = objs.dir objs/$(ARCH).dir objs/$(ARCH)/VideoPublisher.dir \ - objs/$(ARCH)/Common.dir objs/$(ARCH)/VideoSubscriber.dir -SOURCES_NODIR = $(notdir $(COMMONSRC)) $(notdir $(SOURCES_IDL)) -VIDEOPUBSRC_NODIR = $(notdir $(VIDEOPUBSRC)) -VIDEOSUBSRC_NODIR = $(notdir $(VIDEOSUBSRC)) - -COMMONOBJS = $(SOURCES_NODIR:%.cxx=objs/$(ARCH)/Common/%.o) -VIDEOPUBOBJS = $(VIDEOPUBSRC_NODIR:%.cxx=objs/$(ARCH)/VideoPublisher/%.o) $(COMMONOBJS) -VIDEOSUBOBJS = $(VIDEOSUBSRC_NODIR:%.cxx=objs/$(ARCH)/VideoSubscriber/%.o) $(COMMONOBJS) -EXEC = VideoPublisher -SUBEXEC = VideoSubscriber - -############################################################################### -# Build Rules -############################################################################### -$(ARCH): VideoPublisher VideoSubscriber - -VideoPublisher: $(DIRECTORIES) $(VIDEOPUBOBJS) $(EXEC:%=objs/$(ARCH)/VideoPublisher/%.o) \ - $(EXEC:%=objs/$(ARCH)/VideoPublisher/%.out) - -VideoSubscriber: $(DIRECTORIES) $(VIDEOSUBOBJS) $(@:%=objs/$(ARCH)/VideoSubscriber/%.o) \ - $(SUBEXEC:%=objs/$(ARCH)/VideoSubscriber/%.out) - - -# Building the video publisher application -objs/$(ARCH)/VideoPublisher/%.out: objs/$(ARCH)/VideoPublisher/%.o - $(CXXLD) $(CXXLDFLAGS) -o $(@:%.out=%) $(VIDEOPUBOBJS) $(LIBS) - -# Building the video subscriber application -objs/$(ARCH)/VideoSubscriber/%.out: objs/$(ARCH)/VideoSubscriber/%.o - $(CXXLD) $(CXXLDFLAGS) -o $(@:%.out=%) $(VIDEOSUBOBJS) $(LIBS) - -objs/$(ARCH)/Common/%.o: src/CommonInfrastructure/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/Common/%.o: src/Generated/%.cxx $(COMMON_H) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/VideoPublisher/%.o: src/VideoPublisher/%.cxx $(COMMON_H) $(HEADERS_IDL) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - -objs/$(ARCH)/VideoSubscriber/%.o: src/VideoSubscriber/%.cxx $(COMMON_H) $(HEADERS_IDL) - $(CXX) $(CXXFLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $< - - -# Rule to rebuild the generated files when the .idl file change -$(SOURCES_IDL) $(HEADERS_IDL): src/Idl/VideoData.idl - @mkdir -p src/Generated -ifeq ($(OS_ARCH), i86Win32) - call $(NDDSHOME)/scripts/rtiddsgen.bat -d src/idl src/VideoData.idl -replace -language C++ -else - $(NDDSHOME)/scripts/rtiddsgen -namespace -d src/Generated src/Idl/VideoData.idl -replace -language C++ -endif - -generate: $(SOURCES_IDL) $(HEADERS_IDL) - -# Here is how we create those subdirectories automatically. -%.dir : - @echo "Checking directory $*" - @if [ ! -d $* ]; then \ - echo "Making directory $*"; \ - mkdir -p $* ; \ - fi; - -############################################################################### -# Clean target: removes the objs dir -############################################################################### -clean: - @rm -Rf objs/$(ARCH) - @echo "Successfully deleted object and executable files for architecture $(ARCH)" - @echo "To delete ALL the architectures and any generated file use target 'veryclean'" - -veryclean: - @rm -Rf objs - @rm -Rf src/idl - @echo "Deleted all executables, objects and generated files" diff --git a/VideoData/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 b/VideoData/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 deleted file mode 100644 index 636be902..00000000 --- a/VideoData/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################### -## (c) Copyright, Real-Time Innovations, All rights reserved. ## -## ## -## Permission to modify and use for internal purposes granted. ## -## This software is provided "as is", without warranty, express or implied. ## -## ## -############################################################################### - -# Note: -# - To use this Makefile, you must have the 'NDDSHOME' environment variable -# set to the location of RTI Connext. -# -# - You need to invoke the make command from the root directory of this example. -# -# - To enable debugging information, set the Makefile variable 'DEBUG' to '1'. -# Example: -# make -f make/Makefile.i86Linux2.6gcc4.4.5 DEBUG=1 - - -# Defines required Make variables. They will be used in the Makefile.common -# to define the rules to define the build process for this application. -ARCH=i86Linux2.6gcc4.4.5 - -CXX = g++ -CXXFLAGS = -DRTI_UNIX -DRTI_LINUX -m32 -WX_FLAGS = -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -CXXLD = g++ -CXXLDFLAGS = -m32 -static-libgcc -SYSLIBS = -ldl -lnsl -lm -lpthread -lrt - -# The rest of the rules are in the 'Makefile.common' -include make/Makefile.common - diff --git a/VideoData/ExampleCode/scripts/Build.pl b/VideoData/ExampleCode/scripts/Build.pl new file mode 100644 index 00000000..60300e25 --- /dev/null +++ b/VideoData/ExampleCode/scripts/Build.pl @@ -0,0 +1,98 @@ +################################################################################ +# (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. +# RTI grants Licensee a license to use, modify, compile, and create derivative +# works of the Software. Licensee has the right to distribute object form only +# for use with RTI products. The Software is provided "as is", with no warranty +# of any type, including any warranty for fitness for any purpose. RTI is under +# no obligation to maintain or support the Software. RTI shall not be liable +# for any incidental or consequential damages arising out of the use or +# inability to use the software. +################################################################################ + +#!C:/Perl64/bin/perl.exe -w + +use Cwd; + +# The first command prompt argument is the directory to check +$ARCHITECTURE = $ARGV[0]; + +if ($ARCHITECTURE eq "") { + print "ERROR: You have to write an architecture to run this script, e.g.:\n"; + print "\tperl ./scripts/Build.pl i86Win32VS2010\n"; + exit(-1); +} + +system "cmake -H./src -B./projects -DARCHITECTURE=" . $ARCHITECTURE; +if ( $? != 0 ) { + print "ERROR trying to execute cmake\n"; + exit(1); +} + +# $OS is the operating system +$OS = $^O; + +# if the operating system is windows, then we will use the msbuild compiler, +# else will use make +if ($OS =~ /[\s\S]*?Win[\s\S]*?/) { + system "msbuild ./projects/StreamingVideo.sln"; + if ( $? != 0 ) { + print "ERROR compiling ./projects/StreamingVideo.sln example\n"; + exit(1); + } + create_running_scripts("./scripts/VideoStreaming_windows.txt", + "Publisher", $ARCHITECTURE); + create_running_scripts("./scripts/VideoStreaming_windows.txt", + "Subscriber", $ARCHITECTURE); + print "\nCreated running scripts\n"; +} elsif ($OS eq "linux") { + chdir "./projects"; + system "make"; + if ( $? != 0 ) { + print "ERROR compiling StreamingVideo example\n"; + exit(1); + } + chdir ".."; + create_running_scripts("./scripts/VideoStreaming_linux.txt", + "Publisher", $ARCHITECTURE); + create_running_scripts("./scripts/VideoStreaming_linux.txt", + "Subscriber", $ARCHITECTURE); + print "\nCreated running scripts\n"; +} elsif ($OS eq "darwin") { + chdir "./projects"; + system "make"; + if ( $? != 0 ) { + print "ERROR compiling StreamingVideo example\n"; + exit(1); + } + chdir ".."; + create_running_scripts("./scripts/VideoStreaming_linux.txt", + "Publisher", $ARCHITECTURE); + create_running_scripts("./scripts/VideoStreaming_linux.txt", + "Subscriber", $ARCHITECTURE); + print "\nCreated running scripts\n"; +} + +sub create_running_scripts { + my ($filename, $DDS_ENTITY,$arch) = @_; + open(my $fh, '<:utf8', $filename) + or die "Could not open file '$filename' $!"; + + # To copy all the file in a string + local $/ = undef; + $buffer = <$fh>; + $buffer =~ s/\$\{ARCHITECTURE\}/$arch/g; + $buffer =~ s/\$\{DDS_ENTITY\}/$DDS_ENTITY/g; + close $fh; + + if ($OS =~ /[\s\S]*?Win[\s\S]*?/) { + $new_file = "./scripts/Video".$DDS_ENTITY.".bat"; + } else { + $new_file = "./scripts/Video".$DDS_ENTITY.".sh"; + } + + open(my $fh, '>:utf8', $new_file) + or die "Could not create file <$new_file> $!"; + chmod 0775, $new_file; + print $fh $buffer; + close $fh; +} diff --git a/VideoData/ExampleCode/scripts/VideoPublisher.bat b/VideoData/ExampleCode/scripts/VideoPublisher.bat deleted file mode 100755 index aae360e5..00000000 --- a/VideoData/ExampleCode/scripts/VideoPublisher.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -setlocal - -set executableName=VideoPublisher.exe -set appName=VideoPublisher - -set scriptDir=%~dp0 -set args=%* -set releaseBinDir=%scriptDir%..\win32\Release\i86Win32VS2010 -set debugBinDir=%scriptDir%..\win32\Debug\i86Win32VS2010 - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%scriptDir%..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%Path% - -if exist "%releaseBinDir%\%executableName%" ( - cd %releaseBinDir% - call "%executableName%" %args% -) else if exist "%debugBinDir%\%executableName%" ( - cd %debugBinDir% - call "%executableName%" %args% -) else ( - echo. - echo Error: Could not find %executableName% under %releaseBinDir% - echo or %debugBinDir%. - echo. - echo First, please compile %appName% using - echo the Visual Studio solution you will find under - echo %scriptDir%..\win32 - echo. - exit /b 1 -) \ No newline at end of file diff --git a/VideoData/ExampleCode/scripts/VideoPublisher.sh b/VideoData/ExampleCode/scripts/VideoPublisher.sh deleted file mode 100755 index 7dc42596..00000000 --- a/VideoData/ExampleCode/scripts/VideoPublisher.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="VideoPublisher" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/VideoPublisher - -if [ -f $bin_dir/$executable_name ] -then - cd $bin_dir - export LD_LIBRARY_PATH=../thirdparty/proj-4.8.0/lib/i86Linux2.6gcc4.4.5:../thirdparty/wxWidgets-2.9.4/lib/i86Linux2.6gcc4.4.5:$LD_LIBRARY_PATH - ./$executable_name $* -else - echo "***************************************************************" - echo $executable_name executable does not exist in: - echo $bin_dir - echo "" - echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" - echo "***************************************************************" -fi diff --git a/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh b/VideoData/ExampleCode/scripts/VideoStreaming_linux.txt old mode 100755 new mode 100644 similarity index 69% rename from ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh rename to VideoData/ExampleCode/scripts/VideoStreaming_linux.txt index c0740c89..0796e488 --- a/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh +++ b/VideoData/ExampleCode/scripts/VideoStreaming_linux.txt @@ -2,13 +2,12 @@ filename=$0 script_dir=`dirname $filename` -executable_name="RecipeGenerator" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/RecipeGenerator +executable_name="Video${DDS_ENTITY}" +bin_dir=${script_dir}/../src/bin/${ARCHITECTURE} if [ -f $bin_dir/$executable_name ] then cd $bin_dir - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH ./$executable_name $* else echo "***************************************************************" @@ -16,6 +15,6 @@ else echo $bin_dir echo "" echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" + echo " $ perl ./scripts/Build.pl " echo "***************************************************************" fi diff --git a/VideoData/ExampleCode/scripts/VideoStreaming_windows.txt b/VideoData/ExampleCode/scripts/VideoStreaming_windows.txt new file mode 100644 index 00000000..720c3922 --- /dev/null +++ b/VideoData/ExampleCode/scripts/VideoStreaming_windows.txt @@ -0,0 +1,30 @@ +@echo off +setlocal + +set executableName=Video${DDS_ENTITY}.exe +set appName=Video${DDS_ENTITY} + +set scriptDir=%~dp0 +set args=%* +set releaseBinDir=%scriptDir%..\src\bin\${ARCHITECTURE} +set debugBinDir=%scriptDir%..\src\bin\${ARCHITECTURE} + +set Path=%NDDSHOME%\lib\${ARCHITECTURE};%scriptDir%..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%Path% + +if exist "%releaseBinDir%\%executableName%" ( + cd %releaseBinDir% + call "%executableName%" %args% +) else if exist "%debugBinDir%\%executableName%" ( + cd %debugBinDir% + call "%executableName%" %args% +) else ( + echo. + echo Error: Could not find %executableName% under %releaseBinDir% + echo or %debugBinDir%. + echo. + echo First, please build %appName% using + echo the perl script called Build.pl you will find under + echo %scriptDir% + echo. + exit /b 1 +) \ No newline at end of file diff --git a/VideoData/ExampleCode/scripts/VideoSubscriber.bat b/VideoData/ExampleCode/scripts/VideoSubscriber.bat deleted file mode 100755 index 07cdecf4..00000000 --- a/VideoData/ExampleCode/scripts/VideoSubscriber.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -setlocal - -set executableName=VideoSubscriber.exe -set appName=VideoSubscriber - -set scriptDir=%~dp0 -set args=%* -set releaseBinDir=%scriptDir%..\win32\Release\i86Win32VS2010 -set debugBinDir=%scriptDir%..\win32\Debug\i86Win32VS2010 - -set Path=%NDDSHOME%\lib\i86Win32VS2010;%scriptDir%..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%Path% - -if exist "%releaseBinDir%\%executableName%" ( - cd %releaseBinDir% - call "%executableName%" %args% -) else if exist "%debugBinDir%\%executableName%" ( - cd %debugBinDir% - call "%executableName%" %args% -) else ( - echo. - echo Error: Could not find %executableName% under %releaseBinDir% - echo or %debugBinDir%. - echo. - echo First, please compile %appName% using - echo the Visual Studio solution you will find under - echo %scriptDir%..\win32 - echo. - exit /b 1 -) \ No newline at end of file diff --git a/VideoData/ExampleCode/scripts/VideoSubscriber.sh b/VideoData/ExampleCode/scripts/VideoSubscriber.sh deleted file mode 100755 index 39afece0..00000000 --- a/VideoData/ExampleCode/scripts/VideoSubscriber.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="VideoSubscriber" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/VideoSubscriber - -if [ -f $bin_dir/$executable_name ] -then - cd $bin_dir - export LD_LIBRARY_PATH=../thirdparty/proj-4.8.0/lib/i86Linux2.6gcc4.4.5:../thirdparty/wxWidgets-2.9.4/lib/i86Linux2.6gcc4.4.5:$LD_LIBRARY_PATH - ./$executable_name $* -else - echo "***************************************************************" - echo $executable_name executable does not exist in: - echo $bin_dir - echo "" - echo Please, try to recompile the application using the command: - echo " $ make -f make/Makefile.i86Linux2.6gcc4.4.5" - echo "***************************************************************" -fi diff --git a/VideoData/ExampleCode/src/CMakeLists.txt b/VideoData/ExampleCode/src/CMakeLists.txt new file mode 100644 index 00000000..dde40cd0 --- /dev/null +++ b/VideoData/ExampleCode/src/CMakeLists.txt @@ -0,0 +1,43 @@ +project(StreamingVideo) + +# Minimum Required Version of CMake is 2.8.12 for Windows +# and 2.8.8 for the rest of platforms. +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + cmake_minimum_required(VERSION 2.8.12) +else() + cmake_minimum_required(VERSION 2.8.7) +endif() + +# NDDS version +set(RTI_NDDS_VERSION_MAJOR 5) +set(RTI_NDDS_VERSION_MINOR 1) +set(RTI_NDDS_VERSION_RELEASE 0) +set(RTI_NDDS_VERSION_REVISION 00) + +# Add subdirectories +########################################## +# StreamingVideo library +# ------------------------ +# Add cmake scripts directory to the modules path +# ----------------------------------------------- +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake) + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES Debug Release) + set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" + CACHE STRING "Reset the configurations to what we need" FORCE) +endif() + +find_package(ConnextDDS REQUIRED) +find_package(GStreamer REQUIRED) + +# StreamingVideo specific configuration +# ---------------------------- +set(StreamingVideo_BIN_DIR ${CMAKE_CURRENT_LIST_DIR}/bin/${ARCHITECTURE}) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${StreamingVideo_BIN_DIR}) + +add_subdirectory(VideoPublisher) +add_subdirectory(VideoSubscriber) +#including library +add_subdirectory(Generated) diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 02b96fc7..236a2756 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "DDSCommunicator.h" using namespace DDS; @@ -81,11 +82,11 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, PrepareFactoryForDiscoveryListener(); } - DomainParticipant* participant = + _participant = TheParticipantFactory->create_participant(domain, PARTICIPANT_QOS_DEFAULT, NULL, STATUS_MASK_NONE); - if (participant == NULL) + if (_participant == NULL) { std::stringstream errss; errss << "Failed to create DomainParticipant object"; @@ -99,7 +100,7 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, InstallDiscoveryListener(discoveryListener, listenerKind); } - return participant; + return _participant; } // ------------------------------------------------------------------------- // @@ -192,9 +193,9 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, fileNames[i].c_str()); } - DDS_ReturnCode_t retcode = TheParticipantFactory->set_qos(factoryQos); + ReturnCode_t retcode = TheParticipantFactory->set_qos(factoryQos); - if (retcode != DDS_RETCODE_OK) + if (retcode != RETCODE_OK) { std::stringstream errss; errss << "Failed to create DomainParticipant object"; @@ -256,8 +257,8 @@ Publisher* DDSCommunicator::CreatePublisher() // can actually send data. // _pub = GetParticipant()->create_publisher( - DDS_PUBLISHER_QOS_DEFAULT, - NULL, DDS_STATUS_MASK_NONE); + PUBLISHER_QOS_DEFAULT, + NULL, STATUS_MASK_NONE); if (_pub == NULL) { @@ -292,7 +293,7 @@ Publisher* DDSCommunicator::CreatePublisher( _pub = GetParticipant()->create_publisher_with_profile( qosLibrary.c_str(), qosProfile.c_str(), - NULL, DDS_STATUS_MASK_NONE); + NULL, STATUS_MASK_NONE); if (_pub == NULL) { @@ -326,8 +327,8 @@ Subscriber* DDSCommunicator::CreateSubscriber() // create multiple DDS DataReaders. // _sub = GetParticipant()->create_subscriber( - DDS_SUBSCRIBER_QOS_DEFAULT, - NULL, DDS_STATUS_MASK_NONE); + SUBSCRIBER_QOS_DEFAULT, + NULL, STATUS_MASK_NONE); if (_sub == NULL) { @@ -364,7 +365,7 @@ Subscriber* DDSCommunicator::CreateSubscriber( _sub = GetParticipant()->create_subscriber_with_profile( qosLibrary.c_str(), qosProfile.c_str(), - NULL, DDS_STATUS_MASK_NONE); + NULL, STATUS_MASK_NONE); if (_sub == NULL) { std::stringstream errss; @@ -382,7 +383,7 @@ Subscriber* DDSCommunicator::CreateSubscriber( // the application to add a listener for discovery. void DDSCommunicator::PrepareFactoryForDiscoveryListener() { - DDS_DomainParticipantFactoryQos factoryQos; + DomainParticipantFactoryQos factoryQos; TheParticipantFactory->get_qos(factoryQos); factoryQos.entity_factory.autoenable_created_entities = false; TheParticipantFactory->set_qos(factoryQos); @@ -398,15 +399,15 @@ void DDSCommunicator::InstallDiscoveryListener( char *discoveryTopic = NULL; if (listenerKind == PARTICIPANT_DISCOVERY_KIND) { - discoveryTopic = (char *)DDS_PARTICIPANT_TOPIC_NAME; + discoveryTopic = (char *)PARTICIPANT_TOPIC_NAME; } if (listenerKind == DATAWRITER_DISCOVERY_KIND) { - discoveryTopic = (char *)DDS_PUBLICATION_TOPIC_NAME; + discoveryTopic = (char *)PUBLICATION_TOPIC_NAME; } if (listenerKind == DATAREADER_DISCOVERY_KIND) { - discoveryTopic = (char *)DDS_SUBSCRIPTION_TOPIC_NAME; + discoveryTopic = (char *)SUBSCRIPTION_TOPIC_NAME; } // Lookup the builtin DataReader to listen for either Participant discovery, @@ -425,7 +426,7 @@ void DDSCommunicator::InstallDiscoveryListener( // Listen for discovery events builtinReader->set_listener(discoveryListener, - DDS_DATA_AVAILABLE_STATUS); + DATA_AVAILABLE_STATUS); // Enable the DomainParticipant _participant->enable(); diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h index c6bd1f62..f01b5e0e 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h +++ b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef DDS_COMMUNICATOR_H #define DDS_COMMUNICATOR_H diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h b/VideoData/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h index a74c1933..884c2aed 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h +++ b/VideoData/ExampleCode/src/CommonInfrastructure/DDSTypeWrapper.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef DDS_TYPE_WRAPPER_H #define DDS_TYPE_WRAPPER_H diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.cxx index 977c5d7b..0bebad8d 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.cxx @@ -1,12 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #include "../CommonInfrastructure/OSAPI.h" OSThread::OSThread( diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.h b/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.h index 893117dd..d07799e8 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.h +++ b/VideoData/ExampleCode/src/CommonInfrastructure/OSAPI.h @@ -1,13 +1,13 @@ -/********************************************************************************************* -(c) 2005-2013 Copyright, Real-Time Innovations, Inc. All rights reserved. -RTI grants Licensee a license to use, modify, compile, and create derivative works -of the Software. Licensee has the right to distribute object form only for use with RTI -products. The Software is provided “as is”, with no warranty of any type, including -any warranty for fitness for any purpose. RTI is under no obligation to maintain or -support the Software. RTI shall not be liable for any incidental or consequential -damages arising out of the use or inability to use the software. -**********************************************************************************************/ - +/******************************************************************************* + (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved. + RTI grants Licensee a license to use, modify, compile, and create derivative + works of the Software. Licensee has the right to distribute object form only + for use with RTI products. The Software is provided "as is", with no warranty + of any type, including any warranty for fitness for any purpose. RTI is under + no obligation to maintain or support the Software. RTI shall not be liable for + any incidental or consequential damages arising out of the use or inability to + use the software. + ******************************************************************************/ #ifndef OSAPI_H #define OSAPI_H diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/SimCList.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/SimCList.cxx index b62c9172..ddabd119 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/SimCList.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/SimCList.cxx @@ -20,7 +20,6 @@ */ /* SimCList implementation, version 1.6 */ - #include #include #include /* for setting errno */ @@ -30,7 +29,9 @@ # include # include #else -//#define _WINSOCKAPI_ +#define _WINSOCKAPI_ +// if we want to use timeGetTime() we need to undef WIN32_LEAN_AND_MEAN +#undef WIN32_LEAN_AND_MEAN #include #include #endif diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/VideoOutput.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/VideoOutput.cxx index 6f3a328a..c4b10c6c 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/VideoOutput.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/VideoOutput.cxx @@ -91,7 +91,10 @@ static GstBusSyncReply bus_sync_handler( { GstElement *outwin = NULL; GValue *val = (GValue *)g_value_array_new(1); - +//if we aren't using windows we will set their initial value +#ifndef WIN32 + *val = G_VALUE_INIT; +#endif outwin = gst_bin_get_by_name((GstBin*)user_data,"sink"); if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT) diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/VideoSource.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/VideoSource.cxx index 75290cdb..51e09dac 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/VideoSource.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/VideoSource.cxx @@ -174,7 +174,7 @@ int EMDSVideoSource::Initialize() } // Create a file source that will load the file pointed to by the URL - GstElement *source = gst_element_factory_make("filesrc", "filesrc"); + GstElement *source = gst_element_factory_make("filesrc", NULL); if (source == NULL) { std::cout << "Error creating file source" << std::endl; @@ -290,13 +290,28 @@ std::string EMDSVideoSource::GetStreamMetadata() bool EMDSVideoSource::IsMetadataCompatible( std::string subscriberMetadata) { - GstCaps *sourceCaps = gst_caps_from_string( - GetStreamMetadata().c_str()); - GstCaps *sinkCaps = gst_caps_from_string( - subscriberMetadata.c_str()); - return (bool)gst_caps_is_always_compatible( - sourceCaps, - sinkCaps); + bool isCompatible = false; + bool strictCodecChecking = false; + + GstCaps *sourceCaps = gst_caps_from_string( + GetStreamMetadata().c_str()); + GstCaps *sinkCaps = gst_caps_from_string( + subscriberMetadata.c_str()); + + isCompatible = (bool)gst_caps_is_always_compatible( + sourceCaps, + sinkCaps); + + // if you don't want a strict compatibility, allways return true + if (strictCodecChecking == false) { + if (isCompatible == false) { + std::cout << "The codecs are incompatibles. " << + "Anyway, the video will be sent." << std::endl; + } + + isCompatible = true; + } + return isCompatible; } // ---------------------------------------------------------------------------- @@ -321,7 +336,7 @@ int EMDSVideoSource::Start() std::cout << "Video Source: VideoSource started" << std::endl; - return 0; + return 0; } // ---------------------------------------------------------------------------- diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/simclist.h b/VideoData/ExampleCode/src/CommonInfrastructure/simclist.h index a92f606c..2a5e03bc 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/simclist.h +++ b/VideoData/ExampleCode/src/CommonInfrastructure/simclist.h @@ -55,8 +55,12 @@ extern "C" { #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* "inline" and "restrict" are keywords */ #else -# define inline /* inline */ -# define restrict /* restrict */ +# ifndef inline +# define inline /* inline */ +# endif +# ifndef restrict +# define restrict /* restrict */ +# endif #endif diff --git a/VideoData/ExampleCode/src/Config/base_profile_multicast.xml b/VideoData/ExampleCode/src/Config/base_profile_multicast.xml index 7e1e738d..a8d27a9c 100644 --- a/VideoData/ExampleCode/src/Config/base_profile_multicast.xml +++ b/VideoData/ExampleCode/src/Config/base_profile_multicast.xml @@ -1,15 +1,15 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -28,69 +28,22 @@ RTI Connext user manual. - + - - 65507 - - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - - - dds.transport.shmem.builtin.received_message_count_max 2048 - - - - - - diff --git a/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml b/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml index b6883a59..69bc2275 100644 --- a/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml +++ b/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml @@ -1,15 +1,15 @@ + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -27,57 +27,10 @@ RTI Connext user manual. - + - - - 65507 - - - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65507 - - - - - dds.transport.UDPv4.builtin.send_socket_buffer_size - 2097152 - - - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 - - - - - dds.transport.shmem.builtin.parent.message_size_max - 65507 - - - - - dds.transport.shmem.builtin.receive_buffer_size - 2097152 - - + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> - - - - + - - RELIABLE_RELIABILITY_QOS - - - - - - - KEEP_LAST_HISTORY_QOS - 50 - - - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - - BEST_EFFORT_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 50 - + + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> - + - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 50 - + - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - - BEST_EFFORT_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 50 - +