From b9134d4c8ddf1ec3228765142154047a73c291a7 Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Wed, 5 Mar 2014 15:29:37 -0800 Subject: [PATCH 01/19] Minor update to the README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11d9a862..514a449c 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: From 174a8cdca098bca71bbbabbf16c425c1db98628f Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Mon, 7 Apr 2014 17:26:30 -0700 Subject: [PATCH 02/19] Fixed minor bug in DomainParticipant creation --- .../CommonInfrastructure/DDSCommunicator.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 32e0bfc9..1b17bd44 100644 --- a/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -71,18 +71,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; } // ------------------------------------------------------------------------- // @@ -206,8 +206,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) { @@ -242,7 +242,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) { @@ -276,8 +276,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) { @@ -314,7 +314,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; From f578e663a53270d7bfd487edfeec39577c65a4a4 Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Mon, 7 Apr 2014 17:34:11 -0700 Subject: [PATCH 03/19] Fixed minor bug --- .../src/CommonInfrastructure/DDSCommunicator.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 02b96fc7..f2615a34 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -81,11 +81,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 +99,7 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, InstallDiscoveryListener(discoveryListener, listenerKind); } - return participant; + return _participant; } // ------------------------------------------------------------------------- // From 4cf16e27e48e0725adfe36d5c6811105b265345c Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Mon, 7 Apr 2014 17:47:27 -0700 Subject: [PATCH 04/19] Fixing minor bug --- .../src/CommonInfrastructure/DDSCommunicator.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 1d09d09a..38dc4f11 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -72,18 +72,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; } // ------------------------------------------------------------------------- // From 56da4e9bb0229d50cd04b4af8d0ed77f041310a2 Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Wed, 23 Apr 2014 16:07:52 -0700 Subject: [PATCH 05/19] Minor fixes to style --- .../CommonInfrastructure/DDSCommunicator.cxx | 16 ++++++------ .../CommonInfrastructure/DDSCommunicator.cxx | 6 ++--- .../CommonInfrastructure/DDSCommunicator.cxx | 26 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 38dc4f11..607f9e7d 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -158,9 +158,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 +207,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 +243,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 +277,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 +315,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/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index 1b17bd44..60e7dd5f 100644 --- a/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -147,7 +147,7 @@ DomainParticipant* DDSCommunicator::CreateParticipant(long domain, DomainParticipantFactoryQos factoryQos; TheParticipantFactory->get_qos(factoryQos); factoryQos.profile.url_profile.ensure_length(fileNames.size(), - fileNames.size()); + fileNames.size()); for (unsigned int i = 0; i < fileNames.size(); i++) { @@ -157,9 +157,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"; diff --git a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index f2615a34..8894a4c1 100644 --- a/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/VideoData/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -192,9 +192,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 +256,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 +292,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 +326,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 +364,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 +382,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 +398,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 +425,7 @@ void DDSCommunicator::InstallDiscoveryListener( // Listen for discovery events builtinReader->set_listener(discoveryListener, - DDS_DATA_AVAILABLE_STATUS); + DATA_AVAILABLE_STATUS); // Enable the DomainParticipant _participant->enable(); From ce8697586c0e3756a6582495f14a316f2da25d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Aranda?= Date: Wed, 23 Apr 2014 18:02:01 -0700 Subject: [PATCH 06/19] Fixed a weird character in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 514a449c..0f2d9a66 100644 --- a/README.md +++ b/README.md @@ -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. From ed6339668ec6d5d71572c04dcd2054e010b06ff2 Mon Sep 17 00:00:00 2001 From: rosemwahlin Date: Thu, 8 May 2014 18:11:27 -0700 Subject: [PATCH 07/19] Copyright statement on header file --- .../ExampleCode/src/TrackGui/NetworkInterface.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h index 5dad4770..a87dd0c4 100644 --- a/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h +++ b/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h @@ -1,3 +1,12 @@ +/********************************************************************************************* +(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 From 0842763a739a045cd71fa9d9a31f7bfa1008c067 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Wed, 13 Aug 2014 17:49:03 +0200 Subject: [PATCH 08/19] Updated the QoS profiles in order to use Built-in profiles --- .../src/Config/base_profile_multicast.xml | 53 +-------- .../src/Config/base_profile_no_multicast.xml | 58 +--------- .../src/Config/recipe_profiles_multicast.xml | 62 +---------- .../Config/recipe_profiles_no_multicast.xml | 62 +---------- .../ExampleCode/apps/PrototyperConfig.xml | 4 +- .../ExampleCode/routing/Routing-TCP-LAN.xml | 19 +--- .../ExampleCode/routing/Routing-TCP-WAN.xml | 19 +--- .../ExampleCode/routing/Routing-UDP-LAN.xml | 20 +--- .../ExampleCode/routing/tools-QoS-profile.xml | 4 +- .../resource/replay/record_config.xml | 50 +-------- .../resource/replay/replay_config.xml | 48 +------- .../src/Config/base_profile_multicast.xml | 48 +------- .../src/Config/base_profile_no_multicast.xml | 56 +--------- .../Config/flight_plan_profiles_multicast.xml | 80 +------------- .../flight_plan_profiles_no_multicast.xml | 84 +------------- .../src/Config/radar_profiles_multicast.xml | 102 +---------------- .../Config/radar_profiles_no_multicast.xml | 103 +----------------- .../src/Config/base_profile_multicast.xml | 61 ++--------- .../src/Config/base_profile_no_multicast.xml | 53 +-------- .../src/Config/video_stream_multicast.xml | 73 +------------ .../src/Config/video_stream_no_multicast.xml | 65 +---------- 21 files changed, 75 insertions(+), 1049 deletions(-) diff --git a/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml b/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml index 038e3a07..185531aa 100644 --- a/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml +++ b/ChocolateFactory/ExampleCode/src/Config/base_profile_multicast.xml @@ -18,8 +18,8 @@ RTI Connext user manual. --> + 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,20 +30,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - @@ -68,35 +54,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..88bfbc84 100644 --- a/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml +++ b/ChocolateFactory/ExampleCode/src/Config/recipe_profiles_no_multicast.xml @@ -18,8 +18,8 @@ For more information about XML QoS Profiles see Chapter 15 in the RTI Connext user manual. --> + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> @@ -30,20 +30,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - @@ -68,35 +54,6 @@ RTI Connext user manual. - - - - 0 - 50000000 - - - 0 - 10000000 - - - 0 - 50000000 - - - - - 0 - 0 - - - - - - RELIABLE_RELIABILITY_QOS - - - - - TRANSIENT_LOCAL_DURABILITY_QOS - - diff --git a/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml b/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml index 90f577d0..d675a545 100644 --- a/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml +++ b/DataSubsetWAN/ExampleCode/apps/PrototyperConfig.xml @@ -3,8 +3,8 @@ RTI Data Distribution Service Deployment --> + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_profiles.xsd" + version="5.1.0"> diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml index 0659bd6c..62f77b1f 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml @@ -1,37 +1,26 @@ + 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..46c19a00 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml @@ -1,37 +1,26 @@ + 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..5af61625 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml @@ -1,37 +1,25 @@ + 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..148992e5 100644 --- a/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml +++ b/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml @@ -1,7 +1,7 @@ + xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.1.0/rti_dds_qos_profiles.xsd" + version="5.1.0"> diff --git a/VehicleTracking/ExampleCode/resource/replay/record_config.xml b/VehicleTracking/ExampleCode/resource/replay/record_config.xml index 509da674..81aa1f1f 100644 --- a/VehicleTracking/ExampleCode/resource/replay/record_config.xml +++ b/VehicleTracking/ExampleCode/resource/replay/record_config.xml @@ -1,4 +1,4 @@ - + + + @@ -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 @@ -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 +30,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 +46,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - @@ -228,8 +151,7 @@ RTI Connext user manual. multicast. However, if somebody does enable multicast on a DataReader, this will prevent potential delays. --> - true - + true @@ -238,22 +160,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..e655ed7f 100644 --- a/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml +++ b/VehicleTracking/ExampleCode/src/Config/radar_profiles_no_multicast.xml @@ -7,35 +7,16 @@ For more information about XML QoS Profiles see Chapter 15 in the RTI Connext user manual. --> + 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 +44,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - @@ -239,22 +158,6 @@ RTI Connext user manual. - - - - RELIABLE_RELIABILITY_QOS - - - - - - KEEP_LAST_HISTORY_QOS - 1 - - diff --git a/VideoData/ExampleCode/src/Config/base_profile_multicast.xml b/VideoData/ExampleCode/src/Config/base_profile_multicast.xml index 7e1e738d..cdb3bbac 100644 --- a/VideoData/ExampleCode/src/Config/base_profile_multicast.xml +++ b/VideoData/ExampleCode/src/Config/base_profile_multicast.xml @@ -18,8 +18,8 @@ RTI Connext user manual. --> + 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..feab9c53 100644 --- a/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml +++ b/VideoData/ExampleCode/src/Config/base_profile_no_multicast.xml @@ -17,8 +17,8 @@ For more information about XML QoS Profiles see Chapter 15 in the RTI Connext user manual. --> + 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 - + - diff --git a/ChocolateFactory/ExampleCode/src/Config/base_profile_no_multicast.xml b/ChocolateFactory/ExampleCode/src/Config/base_profile_no_multicast.xml index 1b58223e..20e3fd9b 100644 --- a/ChocolateFactory/ExampleCode/src/Config/base_profile_no_multicast.xml +++ b/ChocolateFactory/ExampleCode/src/Config/base_profile_no_multicast.xml @@ -1,15 +1,15 @@ + diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml index 0659bd6c..06ffa027 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-LAN.xml @@ -1,4 +1,14 @@ + diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml index 62d4448b..60d5e9ae 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-TCP-WAN.xml @@ -1,4 +1,14 @@ + diff --git a/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml b/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml index 6e9f356c..27eff51e 100644 --- a/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml +++ b/DataSubsetWAN/ExampleCode/routing/Routing-UDP-LAN.xml @@ -1,4 +1,14 @@ + diff --git a/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml b/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml index c9712f28..5e567b6a 100644 --- a/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml +++ b/DataSubsetWAN/ExampleCode/routing/tools-QoS-profile.xml @@ -1,4 +1,14 @@ + From bfe92d68c959917ca41cedeb417137550c3060d8 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Wed, 13 Aug 2014 19:07:57 +0200 Subject: [PATCH 11/19] Updated copyright notice in VehicleTracking example --- .../resource/replay/record_config.xml | 21 +++++++++--------- .../resource/replay/replay_config.xml | 21 +++++++++--------- .../CommonInfrastructure/DDSCommunicator.cxx | 19 ++++++++-------- .../CommonInfrastructure/DDSCommunicator.h | 19 ++++++++-------- .../src/CommonInfrastructure/DDSTypeWrapper.h | 20 ++++++++--------- .../src/CommonInfrastructure/OSAPI.cxx | 19 ++++++++-------- .../src/CommonInfrastructure/OSAPI.h | 20 ++++++++--------- .../src/Config/base_profile_multicast.xml | 20 ++++++++--------- .../src/Config/base_profile_no_multicast.xml | 20 ++++++++--------- .../Config/flight_plan_profiles_multicast.xml | 21 +++++++++--------- .../flight_plan_profiles_no_multicast.xml | 21 +++++++++--------- .../src/Config/radar_profiles_multicast.xml | 10 +++++++++ .../Config/radar_profiles_no_multicast.xml | 10 +++++++++ .../FlightPlanGenerator.cxx | 20 ++++++++--------- .../FlightPlanPublisherInterface.cxx | 19 ++++++++-------- .../FlightPlanPublisherInterface.h | 22 +++++++++---------- .../ExampleCode/src/Idl/AirTrafficControl.idl | 20 ++++++++--------- .../src/RadarGenerator/GeneratorAdapter.h | 21 +++++++++--------- .../ExampleCode/src/RadarGenerator/RadarApp.h | 21 +++++++++--------- .../src/RadarGenerator/RadarGenerator.cxx | 20 ++++++++--------- .../src/RadarGenerator/RadarInterface.cxx | 20 ++++++++--------- .../src/RadarGenerator/RadarInterface.h | 19 ++++++++-------- .../src/RadarGenerator/TrackGenerator.cxx | 19 ++++++++-------- .../src/RadarGenerator/TrackGenerator.h | 21 +++++++++--------- .../ExampleCode/src/TrackGui/FlightInfo.h | 10 +++++++++ .../src/TrackGui/NetworkInterface.cxx | 19 ++++++++-------- .../src/TrackGui/NetworkInterface.h | 19 ++++++++-------- .../ExampleCode/src/TrackGui/TrackApp.h | 21 +++++++++--------- .../ExampleCode/src/TrackGui/TrackGUI.cxx | 20 ++++++++--------- .../ExampleCode/src/TrackGui/TrackGUI.h | 20 ++++++++--------- .../ExampleCode/src/TrackGui/TrackGuiApp.cxx | 20 ++++++++--------- .../src/TrackGui/TrackPresenter.cxx | 19 ++++++++-------- .../ExampleCode/src/TrackGui/TrackPresenter.h | 19 ++++++++-------- 33 files changed, 335 insertions(+), 295 deletions(-) diff --git a/VehicleTracking/ExampleCode/resource/replay/record_config.xml b/VehicleTracking/ExampleCode/resource/replay/record_config.xml index 509da674..22ad066b 100644 --- a/VehicleTracking/ExampleCode/resource/replay/record_config.xml +++ b/VehicleTracking/ExampleCode/resource/replay/record_config.xml @@ -1,16 +1,15 @@ + - - - AUTO + AUTOMATIC 0 From 107db7d16dfc025a2536c0eaaf1e7245152a7fb5 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Thu, 14 Aug 2014 14:15:33 +0200 Subject: [PATCH 15/19] Updated information messages to version 5.1.0 --- DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.bat | 2 +- DataSubsetWAN/ExampleCode/scripts/StartRouterTCPLAN.sh | 2 +- DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.bat | 2 +- DataSubsetWAN/ExampleCode/scripts/StartRouterTCPWAN.sh | 2 +- DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.bat | 2 +- DataSubsetWAN/ExampleCode/scripts/StartRouterUDPLAN.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) 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 From 19103ecb09266d3cf3568ee0ba9570ffa89bfe09 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Mon, 18 Aug 2014 12:07:27 +0200 Subject: [PATCH 16/19] Updated README from DataSubsetWAN in order to use Prototyper 5.1.0 --- DataSubsetWAN/README.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/DataSubsetWAN/README.txt b/DataSubsetWAN/README.txt index f2fb2fa4..b952ab39 100644 --- a/DataSubsetWAN/README.txt +++ b/DataSubsetWAN/README.txt @@ -47,10 +47,8 @@ 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 +This example depends on the RTI Prototyper with Lua experimental product. From +RTI Connext DDS 5.1.0, the RTI Prototyper with Lua is included itself. How to Run this Example @@ -59,15 +57,11 @@ 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. From b1e830c34c49979ca59d73a126795fa2aa5d8b07 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Wed, 20 Aug 2014 15:50:24 +0200 Subject: [PATCH 17/19] Updated README file of DataSubsetWAN example in order to use prototyper 5.1.0 --- DataSubsetWAN/README.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/DataSubsetWAN/README.txt b/DataSubsetWAN/README.txt index b952ab39..a9dca410 100644 --- a/DataSubsetWAN/README.txt +++ b/DataSubsetWAN/README.txt @@ -44,13 +44,6 @@ 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. From -RTI Connext DDS 5.1.0, the RTI Prototyper with Lua is included itself. - - How to Run this Example ----------------------- From 06945a1d684727f34571db7f69028772ba57dc9a Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Tue, 16 Sep 2014 20:10:05 +0200 Subject: [PATCH 18/19] Added CMake project for VideoData example --- VideoData/ExampleCode/make/Makefile.common | 184 --- .../make/Makefile.i86Linux2.6gcc4.4.5 | 33 - VideoData/ExampleCode/scripts/Build.pl | 98 ++ .../ExampleCode/scripts/VideoPublisher.bat | 30 - ...oPublisher.sh => VideoStreaming_linux.txt} | 7 +- .../scripts/VideoStreaming_windows.txt | 30 + .../ExampleCode/scripts/VideoSubscriber.bat | 30 - .../ExampleCode/scripts/VideoSubscriber.sh | 21 - VideoData/ExampleCode/src/CMakeLists.txt | 43 + .../src/CommonInfrastructure/SimCList.cxx | 5 +- .../src/CommonInfrastructure/VideoOutput.cxx | 5 +- .../src/CommonInfrastructure/VideoSource.cxx | 33 +- .../src/CommonInfrastructure/simclist.h | 8 +- .../ExampleCode/src/Generated/CMakeLists.txt | 49 + .../ExampleCode/src/Generated/VideoData.cxx | 352 +++++ .../ExampleCode/src/Generated/VideoData.h | 153 ++ .../src/Generated/VideoDataPlugin.cxx | 1398 +++++++++++++++++ .../src/Generated/VideoDataPlugin.h | 335 ++++ .../src/Generated/VideoDataSupport.cxx | 158 ++ .../src/Generated/VideoDataSupport.h | 89 ++ .../src/VideoPublisher/CMakeLists.txt | 76 + .../src/VideoPublisher/VideoPublisher.cxx | 1 + .../src/VideoSubscriber/CMakeLists.txt | 66 + .../src/cmake/FindConnextDDS.cmake | 112 ++ .../ExampleCode/src/cmake/FindGStreamer.cmake | 91 ++ .../ExampleCode/win32/SharedDataTypes.vcxproj | 109 -- .../win32/SharedDataTypes.vcxproj.filters | 47 - .../win32/SharedDataTypes.vcxproj.user | 3 - .../win32/StreamingVideoExample-vs2010.sln | 31 - .../ExampleCode/win32/VideoPublisher.vcxproj | 131 -- .../win32/VideoPublisher.vcxproj.filters | 80 - .../win32/VideoPublisher.vcxproj.user | 16 - .../ExampleCode/win32/VideoSubscriber.vcxproj | 131 -- .../win32/VideoSubscriber.vcxproj.filters | 80 - .../win32/VideoSubscriber.vcxproj.user | 15 - VideoData/README.txt | 41 +- 36 files changed, 3117 insertions(+), 974 deletions(-) delete mode 100644 VideoData/ExampleCode/make/Makefile.common delete mode 100644 VideoData/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 create mode 100644 VideoData/ExampleCode/scripts/Build.pl delete mode 100755 VideoData/ExampleCode/scripts/VideoPublisher.bat rename VideoData/ExampleCode/scripts/{VideoPublisher.sh => VideoStreaming_linux.txt} (59%) mode change 100755 => 100644 create mode 100644 VideoData/ExampleCode/scripts/VideoStreaming_windows.txt delete mode 100755 VideoData/ExampleCode/scripts/VideoSubscriber.bat delete mode 100755 VideoData/ExampleCode/scripts/VideoSubscriber.sh create mode 100644 VideoData/ExampleCode/src/CMakeLists.txt create mode 100644 VideoData/ExampleCode/src/Generated/CMakeLists.txt create mode 100644 VideoData/ExampleCode/src/Generated/VideoData.cxx create mode 100644 VideoData/ExampleCode/src/Generated/VideoData.h create mode 100644 VideoData/ExampleCode/src/Generated/VideoDataPlugin.cxx create mode 100644 VideoData/ExampleCode/src/Generated/VideoDataPlugin.h create mode 100644 VideoData/ExampleCode/src/Generated/VideoDataSupport.cxx create mode 100644 VideoData/ExampleCode/src/Generated/VideoDataSupport.h create mode 100644 VideoData/ExampleCode/src/VideoPublisher/CMakeLists.txt create mode 100644 VideoData/ExampleCode/src/VideoSubscriber/CMakeLists.txt create mode 100644 VideoData/ExampleCode/src/cmake/FindConnextDDS.cmake create mode 100644 VideoData/ExampleCode/src/cmake/FindGStreamer.cmake delete mode 100644 VideoData/ExampleCode/win32/SharedDataTypes.vcxproj delete mode 100644 VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.filters delete mode 100644 VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.user delete mode 100644 VideoData/ExampleCode/win32/StreamingVideoExample-vs2010.sln delete mode 100644 VideoData/ExampleCode/win32/VideoPublisher.vcxproj delete mode 100644 VideoData/ExampleCode/win32/VideoPublisher.vcxproj.filters delete mode 100644 VideoData/ExampleCode/win32/VideoPublisher.vcxproj.user delete mode 100644 VideoData/ExampleCode/win32/VideoSubscriber.vcxproj delete mode 100644 VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.filters delete mode 100644 VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.user 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/VideoStreaming_linux.txt old mode 100755 new mode 100644 similarity index 59% rename from VideoData/ExampleCode/scripts/VideoPublisher.sh rename to VideoData/ExampleCode/scripts/VideoStreaming_linux.txt index 7dc42596..0796e488 --- a/VideoData/ExampleCode/scripts/VideoPublisher.sh +++ b/VideoData/ExampleCode/scripts/VideoStreaming_linux.txt @@ -2,13 +2,12 @@ filename=$0 script_dir=`dirname $filename` -executable_name="VideoPublisher" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/VideoPublisher +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=../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 "***************************************************************" @@ -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/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/Generated/CMakeLists.txt b/VideoData/ExampleCode/src/Generated/CMakeLists.txt new file mode 100644 index 00000000..6852a539 --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/CMakeLists.txt @@ -0,0 +1,49 @@ +######################## +# SharedDataTypes +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/Generated +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} +) + +# Library +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE SharedDataTypes_sources + ${CMAKE_SOURCE_DIR}/Generated/VideoData.cxx + ${CMAKE_SOURCE_DIR}/Generated/VideoData.h + ${CMAKE_SOURCE_DIR}/Generated/VideoDataPlugin.cxx + ${CMAKE_SOURCE_DIR}/Generated/VideoDataPlugin.h + ${CMAKE_SOURCE_DIR}/Generated/VideoDataSupport.cxx + ${CMAKE_SOURCE_DIR}/Generated/VideoDataSupport.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} + ${StreamingVideo_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ) +endforeach() diff --git a/VideoData/ExampleCode/src/Generated/VideoData.cxx b/VideoData/ExampleCode/src/Generated/VideoData.cxx new file mode 100644 index 00000000..5b7b171c --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoData.cxx @@ -0,0 +1,352 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 "VideoData.h" + + +namespace com{ + +namespace rti{ + +namespace media{ + +namespace generated{ +/* ========================================================================= */ +const char *VideoStreamTYPENAME = "com::rti::media::generated::VideoStream"; + +DDS_TypeCode* VideoStream_get_typecode() +{ + static RTIBool is_initialized = RTI_FALSE; + + static DDS_TypeCode VideoStream_g_tc_frame_sequence = DDS_INITIALIZE_SEQUENCE_TYPECODE((com::rti::media::generated::MAX_BUFFER_SIZE),NULL); + + static DDS_TypeCode_Member VideoStream_g_tc_members[4]= + { + { + (char *)"stream_id",/* 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 *)"flags",/* 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 */ + }, + { + (char *)"sequence_number",/* 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 *)"frame",/* 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 */ + } + }; + + static DDS_TypeCode VideoStream_g_tc = + {{ + DDS_TK_STRUCT,/* Kind */ + DDS_BOOLEAN_FALSE, /* Ignored */ + -1,/* Ignored */ + (char *)"com::rti::media::generated::VideoStream", /* Name */ + NULL, /* Ignored */ + 0, /* Ignored */ + 0, /* Ignored */ + NULL, /* Ignored */ + 4, /* Number of members */ + VideoStream_g_tc_members, /* Members */ + DDS_VM_NONE /* Ignored */ + }}; /* Type code for VideoStream*/ + + if (is_initialized) { + return &VideoStream_g_tc; + } + + VideoStream_g_tc_frame_sequence._data._typeCode = (RTICdrTypeCode *)&DDS_g_tc_octet; + + VideoStream_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; + VideoStream_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_ulong; + VideoStream_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_ulong; + VideoStream_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)&VideoStream_g_tc_frame_sequence; + + is_initialized = RTI_TRUE; + + return &VideoStream_g_tc; +} + + +RTIBool VideoStream_initialize( + VideoStream* sample) { + return ::com::rti::media::generated::VideoStream_initialize_ex(sample,RTI_TRUE,RTI_TRUE); +} + +RTIBool VideoStream_initialize_ex( + VideoStream* 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::media::generated::VideoStream_initialize_w_params( + sample,&allocParams); +} + +RTIBool VideoStream_initialize_w_params( + VideoStream* sample, + const struct DDS_TypeAllocationParams_t * allocParams) +{ + + void* buffer = NULL; + if (buffer) {} /* To avoid warnings */ + + + if (allocParams) {} /* To avoid warnings */ + + + if (!RTICdrType_initLong(&sample->stream_id)) { + return RTI_FALSE; + } + + + if (!RTICdrType_initUnsignedLong(&sample->flags)) { + return RTI_FALSE; + } + + + if (!RTICdrType_initUnsignedLong(&sample->sequence_number)) { + return RTI_FALSE; + } + + + if (allocParams->allocate_memory) { + DDS_OctetSeq_initialize(&sample->frame); + if (!DDS_OctetSeq_set_maximum(&sample->frame, + ((com::rti::media::generated::MAX_BUFFER_SIZE)))) { + return RTI_FALSE; + } + } else { + DDS_OctetSeq_set_length(&sample->frame, 0); + } + + + + return RTI_TRUE; +} + +void VideoStream_finalize( + VideoStream* sample) +{ + ::com::rti::media::generated::VideoStream_finalize_ex(sample,RTI_TRUE); +} + +void VideoStream_finalize_ex( + VideoStream* 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::media::generated::VideoStream_finalize_w_params( + sample,&deallocParams); +} + +void VideoStream_finalize_w_params( + VideoStream* sample, + const struct DDS_TypeDeallocationParams_t * deallocParams) +{ + if (sample) { } /* To avoid warnings */ + if (deallocParams) {} /* To avoid warnings */ + + + + + + DDS_OctetSeq_finalize(&sample->frame); + + +} + +void VideoStream_finalize_optional_members( + VideoStream* 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; + + + + + + +} + +RTIBool VideoStream_copy( + VideoStream* dst, + const VideoStream* src) +{ + + if (!RTICdrType_copyLong( + &dst->stream_id, &src->stream_id)) { + return RTI_FALSE; + } + + + if (!RTICdrType_copyUnsignedLong( + &dst->flags, &src->flags)) { + return RTI_FALSE; + } + + + if (!RTICdrType_copyUnsignedLong( + &dst->sequence_number, &src->sequence_number)) { + return RTI_FALSE; + } + + + if (!DDS_OctetSeq_copy(&dst->frame, + &src->frame)) { + return RTI_FALSE; + } + + + + return RTI_TRUE; +} + + +/** + * <> + * + * Defines: TSeq, T + * + * Configure and implement 'VideoStream' sequence class. + */ +#define T VideoStream +#define TSeq VideoStreamSeq +#define T_initialize_w_params ::com::rti::media::generated::VideoStream_initialize_w_params +#define T_finalize_w_params ::com::rti::media::generated::VideoStream_finalize_w_params +#define T_copy ::com::rti::media::generated::VideoStream_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 media */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/VideoData/ExampleCode/src/Generated/VideoData.h b/VideoData/ExampleCode/src/Generated/VideoData.h new file mode 100644 index 00000000..d109bd3f --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoData.h @@ -0,0 +1,153 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 VideoData_1974959798_h +#define VideoData_1974959798_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 media{ + +namespace generated{ + +static const char * VIDEO_TOPIC = "VideoData"; +static const char * QOS_LIBRARY = "RTIExampleQosLibrary"; +static const char * QOS_PROFILE_STREAMING_DATA = "StreamingVideoData"; +static const char * QOS_PROFILE_MULTICAST_DATA = "MulticastVideo"; +static const DDS_Long MAX_BUFFER_SIZE = 1048576; +#define com_rti_media_generated_VideoStream_LAST_MEMBER_ID 3 + +extern const char *VideoStreamTYPENAME; + + + +#ifdef __cplusplus + struct VideoStreamSeq; + +#ifndef NDDS_STANDALONE_TYPE + class VideoStreamTypeSupport; + class VideoStreamDataWriter; + class VideoStreamDataReader; +#endif + +#endif + + + +class VideoStream +{ +public: +#ifdef __cplusplus + typedef struct VideoStreamSeq Seq; + +#ifndef NDDS_STANDALONE_TYPE + typedef VideoStreamTypeSupport TypeSupport; + typedef VideoStreamDataWriter DataWriter; + typedef VideoStreamDataReader DataReader; +#endif + +#endif + + DDS_Long stream_id; + + DDS_UnsignedLong flags; + + DDS_UnsignedLong sequence_number; + + DDS_OctetSeq frame; + + +}; + + +#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* VideoStream_get_typecode(void); /* Type code */ + + +DDS_SEQUENCE(VideoStreamSeq, VideoStream); + +NDDSUSERDllExport +RTIBool VideoStream_initialize( + VideoStream* self); + +NDDSUSERDllExport +RTIBool VideoStream_initialize_ex( + VideoStream* self, + RTIBool allocatePointers,RTIBool allocateMemory); + +NDDSUSERDllExport +RTIBool VideoStream_initialize_w_params( + VideoStream* self, + const struct DDS_TypeAllocationParams_t * allocParams); + +NDDSUSERDllExport +void VideoStream_finalize( + VideoStream* self); + +NDDSUSERDllExport +void VideoStream_finalize_ex( + VideoStream* self,RTIBool deletePointers); + +NDDSUSERDllExport +void VideoStream_finalize_w_params( + VideoStream* self, + const struct DDS_TypeDeallocationParams_t * deallocParams); + +NDDSUSERDllExport +void VideoStream_finalize_optional_members( + VideoStream* self, RTIBool deletePointers); + +NDDSUSERDllExport +RTIBool VideoStream_copy( + VideoStream* dst, + const VideoStream* 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 media */ + +} /* namespace rti */ + +} /* namespace com */ + + +#endif /* VideoData_1974959798_h */ diff --git a/VideoData/ExampleCode/src/Generated/VideoDataPlugin.cxx b/VideoData/ExampleCode/src/Generated/VideoDataPlugin.cxx new file mode 100644 index 00000000..a76069a0 --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoDataPlugin.cxx @@ -0,0 +1,1398 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 "VideoDataPlugin.h" + + +namespace com{ + +namespace rti{ + +namespace media{ + +namespace generated{ + +/* -------------------------------------------------------------------------------------- + * Type VideoStream + * -------------------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +VideoStream* +VideoStreamPluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params){ + VideoStream *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, VideoStream); + + if(sample != NULL) { + if (!::com::rti::media::generated::VideoStream_initialize_w_params(sample,alloc_params)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +VideoStream * +VideoStreamPluginSupport_create_data_ex(RTIBool allocate_pointers){ + VideoStream *sample = NULL; + + RTIOsapiHeap_allocateStructure( + &sample, VideoStream); + + if(sample != NULL) { + if (!::com::rti::media::generated::VideoStream_initialize_ex(sample,allocate_pointers, RTI_TRUE)) { + RTIOsapiHeap_freeStructure(sample); + return NULL; + } + } + return sample; +} + + +VideoStream * +VideoStreamPluginSupport_create_data(void) +{ + return ::com::rti::media::generated::VideoStreamPluginSupport_create_data_ex(RTI_TRUE); +} + + +void +VideoStreamPluginSupport_destroy_data_w_params( + VideoStream *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params) { + + ::com::rti::media::generated::VideoStream_finalize_w_params(sample,dealloc_params); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +VideoStreamPluginSupport_destroy_data_ex( + VideoStream *sample,RTIBool deallocate_pointers) { + + ::com::rti::media::generated::VideoStream_finalize_ex(sample,deallocate_pointers); + + RTIOsapiHeap_freeStructure(sample); +} + + +void +VideoStreamPluginSupport_destroy_data( + VideoStream *sample) { + + ::com::rti::media::generated::VideoStreamPluginSupport_destroy_data_ex(sample,RTI_TRUE); + +} + + +RTIBool +VideoStreamPluginSupport_copy_data( + VideoStream *dst, + const VideoStream *src) +{ + return ::com::rti::media::generated::VideoStream_copy(dst,src); +} + + +void +VideoStreamPluginSupport_print_data( + const VideoStream *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->stream_id, "stream_id", indent_level + 1); + + + RTICdrType_printUnsignedLong( + &sample->flags, "flags", indent_level + 1); + + + RTICdrType_printUnsignedLong( + &sample->sequence_number, "sequence_number", indent_level + 1); + + + if (&sample->frame == NULL) { + RTICdrType_printIndent(indent_level+1); + RTILog_debug("frame: NULL\n"); + } else { + + if (DDS_OctetSeq_get_contiguous_bufferI(&sample->frame) != NULL) { + RTICdrType_printArray( + DDS_OctetSeq_get_contiguous_bufferI(&sample->frame), + DDS_OctetSeq_get_length(&sample->frame), + RTI_CDR_OCTET_SIZE, + (RTICdrTypePrintFunction)RTICdrType_printOctet, + "frame", indent_level + 1); + } else { + RTICdrType_printPointerArray( + DDS_OctetSeq_get_discontiguous_bufferI(&sample->frame), + DDS_OctetSeq_get_length(&sample->frame), + (RTICdrTypePrintFunction)RTICdrType_printOctet, + "frame", indent_level + 1); + } + + } + + + +} + +VideoStream * +VideoStreamPluginSupport_create_key_ex(RTIBool allocate_pointers){ + VideoStream *key = NULL; + + RTIOsapiHeap_allocateStructure( + &key, VideoStreamKeyHolder); + + ::com::rti::media::generated::VideoStream_initialize_ex(key,allocate_pointers,RTI_TRUE); + return key; +} + + +VideoStream * +VideoStreamPluginSupport_create_key(void) +{ + return ::com::rti::media::generated::VideoStreamPluginSupport_create_key_ex(RTI_TRUE); +} + + +void +VideoStreamPluginSupport_destroy_key_ex( + VideoStreamKeyHolder *key,RTIBool deallocate_pointers) +{ + ::com::rti::media::generated::VideoStream_finalize_ex(key,deallocate_pointers); + + RTIOsapiHeap_freeStructure(key); +} + + +void +VideoStreamPluginSupport_destroy_key( + VideoStreamKeyHolder *key) { + + ::com::rti::media::generated::VideoStreamPluginSupport_destroy_key_ex(key,RTI_TRUE); + +} + + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + + + +PRESTypePluginParticipantData +VideoStreamPlugin_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 +VideoStreamPlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data) +{ + + PRESTypePluginDefaultParticipantData_delete(participant_data); +} + + +PRESTypePluginEndpointData +VideoStreamPlugin_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::media::generated::VideoStreamPluginSupport_create_data, + (PRESTypePluginDefaultEndpointDataDestroySampleFunction) + ::com::rti::media::generated::VideoStreamPluginSupport_destroy_data, + (PRESTypePluginDefaultEndpointDataCreateKeyFunction) + ::com::rti::media::generated::VideoStreamPluginSupport_create_key, + (PRESTypePluginDefaultEndpointDataDestroyKeyFunction) + ::com::rti::media::generated::VideoStreamPluginSupport_destroy_key); + + if (epd == NULL) { + return NULL; + } + + serializedKeyMaxSize = ::com::rti::media::generated::VideoStreamPlugin_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::media::generated::VideoStreamPlugin_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::media::generated::VideoStreamPlugin_get_serialized_sample_max_size, epd, + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_serialized_sample_size, + epd) == RTI_FALSE) { + PRESTypePluginDefaultEndpointData_delete(epd); + return NULL; + } + } + + + + return epd; +} + + +void +VideoStreamPlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data) +{ + + PRESTypePluginDefaultEndpointData_delete(endpoint_data); +} + + +void +VideoStreamPlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *sample, + void *handle) +{ + + VideoStream_finalize_optional_members(sample, RTI_TRUE); + + PRESTypePluginDefaultEndpointData_returnSample( + endpoint_data, sample, handle); +} + + + +RTIBool +VideoStreamPlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *dst, + const VideoStream *src) +{ + if (endpoint_data) {} /* To avoid warnings */ + return ::com::rti::media::generated::VideoStreamPluginSupport_copy_data(dst,src); +} + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +unsigned int +VideoStreamPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + + +RTIBool +VideoStreamPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const VideoStream *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->stream_id)) { + return RTI_FALSE; + } + + + if (!RTICdrStream_serializeUnsignedLong( + stream, &sample->flags)) { + return RTI_FALSE; + } + + + if (!RTICdrStream_serializeUnsignedLong( + stream, &sample->sequence_number)) { + return RTI_FALSE; + } + + + if (DDS_OctetSeq_get_contiguous_bufferI(&sample->frame) != NULL) { + if (!RTICdrStream_serializePrimitiveSequence( + stream, + DDS_OctetSeq_get_contiguous_bufferI(&sample->frame), + DDS_OctetSeq_get_length(&sample->frame), + ((com::rti::media::generated::MAX_BUFFER_SIZE)), + RTI_CDR_OCTET_TYPE)) { + return RTI_FALSE; + } + } else { + if (!RTICdrStream_serializePrimitivePointerSequence( + stream, + (const void **)DDS_OctetSeq_get_discontiguous_bufferI(&sample->frame), + DDS_OctetSeq_get_length(&sample->frame), + ((com::rti::media::generated::MAX_BUFFER_SIZE)), + RTI_CDR_OCTET_TYPE)) { + return RTI_FALSE; + } + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return retval; +} + + +RTIBool +VideoStreamPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *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::media::generated::VideoStream_initialize_ex(sample, RTI_FALSE, RTI_FALSE); + + if (!RTICdrStream_deserializeLong( + stream, &sample->stream_id)) { + goto fin; + } + + if (!RTICdrStream_deserializeUnsignedLong( + stream, &sample->flags)) { + goto fin; + } + + if (!RTICdrStream_deserializeUnsignedLong( + stream, &sample->sequence_number)) { + goto fin; + } + + { + RTICdrUnsignedLong sequence_length; + + if (DDS_OctetSeq_get_contiguous_bufferI(&sample->frame) != NULL) { + if (!RTICdrStream_deserializePrimitiveSequence( + stream, + DDS_OctetSeq_get_contiguous_bufferI(&sample->frame), + &sequence_length, + DDS_OctetSeq_get_maximum(&sample->frame), + RTI_CDR_OCTET_TYPE)) { + goto fin; + } + } else { + if (!RTICdrStream_deserializePrimitivePointerSequence( + stream, + (void **)DDS_OctetSeq_get_discontiguous_bufferI(&sample->frame), + &sequence_length, + DDS_OctetSeq_get_maximum(&sample->frame), + RTI_CDR_OCTET_TYPE)) { + goto fin; + } + } + if (!DDS_OctetSeq_set_length(&sample->frame, 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 +VideoStreamPlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + VideoStream **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::media::generated::VideoStreamPlugin_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 VideoStreamPlugin_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 (!RTICdrStream_skipUnsignedLong(stream)) { + goto fin; + } + + + if (!RTICdrStream_skipUnsignedLong(stream)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipPrimitiveSequence( + stream, + &sequence_length, + RTI_CDR_OCTET_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 +VideoStreamPlugin_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 += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getPrimitiveSequenceMaxSizeSerialized( + current_alignment, ((com::rti::media::generated::MAX_BUFFER_SIZE)), RTI_CDR_OCTET_TYPE); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +unsigned int +VideoStreamPlugin_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 += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getPrimitiveSequenceMaxSizeSerialized( + current_alignment, 0, RTI_CDR_OCTET_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 +VideoStreamPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const VideoStream * 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 += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getUnsignedLongMaxSizeSerialized( + current_alignment); + + + current_alignment += RTICdrType_getPrimitiveSequenceSerializedSize( + current_alignment, + DDS_OctetSeq_get_length(&sample->frame), + RTI_CDR_OCTET_TYPE); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + + + + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + + +PRESTypePluginKeyKind +VideoStreamPlugin_get_key_kind(void) +{ + + return PRES_TYPEPLUGIN_USER_KEY; + +} + + +RTIBool +VideoStreamPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const VideoStream *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->stream_id)) { + return RTI_FALSE; + } + + + } + + + if(serialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + +RTIBool VideoStreamPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *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->stream_id)) { + return RTI_FALSE; + } + + } + + + if(deserialize_encapsulation) { + RTICdrStream_restoreAlignment(stream,position); + } + + + return RTI_TRUE; +} + + + +RTIBool VideoStreamPlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + VideoStream **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::media::generated::VideoStreamPlugin_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 +VideoStreamPlugin_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); + + + if (include_encapsulation) { + current_alignment += encapsulation_size; + } + + return current_alignment - initial_alignment; +} + + +RTIBool +VideoStreamPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + VideoStream *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->stream_id)) { + return RTI_FALSE; + } + + if (!RTICdrStream_skipUnsignedLong(stream)) { + goto fin; + } + + + if (!RTICdrStream_skipUnsignedLong(stream)) { + goto fin; + } + + + { + RTICdrUnsignedLong sequence_length; + + if (!RTICdrStream_skipPrimitiveSequence( + stream, + &sequence_length, + RTI_CDR_OCTET_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 +VideoStreamPlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + VideoStreamKeyHolder *dst, + const VideoStream *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyLong( + &dst->stream_id, &src->stream_id)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +VideoStreamPlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + VideoStream *dst, const + VideoStreamKeyHolder *src) +{ + + if (endpoint_data) {} /* To avoid warnings */ + + if (!RTICdrType_copyLong( + &dst->stream_id, &src->stream_id)) { + return RTI_FALSE; + } + + + return RTI_TRUE; +} + + +RTIBool +VideoStreamPlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const VideoStream *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::media::generated::VideoStreamPlugin_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 +VideoStreamPlugin_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; + VideoStream * 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 = (VideoStream *) + PRESTypePluginDefaultEndpointData_getTempSample(endpoint_data); + + if (sample == NULL) { + return RTI_FALSE; + } + + + if (!RTICdrStream_deserializeLong( + stream, &sample->stream_id)) { + 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::media::generated::VideoStreamPlugin_instance_to_keyhash( + endpoint_data, keyhash, sample)) { + return RTI_FALSE; + } + + return RTI_TRUE; +} + + +/* ------------------------------------------------------------------------ + * Plug-in Installation Methods + * ------------------------------------------------------------------------ */ + +struct PRESTypePlugin *VideoStreamPlugin_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::media::generated::VideoStreamPlugin_on_participant_attached; + plugin->onParticipantDetached = + (PRESTypePluginOnParticipantDetachedCallback) + ::com::rti::media::generated::VideoStreamPlugin_on_participant_detached; + plugin->onEndpointAttached = + (PRESTypePluginOnEndpointAttachedCallback) + ::com::rti::media::generated::VideoStreamPlugin_on_endpoint_attached; + plugin->onEndpointDetached = + (PRESTypePluginOnEndpointDetachedCallback) + ::com::rti::media::generated::VideoStreamPlugin_on_endpoint_detached; + + plugin->copySampleFnc = + (PRESTypePluginCopySampleFunction) + ::com::rti::media::generated::VideoStreamPlugin_copy_sample; + plugin->createSampleFnc = + (PRESTypePluginCreateSampleFunction) + VideoStreamPlugin_create_sample; + plugin->destroySampleFnc = + (PRESTypePluginDestroySampleFunction) + VideoStreamPlugin_destroy_sample; + + plugin->serializeFnc = + (PRESTypePluginSerializeFunction) + ::com::rti::media::generated::VideoStreamPlugin_serialize; + plugin->deserializeFnc = + (PRESTypePluginDeserializeFunction) + ::com::rti::media::generated::VideoStreamPlugin_deserialize; + plugin->getSerializedSampleMaxSizeFnc = + (PRESTypePluginGetSerializedSampleMaxSizeFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_serialized_sample_max_size; + plugin->getSerializedSampleMinSizeFnc = + (PRESTypePluginGetSerializedSampleMinSizeFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_serialized_sample_min_size; + + + plugin->getSampleFnc = + (PRESTypePluginGetSampleFunction) + VideoStreamPlugin_get_sample; + plugin->returnSampleFnc = + (PRESTypePluginReturnSampleFunction) + VideoStreamPlugin_return_sample; + + plugin->getKeyKindFnc = + (PRESTypePluginGetKeyKindFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_key_kind; + + + plugin->getSerializedKeyMaxSizeFnc = + (PRESTypePluginGetSerializedKeyMaxSizeFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_serialized_key_max_size; + plugin->serializeKeyFnc = + (PRESTypePluginSerializeKeyFunction) + ::com::rti::media::generated::VideoStreamPlugin_serialize_key; + plugin->deserializeKeyFnc = + (PRESTypePluginDeserializeKeyFunction) + ::com::rti::media::generated::VideoStreamPlugin_deserialize_key; + plugin->deserializeKeySampleFnc = + (PRESTypePluginDeserializeKeySampleFunction) + ::com::rti::media::generated::VideoStreamPlugin_deserialize_key_sample; + + plugin->instanceToKeyHashFnc = + (PRESTypePluginInstanceToKeyHashFunction) + ::com::rti::media::generated::VideoStreamPlugin_instance_to_keyhash; + plugin->serializedSampleToKeyHashFnc = + (PRESTypePluginSerializedSampleToKeyHashFunction) + ::com::rti::media::generated::VideoStreamPlugin_serialized_sample_to_keyhash; + + plugin->getKeyFnc = + (PRESTypePluginGetKeyFunction) + VideoStreamPlugin_get_key; + plugin->returnKeyFnc = + (PRESTypePluginReturnKeyFunction) + VideoStreamPlugin_return_key; + + plugin->instanceToKeyFnc = + (PRESTypePluginInstanceToKeyFunction) + ::com::rti::media::generated::VideoStreamPlugin_instance_to_key; + plugin->keyToInstanceFnc = + (PRESTypePluginKeyToInstanceFunction) + ::com::rti::media::generated::VideoStreamPlugin_key_to_instance; + plugin->serializedKeyToKeyHashFnc = NULL; /* Not supported yet */ + + plugin->typeCode = (struct RTICdrTypeCode *)::com::rti::media::generated::VideoStream_get_typecode(); + + plugin->languageKind = PRES_TYPEPLUGIN_DDS_TYPE; + + /* Serialized buffer */ + plugin->getBuffer = + (PRESTypePluginGetBufferFunction) + VideoStreamPlugin_get_buffer; + plugin->returnBuffer = + (PRESTypePluginReturnBufferFunction) + VideoStreamPlugin_return_buffer; + plugin->getSerializedSampleSizeFnc = + (PRESTypePluginGetSerializedSampleSizeFunction) + ::com::rti::media::generated::VideoStreamPlugin_get_serialized_sample_size; + + plugin->endpointTypeName = VideoStreamTYPENAME; + + return plugin; +} + +void +VideoStreamPlugin_delete(struct PRESTypePlugin *plugin) +{ + RTIOsapiHeap_freeStructure(plugin); +} + +} /* namespace generated */ + +} /* namespace media */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/VideoData/ExampleCode/src/Generated/VideoDataPlugin.h b/VideoData/ExampleCode/src/Generated/VideoDataPlugin.h new file mode 100644 index 00000000..41592129 --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoDataPlugin.h @@ -0,0 +1,335 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 VideoDataPlugin_1974959798_h +#define VideoDataPlugin_1974959798_h + +#include "VideoData.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 media{ + +namespace generated{ + +/* The type used to store keys for instances of type struct + * VideoStream. + * + * By default, this type is struct VideoStream + * itself. However, if for some reason this choice is not practical for your + * system (e.g. if sizeof(struct VideoStream) + * 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 VideoStream, the + * following restriction applies: the key of struct + * VideoStream must consist of a + * single field of your redefined KeyHolder type and that field must be the + * first field in struct VideoStream. +*/ +typedef class VideoStream VideoStreamKeyHolder; + + +#define VideoStreamPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample +#define VideoStreamPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer +#define VideoStreamPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer + +#define VideoStreamPlugin_get_key PRESTypePluginDefaultEndpointData_getKey +#define VideoStreamPlugin_return_key PRESTypePluginDefaultEndpointData_returnKey + + +#define VideoStreamPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample +#define VideoStreamPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample + +/* -------------------------------------------------------------------------------------- + Support functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern VideoStream* +VideoStreamPluginSupport_create_data_w_params( + const struct DDS_TypeAllocationParams_t * alloc_params); + +NDDSUSERDllExport extern VideoStream* +VideoStreamPluginSupport_create_data_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern VideoStream* +VideoStreamPluginSupport_create_data(void); + +NDDSUSERDllExport extern RTIBool +VideoStreamPluginSupport_copy_data( + VideoStream *out, + const VideoStream *in); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_destroy_data_w_params( + VideoStream *sample, + const struct DDS_TypeDeallocationParams_t * dealloc_params); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_destroy_data_ex( + VideoStream *sample,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_destroy_data( + VideoStream *sample); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_print_data( + const VideoStream *sample, + const char *desc, + unsigned int indent); + + +NDDSUSERDllExport extern VideoStream* +VideoStreamPluginSupport_create_key_ex(RTIBool allocate_pointers); + +NDDSUSERDllExport extern VideoStream* +VideoStreamPluginSupport_create_key(void); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_destroy_key_ex( + VideoStreamKeyHolder *key,RTIBool deallocate_pointers); + +NDDSUSERDllExport extern void +VideoStreamPluginSupport_destroy_key( + VideoStreamKeyHolder *key); + +/* ---------------------------------------------------------------------------- + Callback functions: + * ---------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginParticipantData +VideoStreamPlugin_on_participant_attached( + void *registration_data, + const struct PRESTypePluginParticipantInfo *participant_info, + RTIBool top_level_registration, + void *container_plugin_context, + RTICdrTypeCode *typeCode); + +NDDSUSERDllExport extern void +VideoStreamPlugin_on_participant_detached( + PRESTypePluginParticipantData participant_data); + +NDDSUSERDllExport extern PRESTypePluginEndpointData +VideoStreamPlugin_on_endpoint_attached( + PRESTypePluginParticipantData participant_data, + const struct PRESTypePluginEndpointInfo *endpoint_info, + RTIBool top_level_registration, + void *container_plugin_context); + +NDDSUSERDllExport extern void +VideoStreamPlugin_on_endpoint_detached( + PRESTypePluginEndpointData endpoint_data); + +NDDSUSERDllExport extern void +VideoStreamPlugin_return_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *sample, + void *handle); + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_copy_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *out, + const VideoStream *in); + +/* -------------------------------------------------------------------------------------- + (De)Serialize functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_serialize( + PRESTypePluginEndpointData endpoint_data, + const VideoStream *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_deserialize_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_deserialize( + PRESTypePluginEndpointData endpoint_data, + VideoStream **sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_sample, + void *endpoint_plugin_qos); + + + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_skip( + PRESTypePluginEndpointData endpoint_data, + struct RTICdrStream *stream, + RTIBool skip_encapsulation, + RTIBool skip_sample, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern unsigned int +VideoStreamPlugin_get_serialized_sample_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +VideoStreamPlugin_get_serialized_sample_min_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern unsigned int +VideoStreamPlugin_get_serialized_sample_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment, + const VideoStream * sample); + + + +/* -------------------------------------------------------------------------------------- + Key Management functions: + * -------------------------------------------------------------------------------------- */ + +NDDSUSERDllExport extern PRESTypePluginKeyKind +VideoStreamPlugin_get_key_kind(void); + +NDDSUSERDllExport extern unsigned int +VideoStreamPlugin_get_serialized_key_max_size( + PRESTypePluginEndpointData endpoint_data, + RTIBool include_encapsulation, + RTIEncapsulationId encapsulation_id, + unsigned int current_alignment); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_serialize_key( + PRESTypePluginEndpointData endpoint_data, + const VideoStream *sample, + struct RTICdrStream *stream, + RTIBool serialize_encapsulation, + RTIEncapsulationId encapsulation_id, + RTIBool serialize_key, + void *endpoint_plugin_qos); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_deserialize_key_sample( + PRESTypePluginEndpointData endpoint_data, + VideoStream * sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_deserialize_key( + PRESTypePluginEndpointData endpoint_data, + VideoStream ** sample, + RTIBool * drop_sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_serialized_sample_to_key( + PRESTypePluginEndpointData endpoint_data, + VideoStream *sample, + struct RTICdrStream *stream, + RTIBool deserialize_encapsulation, + RTIBool deserialize_key, + void *endpoint_plugin_qos); + + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_instance_to_key( + PRESTypePluginEndpointData endpoint_data, + VideoStreamKeyHolder *key, + const VideoStream *instance); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_key_to_instance( + PRESTypePluginEndpointData endpoint_data, + VideoStream *instance, + const VideoStreamKeyHolder *key); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_instance_to_keyhash( + PRESTypePluginEndpointData endpoint_data, + DDS_KeyHash_t *keyhash, + const VideoStream *instance); + +NDDSUSERDllExport extern RTIBool +VideoStreamPlugin_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* +VideoStreamPlugin_new(void); + +NDDSUSERDllExport extern void +VideoStreamPlugin_delete(struct PRESTypePlugin *); + +} /* namespace generated */ + +} /* namespace media */ + +} /* 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 /* VideoDataPlugin_1974959798_h */ diff --git a/VideoData/ExampleCode/src/Generated/VideoDataSupport.cxx b/VideoData/ExampleCode/src/Generated/VideoDataSupport.cxx new file mode 100644 index 00000000..7c51ebc8 --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoDataSupport.cxx @@ -0,0 +1,158 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 "VideoDataSupport.h" +#include "VideoDataPlugin.h" + + + +#ifdef __cplusplus + #ifndef dds_c_log_impl_h + #include "dds_c/dds_c_log_impl.h" + #endif +#endif + + +namespace com{ + +namespace rti{ + +namespace media{ + +namespace generated{ + + + +/* ========================================================================= */ +/** + <> + + Defines: TData, + TDataWriter, + TDataReader, + TTypeSupport + + Configure and implement 'VideoStream' support classes. + + Note: Only the #defined classes get defined +*/ + +/* ----------------------------------------------------------------- */ +/* DDSDataWriter +*/ + +/** + <> + + Defines: TDataWriter, TData +*/ + +/* Requires */ +#define TTYPENAME VideoStreamTYPENAME + +/* Defines */ +#define TDataWriter VideoStreamDataWriter +#define TData ::com::rti::media::generated::VideoStream + + +#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 VideoStreamTYPENAME + +/* Defines */ +#define TDataReader VideoStreamDataReader +#define TDataSeq VideoStreamSeq +#define TData ::com::rti::media::generated::VideoStream + + +#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 VideoStreamTYPENAME +#define TPlugin_new ::com::rti::media::generated::VideoStreamPlugin_new +#define TPlugin_delete ::com::rti::media::generated::VideoStreamPlugin_delete + +/* Defines */ +#define TTypeSupport VideoStreamTypeSupport +#define TData ::com::rti::media::generated::VideoStream +#define TDataReader VideoStreamDataReader +#define TDataWriter VideoStreamDataWriter +#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 media */ + +} /* namespace rti */ + +} /* namespace com */ diff --git a/VideoData/ExampleCode/src/Generated/VideoDataSupport.h b/VideoData/ExampleCode/src/Generated/VideoDataSupport.h new file mode 100644 index 00000000..6711aad4 --- /dev/null +++ b/VideoData/ExampleCode/src/Generated/VideoDataSupport.h @@ -0,0 +1,89 @@ + +/* + WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. + + This file was generated from VideoData.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 VideoDataSupport_1974959798_h +#define VideoDataSupport_1974959798_h + +/* Uses */ +#include "VideoData.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 media{ + +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(VideoStreamTypeSupport, VideoStream); + +DDS_DATAWRITER_CPP(VideoStreamDataWriter, VideoStream); +DDS_DATAREADER_CPP(VideoStreamDataReader, VideoStreamSeq, VideoStream); + + +#else + +DDS_TYPESUPPORT_C(VideoStreamTypeSupport, VideoStream); +DDS_DATAWRITER_C(VideoStreamDataWriter, VideoStream); +DDS_DATAREADER_C(VideoStreamDataReader, VideoStreamSeq, VideoStream); + +#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 media */ + +} /* namespace rti */ + +} /* namespace com */ + + +#endif /* VideoDataSupport_1974959798_h */ diff --git a/VideoData/ExampleCode/src/VideoPublisher/CMakeLists.txt b/VideoData/ExampleCode/src/VideoPublisher/CMakeLists.txt new file mode 100644 index 00000000..58acfe09 --- /dev/null +++ b/VideoData/ExampleCode/src/VideoPublisher/CMakeLists.txt @@ -0,0 +1,76 @@ +######################## +# VideoPublisher +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${GSTREAMER_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/VideoPublisher + ${CMAKE_SOURCE_DIR}/CommonInfrastructure +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} + ${GSTREAMER_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE VideoPublisher_sources + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSCommunicator.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSCommunicator.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/DDSTypeWrapper.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/OSAPI.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/OSAPI.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/SimCList.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/simclist.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/VideoBuffer.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/VideoBuffer.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/VideoEvent.h + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/VideoSource.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/VideoSource.h + ${CMAKE_SOURCE_DIR}/VideoPublisher/*.h + ${CMAKE_SOURCE_DIR}/VideoPublisher/*.cxx + ) + +add_executable(VideoPublisher + ${VideoPublisher_sources} +) + +add_dependencies(VideoPublisher SharedDataTypes) + +if(ARCHITECTURE MATCHES "Win32") + target_link_libraries(VideoPublisher + SharedDataTypes.lib + ${GSTREAMER_LIBRARIES} + ${CONNEXTDDS_LIBRARIES} + ) + SET_TARGET_PROPERTIES( VideoPublisher + PROPERTIES LINK_FLAGS "/LIBPATH:${GSTREAMER_LIB_PATH};${StreamingVideo_BIN_DIR}") +elseif (ARCHITECTURE MATCHES "Linux") + target_link_libraries(VideoPublisher + ${GSTREAMER_LIBRARIES} + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +elseif (ARCHITECTURE MATCHES "Darwin") + target_link_libraries(VideoPublisher + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +endif() + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(VideoPublisher PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ) +endforeach() diff --git a/VideoData/ExampleCode/src/VideoPublisher/VideoPublisher.cxx b/VideoData/ExampleCode/src/VideoPublisher/VideoPublisher.cxx index 8c76c785..4605374d 100644 --- a/VideoData/ExampleCode/src/VideoPublisher/VideoPublisher.cxx +++ b/VideoData/ExampleCode/src/VideoPublisher/VideoPublisher.cxx @@ -22,6 +22,7 @@ #ifdef WIN32 #include +#include #include "Shlwapi.h" #endif diff --git a/VideoData/ExampleCode/src/VideoSubscriber/CMakeLists.txt b/VideoData/ExampleCode/src/VideoSubscriber/CMakeLists.txt new file mode 100644 index 00000000..96308697 --- /dev/null +++ b/VideoData/ExampleCode/src/VideoSubscriber/CMakeLists.txt @@ -0,0 +1,66 @@ +######################## +# VideoSubscriber +######################## + +include_directories( + ${CONNEXTDDS_INCLUDE_DIRS} + ${GSTREAMER_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/VideoSubscriber + ${CMAKE_SOURCE_DIR}/CommonInfrastructure +) + +add_definitions( + ${CONNEXTDDS_DEFINITIONS} + ${GSTREAMER_DEFINITIONS} +) + +# Executable +########### +# Include directories for the Executable build + +# Files to include in the Executable build +file(GLOB_RECURSE VideoSubscriber_sources + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.cxx + ${CMAKE_SOURCE_DIR}/CommonInfrastructure/*.h + ${CMAKE_SOURCE_DIR}/VideoSubscriber/*.h + ${CMAKE_SOURCE_DIR}/VideoSubscriber/*.cxx + ) + +add_executable(VideoSubscriber + ${VideoSubscriber_sources} +) + +add_dependencies(VideoSubscriber SharedDataTypes) + +if(ARCHITECTURE MATCHES "Win32") + target_link_libraries(VideoSubscriber + SharedDataTypes.lib + ${GSTREAMER_LIBRARIES} + ${CONNEXTDDS_LIBRARIES} + ) + SET_TARGET_PROPERTIES( VideoSubscriber + PROPERTIES LINK_FLAGS "/LIBPATH:${GSTREAMER_LIB_PATH};${StreamingVideo_BIN_DIR}") +elseif (ARCHITECTURE MATCHES "Linux") + target_link_libraries(VideoSubscriber + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ${GSTREAMER_LIBRARIES} + ) +elseif (ARCHITECTURE MATCHES "Darwin") + target_link_libraries(VideoSubscriber + ${CONNEXTDDS_LIBRARIES} + SharedDataTypes + ) +endif() + +foreach (output_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${output_config} output_config) + set_target_properties(VideoSubscriber PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + LIBRARY_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ARCHIVE_OUTPUT_DIRECTORY_${output_config} + ${StreamingVideo_BIN_DIR} + ) +endforeach() diff --git a/VideoData/ExampleCode/src/cmake/FindConnextDDS.cmake b/VideoData/ExampleCode/src/cmake/FindConnextDDS.cmake new file mode 100644 index 00000000..54c85a66 --- /dev/null +++ b/VideoData/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/VideoData.idl -namespace -replace -language C++ -d ${CMAKE_SOURCE_DIR}/Generated + ) +elseif(ARCHITECTURE MATCHES "Win32") + set(CONNEXTDDS_DEFINITIONS "-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/VideoData.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/VideoData.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/VideoData/ExampleCode/src/cmake/FindGStreamer.cmake b/VideoData/ExampleCode/src/cmake/FindGStreamer.cmake new file mode 100644 index 00000000..5031e6a5 --- /dev/null +++ b/VideoData/ExampleCode/src/cmake/FindGStreamer.cmake @@ -0,0 +1,91 @@ +##################################### +# FindGStreamer.cmake +##################################### + +if(ARCHITECTURE MATCHES "Win32") + # We set the common path to the gstreamer + set(GSTREAMER_LIB_PATH ${CMAKE_SOURCE_DIR}/../thirdparty/gstreamer-sdk/win32/0.10/x86/lib) + set(GLIB_INCLUDE ${CMAKE_SOURCE_DIR}/../thirdparty/gstreamer-sdk/win32/0.10/x86/include/glib-2.0) + set(GSTREAMER_INCLUDE ${CMAKE_SOURCE_DIR}/../thirdparty/gstreamer-sdk/win32/0.10/x86/include/gstreamer-0.10) + set(XML_LIB_PATH ${CMAKE_SOURCE_DIR}/../thirdparty/gstreamer-sdk/win32/0.10/x86/include/libxml2) + + set(GSTREAMER_DEFINITIONS "/DSIMCLIST_NO_DUMPRESTORE") + set(gobject_libname gobject-2.0.lib) + set(gstreamer_libname gstreamer-0.10.lib) + set(glib_libname glib-2.0.lib) + set(gstapp_libname gstapp-0.10.lib) + set(ADDITIONAL_LIBRARIES Shlwapi.lib Winmm.lib) +elseif(ARCHITECTURE MATCHES "Linux") + set(GSTREAMER_DEFINITIONS "-lglib-2.0 -lgstreamer-0.10 -lgstapp-0.10 -std=c++0x") + # We set the common path to the gstreamer + set(GSTREAMER_LIB_PATH /usr/lib/x86_64-linux-gnu) + set(GSTREAMER_CONFIG /usr/lib/x86_64-linux-gnu/glib-2.0/include) + set(GLIB_INCLUDE /usr/include/glib-2.0) + set(GSTREAMER_INCLUDE /usr/include/gstreamer-0.10) + set(XML_LIB_PATH /usr/include/libxml2) + + + # If you have installed the GStreamer compiling source code + set(GSTREAMER_LIB_PATH /usr/local/lib/x86_64-linux-gnu + ${GSTREAMER_LIB_PATH}) + set(GSTREAMER_CONFIG /usr/lib/x86_64-linux-gnu/glib-2.0/include + ${GSTREAMER_CONFIG}) + set(GLIB_INCLUDE /usr/local/include/glib-2.0 + ${GLIB_INCLUDE}) + set(GSTREAMER_INCLUDE /usr/local/include/gstreamer-0.10 + ${GSTREAMER_INCLUDE}) + set(XML_LIB_PATH /usr/local/include/libxml2 + ${XML_LIB_PATH}) + + # Now, we set the name of the libraries + set(gobject_libname gobject-2.0) + set(gstreamer_libname gstreamer-0.10) + set(glib_libname glib-2.0) + set(gstapp_libname gstapp-0.10) +endif() + +# Find gst/gst.h & glib.h header files +find_path(GSTREAMER_INCLUDE_DIRS + NAMES gst/gst.h + PATHS ${GSTREAMER_INCLUDE} + ) + +find_path(GSTREAMER_INCLUDE_DIRS + NAMES glib.h + PATHS ${GLIB_INCLUDE} + ) + +# We need to include the GStreamer directories +set(GSTREAMER_INCLUDE_DIRS + ${GLIB_INCLUDE} + ${GSTREAMER_INCLUDE} + ${GSTREAMER_CONFIG} + ${XML_LIB_PATH} + ) + +# Add gobject-2.0, gstreamer-0.10, glib-2.0 & gstapp-0.10 libraries +find_library(gobject_lib + NAMES ${gobject_libname} + PATHS ${GSTREAMER_LIB_PATH} + ) +find_library(gstreamer_lib + NAMES ${gstreamer_libname} + PATHS ${GSTREAMER_LIB_PATH} + ) +find_library(glib_lib + NAMES ${glib_libname} + PATHS ${GSTREAMER_LIB_PATH} + ) +find_library(gstapp_lib + NAMES ${gstapp_libname} + PATHS ${GSTREAMER_LIB_PATH} + ) + +set(GSTREAMER_LIBRARIES + ${gobject_lib} + ${gstreamer_lib} + ${glib_lib} + ${gstapp_lib} + ${ADDITIONAL_LIBRARIES} + ) + message("LIBRARIES: <${GSTREAMER_LIBRARIES}>") diff --git a/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj b/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj deleted file mode 100644 index 509a12e3..00000000 --- a/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - "$(NDDSHOME)\scripts\rtiddsgen" ..\src\Idl\VideoData.idl -replace -namespace -language C++ -d ..\src\Generated - 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) - "$(NDDSHOME)\scripts\rtiddsgen" ..\src\Idl\VideoData.idl -replace -namespace -language C++ -d ..\src\Generated - 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) - - - - - - - - - {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/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.filters b/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.filters deleted file mode 100644 index 2dc1f9f2..00000000 --- a/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.filters +++ /dev/null @@ -1,47 +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} - - - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - - - IDL - - - \ No newline at end of file diff --git a/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.user b/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.user deleted file mode 100644 index ace9a86a..00000000 --- a/VideoData/ExampleCode/win32/SharedDataTypes.vcxproj.user +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/VideoData/ExampleCode/win32/StreamingVideoExample-vs2010.sln b/VideoData/ExampleCode/win32/StreamingVideoExample-vs2010.sln deleted file mode 100644 index fa4ad98f..00000000 --- a/VideoData/ExampleCode/win32/StreamingVideoExample-vs2010.sln +++ /dev/null @@ -1,31 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoPublisher", "VideoPublisher.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}") = "VideoSubscriber", "VideoSubscriber.vcxproj", "{7FA8D028-BFFD-445F-B3F3-1442B50D03A0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {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 - {7FA8D028-BFFD-445F-B3F3-1442B50D03A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FA8D028-BFFD-445F-B3F3-1442B50D03A0}.Debug|Win32.Build.0 = Debug|Win32 - {7FA8D028-BFFD-445F-B3F3-1442B50D03A0}.Release|Win32.ActiveCfg = Release|Win32 - {7FA8D028-BFFD-445F-B3F3-1442B50D03A0}.Release|Win32.Build.0 = Release|Win32 - {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 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/VideoData/ExampleCode/win32/VideoPublisher.vcxproj b/VideoData/ExampleCode/win32/VideoPublisher.vcxproj deleted file mode 100644 index b5e21a21..00000000 --- a/VideoData/ExampleCode/win32/VideoPublisher.vcxproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {FA2857A7-83A2-426C-82A5-87F5A54EECFF} - Win32Proj - VideoPublisher - VideoPublisher - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - false - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - - NotUsing - Level3 - Disabled - SIMCLIST_NO_DUMPRESTORE;_WIN32;__STDC_CONSTANT_MACROS;HAVE_AVCODEC_OPEN2;HAVE_AVFORMAT_OPEN_INPUT;_CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\libxml2;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib\glib-2.0\include;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\glib-2.0;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\gstreamer-0.10 - - - - - MultiThreadedDebug - - - Console - true - nddscppzd.lib;nddsczd.lib;nddscorezd.lib;winmm.lib;shlwapi.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);gobject-2.0.lib;gstreamer-0.10.lib;glib-2.0.lib;gstapp-0.10.lib - $(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib;$(NDDSHOME)/lib/i86Win32VS2010 - - - - - Level3 - - - MaxSpeed - true - true - SIMCLIST_NO_DUMPRESTORE;_WIN32;__STDC_CONSTANT_MACROS;HAVE_AVCODEC_OPEN2;HAVE_AVFORMAT_OPEN_INPUT;_CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\libxml2;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib\glib-2.0\include;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\glib-2.0;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\gstreamer-0.10 - MultiThreaded - - - Console - false - true - true - $(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib;$(NDDSHOME)/lib/i86Win32VS2010 - nddscppz.lib;nddscz.lib;nddscorez.lib;shlwapi.lib;netapi32.lib;WS2_32.lib;advapi32.lib;shell32.lib;winmm.lib;%(AdditionalDependencies);gobject-2.0.lib;gstreamer-0.10.lib;glib-2.0.lib;gstapp-0.10.lib - /verbose:lib %(AdditionalOptions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e287142f-0d1e-49bf-b3bc-a218c1d1629f} - true - true - false - true - true - - - - - - \ No newline at end of file diff --git a/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.filters b/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.filters deleted file mode 100644 index 1d9baca4..00000000 --- a/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.filters +++ /dev/null @@ -1,80 +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 - - - Header Files - - - - - Source 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/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.user b/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.user deleted file mode 100644 index eaee2c83..00000000 --- a/VideoData/ExampleCode/win32/VideoPublisher.vcxproj.user +++ /dev/null @@ -1,16 +0,0 @@ - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - false - PATH=$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%PATH% - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - PATH=$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%PATH% - - \ No newline at end of file diff --git a/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj b/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj deleted file mode 100644 index 4b7dbaf9..00000000 --- a/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {7FA8D028-BFFD-445F-B3F3-1442B50D03A0} - Win32Proj - VideoSubscriber - VideoSubscriber - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - false - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - $(Configuration)\i86Win32VS2010\$(ProjectName)\ - - - - NotUsing - Level3 - Disabled - SIMCLIST_NO_DUMPRESTORE;_WIN32;__STDC_CONSTANT_MACROS;HAVE_AVCODEC_OPEN2;HAVE_AVFORMAT_OPEN_INPUT;_CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\libxml2;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib\glib-2.0\include;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\glib-2.0;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\gstreamer-0.10;%(AdditionalIncludeDirectories) - - - - - MultiThreadedDebug - - - Console - true - nddscppzd.lib;nddsczd.lib;nddscorezd.lib;winmm.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);gstreamer-0.10.lib;glib-2.0.lib;gstapp-0.10.lib;gobject-2.0.lib - $(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib;$(NDDSHOME)/lib/i86Win32VS2010 - - - - - Level3 - - - MaxSpeed - true - true - SIMCLIST_NO_DUMPRESTORE;_WIN32;__STDC_CONSTANT_MACROS;HAVE_AVCODEC_OPEN2;HAVE_AVFORMAT_OPEN_INPUT;_CRT_SECURE_NO_WARNINGS;RTI_WIN32;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(NDDSHOME)/include;$(NDDSHOME)/include/ndds;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\libxml2;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib\glib-2.0\include;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\glib-2.0;$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\include\gstreamer-0.10 - MultiThreaded - - - Console - false - true - true - $(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\lib;$(NDDSHOME)/lib/i86Win32VS2010 - nddscppz.lib;nddscz.lib;nddscorez.lib;netapi32.lib;WS2_32.lib;advapi32.lib;shell32.lib;winmm.lib;%(AdditionalDependencies);gstreamer-0.10.lib;gobject-2.0.lib;gstapp-0.10.lib - /verbose:lib %(AdditionalOptions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e287142f-0d1e-49bf-b3bc-a218c1d1629f} - true - true - false - true - true - - - - - - \ No newline at end of file diff --git a/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.filters b/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.filters deleted file mode 100644 index 931e902f..00000000 --- a/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.filters +++ /dev/null @@ -1,80 +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 - - - Header Files - - - - - Source 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/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.user b/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.user deleted file mode 100644 index 6fcdd582..00000000 --- a/VideoData/ExampleCode/win32/VideoSubscriber.vcxproj.user +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - - - PATH=$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%PATH% - - - $(SolutionDir)$(Configuration)\i86Win32VS2010\ - WindowsLocalDebugger - PATH=$(SolutionDir)..\thirdparty\gstreamer-sdk\win32\0.10\x86\bin;%PATH% - - \ No newline at end of file diff --git a/VideoData/README.txt b/VideoData/README.txt index b0e4550d..c0085517 100644 --- a/VideoData/README.txt +++ b/VideoData/README.txt @@ -41,32 +41,43 @@ 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 ---------------- +Build the example +----------------- +For building this example is needed to have installed CMake. You can download +from http://www.cmake.org/download/ . -On a Windows system, start by opening the file -win32\StreamingVideoExample-.sln. +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 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. +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. -Linux Systems -------------- +Besides, the script will compile the example: + - In Windows: run the msbuild compiler with the created solution. + - In Linux: run the created makefile. -To build the applications on a Linux system, change directories to the -ExampleCode directory and use the command: +Also, Build.pl script will create two custom running scripts. The running +scripts will be saved in the scripts directory following the template they have +in the same folder. -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 +The two custom script created are: one for the Publisher and the other one for +the subscriber. Both of them with the corresponding architecture you wrote +calling the Build.pl script. Run the Example --------------- +Remember that you have to run the scripts under EXAMPLE_HOME\ExampleCode +directory!!! On Windows systems, navigate to the EXAMPLE_HOME\ExampleCode\scripts directory. In this directory are two batch files to start the applications: From 0691318ad1e10d84c792fcda2502b6bff2d44d70 Mon Sep 17 00:00:00 2001 From: "@angelrti" Date: Tue, 16 Sep 2014 20:17:39 +0200 Subject: [PATCH 19/19] Added CMake project for ChocolateFactory Example --- .gitignore | 1 - .../ExampleCode/make/Makefile.common | 194 - .../make/Makefile.i86Linux2.6gcc4.4.5 | 32 - .../scripts/AllStationControllers.bat | 15 - .../scripts/AllStationControllers.sh | 25 - ChocolateFactory/ExampleCode/scripts/Build.pl | 116 + .../scripts/ChocolateFactory_linux.txt | 31 + .../scripts/ChocolateFactory_windows.txt | 20 + ChocolateFactory/ExampleCode/scripts/MES.bat | 11 - ChocolateFactory/ExampleCode/scripts/MES.sh | 21 - .../ExampleCode/scripts/RecipeGenerator.bat | 11 - .../ExampleCode/scripts/RecipeGenerator.sh | 21 - .../ExampleCode/scripts/StationController.bat | 11 - .../ExampleCode/scripts/StationController.sh | 22 - .../ExampleCode/src/CMakeLists.txt | 44 + .../CommonInfrastructure/DDSCommunicator.cxx | 2 +- .../ExampleCode/src/Generated/CMakeLists.txt | 49 + .../src/Generated/ChocolateFactory.cxx | 1420 ++++++ .../src/Generated/ChocolateFactory.h | 487 ++ .../src/Generated/ChocolateFactoryPlugin.cxx | 4316 +++++++++++++++++ .../src/Generated/ChocolateFactoryPlugin.h | 1002 ++++ .../src/Generated/ChocolateFactorySupport.cxx | 279 ++ .../src/Generated/ChocolateFactorySupport.h | 131 + .../CMakeLists.txt | 62 + ...ManufacturingExecutionSystem.vcxproj.user} | 0 .../src/RecipeGenerator/CMakeLists.txt | 67 + .../src/StationController/CMakeLists.txt | 63 + .../src/cmake/FindConnextDDS.cmake | 112 + .../win32/ChocolateFactory-vs2010.sln | 37 - .../ExampleCode/win32/MES.vcxproj | 122 - .../ExampleCode/win32/MES.vcxproj.filters | 71 - .../ExampleCode/win32/MES.vcxproj.user | 13 - .../ExampleCode/win32/RecipeGenerator.vcxproj | 153 - .../win32/RecipeGenerator.vcxproj.filters | 59 - .../win32/RecipeGenerator.vcxproj.user | 21 - .../ExampleCode/win32/SharedDataTypes.vcxproj | 115 - .../win32/SharedDataTypes.vcxproj.filters | 61 - .../win32/StationController.vcxproj | 129 - .../win32/StationController.vcxproj.filters | 74 - .../win32/StationController.vcxproj.user | 13 - ChocolateFactory/README.txt | 53 +- 41 files changed, 8233 insertions(+), 1253 deletions(-) delete mode 100644 ChocolateFactory/ExampleCode/make/Makefile.common delete mode 100644 ChocolateFactory/ExampleCode/make/Makefile.i86Linux2.6gcc4.4.5 delete mode 100755 ChocolateFactory/ExampleCode/scripts/AllStationControllers.bat delete mode 100755 ChocolateFactory/ExampleCode/scripts/AllStationControllers.sh create mode 100644 ChocolateFactory/ExampleCode/scripts/Build.pl create mode 100644 ChocolateFactory/ExampleCode/scripts/ChocolateFactory_linux.txt create mode 100644 ChocolateFactory/ExampleCode/scripts/ChocolateFactory_windows.txt delete mode 100755 ChocolateFactory/ExampleCode/scripts/MES.bat delete mode 100755 ChocolateFactory/ExampleCode/scripts/MES.sh delete mode 100755 ChocolateFactory/ExampleCode/scripts/RecipeGenerator.bat delete mode 100755 ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh delete mode 100755 ChocolateFactory/ExampleCode/scripts/StationController.bat delete mode 100755 ChocolateFactory/ExampleCode/scripts/StationController.sh create mode 100644 ChocolateFactory/ExampleCode/src/CMakeLists.txt create mode 100644 ChocolateFactory/ExampleCode/src/Generated/CMakeLists.txt create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.cxx create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactory.h create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.cxx create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactoryPlugin.h create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.cxx create mode 100644 ChocolateFactory/ExampleCode/src/Generated/ChocolateFactorySupport.h create mode 100644 ChocolateFactory/ExampleCode/src/ManufacturingExecutionSystem/CMakeLists.txt rename ChocolateFactory/ExampleCode/{win32/SharedDataTypes.vcxproj.user => src/ManufacturingExecutionSystem/ManufacturingExecutionSystem.vcxproj.user} (100%) create mode 100644 ChocolateFactory/ExampleCode/src/RecipeGenerator/CMakeLists.txt create mode 100644 ChocolateFactory/ExampleCode/src/StationController/CMakeLists.txt create mode 100644 ChocolateFactory/ExampleCode/src/cmake/FindConnextDDS.cmake delete mode 100644 ChocolateFactory/ExampleCode/win32/ChocolateFactory-vs2010.sln delete mode 100644 ChocolateFactory/ExampleCode/win32/MES.vcxproj delete mode 100644 ChocolateFactory/ExampleCode/win32/MES.vcxproj.filters delete mode 100644 ChocolateFactory/ExampleCode/win32/MES.vcxproj.user delete mode 100644 ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj delete mode 100644 ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.filters delete mode 100644 ChocolateFactory/ExampleCode/win32/RecipeGenerator.vcxproj.user delete mode 100644 ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj delete mode 100644 ChocolateFactory/ExampleCode/win32/SharedDataTypes.vcxproj.filters delete mode 100644 ChocolateFactory/ExampleCode/win32/StationController.vcxproj delete mode 100644 ChocolateFactory/ExampleCode/win32/StationController.vcxproj.filters delete mode 100644 ChocolateFactory/ExampleCode/win32/StationController.vcxproj.user 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/RecipeGenerator.sh b/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh deleted file mode 100755 index c0740c89..00000000 --- a/ChocolateFactory/ExampleCode/scripts/RecipeGenerator.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -filename=$0 -script_dir=`dirname $filename` -executable_name="RecipeGenerator" -bin_dir=${script_dir}/../objs/i86Linux2.6gcc4.4.5/RecipeGenerator - -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/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/DDSCommunicator.cxx b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx index f7f9ff2a..26853f43 100644 --- a/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx +++ b/ChocolateFactory/ExampleCode/src/CommonInfrastructure/DDSCommunicator.cxx @@ -10,7 +10,7 @@ ******************************************************************************/ #include "DDSCommunicator.h" -using namespace DDS; +using namespace DDS; // ------------------------------------------------------------------------- // // Destruction of a DDS communication interface. This first deletes all the 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/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/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/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/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 ---------------