From 8cb1c51bbdff454cacc88e0e1fa033d6695c7a51 Mon Sep 17 00:00:00 2001 From: Duncan Calvert Date: Tue, 20 Feb 2018 15:09:21 -0600 Subject: [PATCH] Move ihmc-pub-sub-generator into ihmc-pub-sub repo. Delete the submodule for now. We are going to switch to Gradle clone instead. --- .gitmodules | 3 - build.gradle | 134 ---- gradle.properties | 6 +- ihmc-pub-sub-generator/Readme.md | 78 ++ ihmc-pub-sub-generator/build.gradle | 62 ++ ihmc-pub-sub-generator/gradle.properties | 7 + ihmc-pub-sub-generator/settings.gradle | 19 + .../idl/generator/AbstractStructTypeCode.java | 87 ++ .../generator/AbstractTypeDeclaration.java | 35 + .../java/us/ihmc/idl/generator/Context.java | 746 ++++++++++++++++++ .../us/ihmc/idl/generator/IDLGenerator.java | 214 +++++ .../ihmc/idl/generator/IDLGeneratorTask.java | 101 +++ .../java/us/ihmc/idl/generator/MyContext.java | 121 +++ .../idl/generator/PreprocessorFilter.java | 45 ++ .../us/ihmc/idl/generator/StructTypeCode.java | 101 +++ .../us/ihmc/idl/generator/TypesGenerator.java | 449 +++++++++++ .../us/ihmc/idl/templates/Common.stg | 27 + .../us/ihmc/idl/templates/FastCdrCommon.stg | 316 ++++++++ .../us/ihmc/idl/templates/JavaPubSubType.stg | 380 +++++++++ .../us/ihmc/idl/templates/JavaType.stg | 326 ++++++++ .../us/ihmc/idl/templates/JavaTypes.stg | 66 ++ .../templates/us/ihmc/idl/templates/Types.stg | 52 ++ .../us/ihmc/idl/templates/idlTypes.stg | 45 ++ .../us/ihmc/idl/generated/Geometry/Box.java | 125 +++ .../idl/generated/Geometry/BoxPubSubType.java | 183 +++++ .../ihmc/idl/generated/Geometry/Polygon.java | 68 ++ .../generated/Geometry/PolygonPubSubType.java | 150 ++++ .../ihmc/idl/generated/Geometry/Triangle.java | 75 ++ .../Geometry/TrianglePubSubType.java | 153 ++++ .../generated/Geometry/VectorPubSubType.java | 354 +++++++++ .../ihmc/idl/generated/IDLElement/Color.java | 22 + .../generated/IDLElement/IDLElementTest.java | 647 +++++++++++++++ .../IDLElement/IDLElementTestPubSubType.java | 662 ++++++++++++++++ .../IDLNestedElement/NestedElement.java | 98 +++ .../NestedElementPubSubType.java | 159 ++++ .../src/test/idl/IDLElementTest.idl | 68 ++ .../src/test/idl/NestedElement.idl | 23 + .../src/test/idl/Vector.idl | 47 ++ .../us/ihmc/idl/Chat/ChatMessageTest.java | 48 ++ .../us/ihmc/idl/GenerateIDLElementTest.java | 43 + .../idl/IDLElement/IDLElementTestCPPData.java | 155 ++++ .../idl/IDLElement/IDLElementTestTest.java | 362 +++++++++ ihmc-pub-sub/.gitignore | 18 + CMakeLists.txt => ihmc-pub-sub/CMakeLists.txt | 0 ihmc-pub-sub/build.gradle | 145 ++++ .../cmake}/Modules/FindFastRTPS.cmake | 0 .../cppsrc}/FastRTPS/CMakeLists.txt | 0 .../cppsrc}/FastRTPS/commonfunctions.h | 0 .../cppsrc}/FastRTPS/fastrtpsexception.h | 0 .../cppsrc}/FastRTPS/loglevel.cpp | 0 .../cppsrc}/FastRTPS/loglevel.h | 0 .../FastRTPS/nativeparticipantimpl.cpp | 0 .../cppsrc}/FastRTPS/nativeparticipantimpl.h | 0 .../cppsrc}/FastRTPS/nativepublisherimpl.cpp | 0 .../cppsrc}/FastRTPS/nativepublisherimpl.h | 0 .../cppsrc}/FastRTPS/nativesubscriberimpl.cpp | 0 .../cppsrc}/FastRTPS/nativesubscriberimpl.h | 0 .../cppsrc}/FastRTPS/publisherhistory.cpp | 0 .../cppsrc}/FastRTPS/publisherhistory.h | 0 .../cppsrc}/FastRTPS/sampleinfomarshaller.h | 0 .../cppsrc}/test/CMakeLists.txt | 0 .../cppsrc}/test/IDLElementTest.cxx | 0 .../cppsrc}/test/IDLElementTest.h | 0 .../test/IDLElementTestPubSubTypes.cxx | 0 .../cppsrc}/test/IDLElementTestPubSubTypes.h | 0 .../cppsrc}/test/NestedElement.cxx | 0 .../cppsrc}/test/NestedElement.h | 0 .../cppsrc}/test/NestedElementPubSubTypes.cxx | 0 .../cppsrc}/test/NestedElementPubSubTypes.h | 0 .../cppsrc}/test/idlelementserializetest.cpp | 0 fastcdr.patch => ihmc-pub-sub/fastcdr.patch | 0 ihmc-pub-sub/gradle.properties | 6 + {idl => ihmc-pub-sub/idl}/ChatMessage.idl | 0 ihmc-pub-sub/settings.gradle | 17 + .../ihmc/idl/generated/Chat/ChatMessage.java | 0 .../generated/Chat/ChatMessagePubSubType.java | 0 .../src}/main/java/us/ihmc/idl/CDR.java | 0 .../main/java/us/ihmc/idl/IDLSequence.java | 0 .../src}/main/java/us/ihmc/idl/IDLTools.java | 0 .../us/ihmc/idl/InterchangeSerializer.java | 0 .../java/us/ihmc/idl/PreallocatedList.java | 0 .../src}/main/java/us/ihmc/pubsub/Domain.java | 0 .../java/us/ihmc/pubsub/DomainFactory.java | 0 .../java/us/ihmc/pubsub/TopicDataType.java | 0 .../pubsub/attributes/DurabilityKind.java | 0 .../pubsub/attributes/HistoryQosPolicy.java | 0 .../us/ihmc/pubsub/attributes/Locator.java | 0 .../attributes/MemoryManagementPolicy.java | 0 .../attributes/OwnerShipPolicyKind.java | 0 .../attributes/ParticipantAttributes.java | 0 .../pubsub/attributes/PublishModeKind.java | 0 .../attributes/PublisherAttributes.java | 0 .../ihmc/pubsub/attributes/QosInterface.java | 0 .../us/ihmc/pubsub/attributes/QosPolicy.java | 0 .../pubsub/attributes/ReaderQosHolder.java | 0 .../pubsub/attributes/ReliabilityKind.java | 0 .../attributes/ResourceLimitsQosPolicy.java | 0 .../attributes/SubscriberAttributes.java | 0 .../ThroughputControllerDescriptor.java | 0 .../pubsub/attributes/TopicAttributes.java | 0 .../pubsub/attributes/WriterQosHolder.java | 0 .../us/ihmc/pubsub/common/ChangeKind.java | 0 .../ihmc/pubsub/common/DiscoveryStatus.java | 0 .../main/java/us/ihmc/pubsub/common/Guid.java | 0 .../us/ihmc/pubsub/common/InstanceHandle.java | 0 .../java/us/ihmc/pubsub/common/LogLevel.java | 0 .../us/ihmc/pubsub/common/MatchingInfo.java | 0 .../us/ihmc/pubsub/common/SampleIdentity.java | 0 .../us/ihmc/pubsub/common/SampleInfo.java | 0 .../us/ihmc/pubsub/common/SequenceNumber.java | 0 .../ihmc/pubsub/common/SerializedPayload.java | 0 .../main/java/us/ihmc/pubsub/common/Time.java | 0 ...pointDiscoveryProtocolListenerExample.java | 0 .../ihmc/pubsub/example/PublisherExample.java | 0 .../pubsub/example/SubscriberExample.java | 0 .../impl/intraprocess/IntraProcessDomain.java | 0 .../intraprocess/IntraProcessDomainImpl.java | 0 .../impl/intraprocess/IntraProcessLog.java | 0 .../intraprocess/IntraProcessParticipant.java | 0 .../IntraProcessParticipantAttributes.java | 0 .../IntraProcessParticipantDiscoveryInfo.java | 0 .../intraprocess/IntraProcessPublisher.java | 0 .../IntraProcessPublisherAttributes.java | 0 .../IntraProcessQosInterface.java | 0 .../IntraProcessReaderQosHolder.java | 0 .../intraprocess/IntraProcessSubscriber.java | 0 .../IntraProcessSubscriberAttributes.java | 0 .../IntraProcessWriterQosHolder.java | 0 .../ihmc/pubsub/participant/Participant.java | 0 .../participant/ParticipantDiscoveryInfo.java | 0 .../participant/ParticipantListener.java | 0 .../PublisherEndpointDiscoveryListener.java | 0 .../SubscriberEndpointDiscoveryListener.java | 0 .../us/ihmc/pubsub/publisher/Publisher.java | 0 .../pubsub/publisher/PublisherListener.java | 0 .../us/ihmc/pubsub/subscriber/Subscriber.java | 0 .../pubsub/subscriber/SubscriberListener.java | 0 .../pubsub/types/ByteBufferPubSubType.java | 0 .../impl/fastRTPS/FastRTPSAttributes.java | 0 .../fastRTPS/FastRTPSCommonFunctions.java | 0 .../rtps/impl/fastRTPS/FastRTPSDomain.java | 0 .../impl/fastRTPS/FastRTPSParticipant.java | 0 .../FastRTPSParticipantAttributes.java | 0 .../FastRTPSParticipantDiscoveryInfo.java | 0 .../rtps/impl/fastRTPS/FastRTPSPublisher.java | 0 .../fastRTPS/FastRTPSPublisherAttributes.java | 0 .../fastRTPS/FastRTPSReaderQosHolder.java | 0 .../impl/fastRTPS/FastRTPSSubscriber.java | 0 .../FastRTPSSubscriberAttributes.java | 0 .../fastRTPS/FastRTPSWriterQosHolder.java | 0 .../rtps/impl/fastRTPS/FastRTPSWrapper.dll | 0 .../impl/fastRTPS/libFastRTPSWrapper.dylib | 0 .../rtps/impl/fastRTPS/libFastRTPSWrapper.so | 0 .../us/ihmc/idl/PreallocatedListTest.java | 0 .../intraprocess/IntraProcessDomainTest.java | 0 .../swig}/FastRTPS/CMakeLists.txt | 0 .../swig}/FastRTPS/FastRTPS.i | 0 .../rtps/impl/fastRTPS/BuiltinAttributes.java | 0 .../ihmc/rtps/impl/fastRTPS/ChangeKind_t.java | 0 .../rtps/impl/fastRTPS/DISCOVERY_STATUS.java | 0 .../rtps/impl/fastRTPS/DeadlineQosPolicy.java | 0 .../fastRTPS/DestinationOrderQosPolicy.java | 0 .../DestinationOrderQosPolicyKind.java | 0 .../rtps/impl/fastRTPS/DurabilityKind_t.java | 0 .../impl/fastRTPS/DurabilityQosPolicy.java | 0 .../fastRTPS/DurabilityQosPolicyKind_t.java | 0 .../fastRTPS/DurabilityServiceQosPolicy.java | 0 .../impl/fastRTPS/EndpointAttributes.java | 0 .../rtps/impl/fastRTPS/EndpointKind_t.java | 0 .../us/ihmc/rtps/impl/fastRTPS/FastRTPS.java | 0 .../rtps/impl/fastRTPS/FastRTPSConstants.java | 0 .../rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h | 0 .../ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java | 0 .../impl/fastRTPS/GroupDataQosPolicy.java | 0 .../rtps/impl/fastRTPS/HistoryQosPolicy.java | 0 .../impl/fastRTPS/HistoryQosPolicyKind.java | 0 .../impl/fastRTPS/LatencyBudgetQosPolicy.java | 0 .../rtps/impl/fastRTPS/LifespanQosPolicy.java | 0 .../impl/fastRTPS/LivelinessQosPolicy.java | 0 .../fastRTPS/LivelinessQosPolicyKind.java | 0 .../rtps/impl/fastRTPS/LocatorList_t.java | 0 .../us/ihmc/rtps/impl/fastRTPS/Locator_t.java | 0 .../us/ihmc/rtps/impl/fastRTPS/LogLevel.java | 0 .../rtps/impl/fastRTPS/MatchingStatus.java | 0 .../fastRTPS/MemoryManagementPolicy_t.java | 0 .../impl/fastRTPS/NativeParticipantImpl.java | 0 .../fastRTPS/NativeParticipantListener.java | 0 ...NativeParticipantPublisherEDPListener.java | 0 ...ativeParticipantSubscriberEDPListener.java | 0 .../impl/fastRTPS/NativePublisherImpl.java | 0 .../fastRTPS/NativePublisherListener.java | 0 .../impl/fastRTPS/NativeSubscriberImpl.java | 0 .../fastRTPS/NativeSubscriberListener.java | 0 .../impl/fastRTPS/OwnershipQosPolicy.java | 0 .../impl/fastRTPS/OwnershipQosPolicyKind.java | 0 .../fastRTPS/OwnershipStrengthQosPolicy.java | 0 .../impl/fastRTPS/PartitionQosPolicy.java | 0 .../rtps/impl/fastRTPS/PortParameters.java | 0 .../impl/fastRTPS/PresentationQosPolicy.java | 0 .../PresentationQosPolicyAccessScopeKind.java | 0 .../impl/fastRTPS/PublishModeQosPolicy.java | 0 .../fastRTPS/PublishModeQosPolicyKind_t.java | 0 .../impl/fastRTPS/PublisherAttributes.java | 0 .../us/ihmc/rtps/impl/fastRTPS/QosPolicy.java | 0 .../fastRTPS/RTPSParticipantAttributes.java | 0 .../impl/fastRTPS/RTPSWriterPublishMode.java | 0 .../rtps/impl/fastRTPS/ReaderAttributes.java | 0 .../us/ihmc/rtps/impl/fastRTPS/ReaderQos.java | 0 .../ihmc/rtps/impl/fastRTPS/ReaderTimes.java | 0 .../rtps/impl/fastRTPS/ReliabilityKind_t.java | 0 .../impl/fastRTPS/ReliabilityQosPolicy.java | 0 .../fastRTPS/ReliabilityQosPolicyKind.java | 0 .../impl/fastRTPS/RemoteReaderAttributes.java | 0 .../impl/fastRTPS/RemoteWriterAttributes.java | 0 .../fastRTPS/ResourceLimitsQosPolicy.java | 0 .../fastRTPS/SWIGTYPE_p_CDRMessage_t.java | 0 .../fastRTPS/SWIGTYPE_p_CacheChange_t.java | 0 .../fastRTPS/SWIGTYPE_p_PropertyPolicy.java | 0 .../fastRTPS/SWIGTYPE_p_unsigned_char.java | 0 .../impl/fastRTPS/SampleInfoMarshaller.java | 0 .../impl/fastRTPS/SimpleEDPAttributes.java | 0 .../impl/fastRTPS/SubscriberAttributes.java | 0 .../ThroughputControllerDescriptor.java | 0 .../fastRTPS/TimeBasedFilterQosPolicy.java | 0 .../us/ihmc/rtps/impl/fastRTPS/Time_t.java | 0 .../rtps/impl/fastRTPS/TopicAttributes.java | 0 .../impl/fastRTPS/TopicDataQosPolicy.java | 0 .../ihmc/rtps/impl/fastRTPS/TopicKind_t.java | 0 .../fastRTPS/TransportPriorityQosPolicy.java | 0 .../rtps/impl/fastRTPS/UserDataQosPolicy.java | 0 .../rtps/impl/fastRTPS/WriterAttributes.java | 0 .../us/ihmc/rtps/impl/fastRTPS/WriterQos.java | 0 .../ihmc/rtps/impl/fastRTPS/WriterTimes.java | 0 .../ihmc/rtps/impl/fastRTPS/octetVector.java | 0 .../ihmc/rtps/impl/fastRTPS/stringVector.java | 0 settings.gradle | 4 +- thirdparty/Fast-RTPS | 1 - 237 files changed, 6909 insertions(+), 144 deletions(-) delete mode 100644 .gitmodules create mode 100644 ihmc-pub-sub-generator/Readme.md create mode 100644 ihmc-pub-sub-generator/build.gradle create mode 100644 ihmc-pub-sub-generator/gradle.properties create mode 100644 ihmc-pub-sub-generator/settings.gradle create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractStructTypeCode.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractTypeDeclaration.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/Context.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGenerator.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGeneratorTask.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/MyContext.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/PreprocessorFilter.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/StructTypeCode.java create mode 100644 ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/TypesGenerator.java create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Common.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/FastCdrCommon.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaPubSubType.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaType.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaTypes.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Types.stg create mode 100644 ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/idlTypes.stg create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Box.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/BoxPubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Polygon.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/PolygonPubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Triangle.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/TrianglePubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/VectorPubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/Color.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTest.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTestPubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElement.java create mode 100644 ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElementPubSubType.java create mode 100644 ihmc-pub-sub-generator/src/test/idl/IDLElementTest.idl create mode 100644 ihmc-pub-sub-generator/src/test/idl/NestedElement.idl create mode 100644 ihmc-pub-sub-generator/src/test/idl/Vector.idl create mode 100644 ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/Chat/ChatMessageTest.java create mode 100644 ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/GenerateIDLElementTest.java create mode 100644 ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestCPPData.java create mode 100644 ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestTest.java create mode 100644 ihmc-pub-sub/.gitignore rename CMakeLists.txt => ihmc-pub-sub/CMakeLists.txt (100%) create mode 100644 ihmc-pub-sub/build.gradle rename {cmake => ihmc-pub-sub/cmake}/Modules/FindFastRTPS.cmake (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/CMakeLists.txt (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/commonfunctions.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/fastrtpsexception.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/loglevel.cpp (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/loglevel.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativeparticipantimpl.cpp (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativeparticipantimpl.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativepublisherimpl.cpp (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativepublisherimpl.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativesubscriberimpl.cpp (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/nativesubscriberimpl.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/publisherhistory.cpp (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/publisherhistory.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/FastRTPS/sampleinfomarshaller.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/CMakeLists.txt (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/IDLElementTest.cxx (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/IDLElementTest.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/IDLElementTestPubSubTypes.cxx (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/IDLElementTestPubSubTypes.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/NestedElement.cxx (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/NestedElement.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/NestedElementPubSubTypes.cxx (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/NestedElementPubSubTypes.h (100%) rename {cppsrc => ihmc-pub-sub/cppsrc}/test/idlelementserializetest.cpp (100%) rename fastcdr.patch => ihmc-pub-sub/fastcdr.patch (100%) create mode 100644 ihmc-pub-sub/gradle.properties rename {idl => ihmc-pub-sub/idl}/ChatMessage.idl (100%) create mode 100644 ihmc-pub-sub/settings.gradle rename {src => ihmc-pub-sub/src}/main/generated/us/ihmc/idl/generated/Chat/ChatMessage.java (100%) rename {src => ihmc-pub-sub/src}/main/generated/us/ihmc/idl/generated/Chat/ChatMessagePubSubType.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/idl/CDR.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/idl/IDLSequence.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/idl/IDLTools.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/idl/InterchangeSerializer.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/idl/PreallocatedList.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/Domain.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/DomainFactory.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/TopicDataType.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/DurabilityKind.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/HistoryQosPolicy.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/Locator.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/MemoryManagementPolicy.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/OwnerShipPolicyKind.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/ParticipantAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/PublishModeKind.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/PublisherAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/QosInterface.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/QosPolicy.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/ReaderQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/ReliabilityKind.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/ResourceLimitsQosPolicy.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/SubscriberAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/ThroughputControllerDescriptor.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/TopicAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/attributes/WriterQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/ChangeKind.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/DiscoveryStatus.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/Guid.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/InstanceHandle.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/LogLevel.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/MatchingInfo.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/SampleIdentity.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/SampleInfo.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/SequenceNumber.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/SerializedPayload.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/common/Time.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/example/EndpointDiscoveryProtocolListenerExample.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/example/PublisherExample.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/example/SubscriberExample.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomain.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainImpl.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessLog.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipant.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantDiscoveryInfo.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisher.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisherAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessQosInterface.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessReaderQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriber.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriberAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessWriterQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/participant/Participant.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/participant/ParticipantDiscoveryInfo.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/participant/ParticipantListener.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/participant/PublisherEndpointDiscoveryListener.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/participant/SubscriberEndpointDiscoveryListener.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/publisher/Publisher.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/publisher/PublisherListener.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/subscriber/Subscriber.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/subscriber/SubscriberListener.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/pubsub/types/ByteBufferPubSubType.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSCommonFunctions.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSDomain.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipant.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantDiscoveryInfo.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisher.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisherAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSReaderQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriber.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriberAttributes.java (100%) rename {src => ihmc-pub-sub/src}/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSWriterQosHolder.java (100%) rename {src => ihmc-pub-sub/src}/main/resources/us/ihmc/rtps/impl/fastRTPS/FastRTPSWrapper.dll (100%) rename {src => ihmc-pub-sub/src}/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.dylib (100%) rename {src => ihmc-pub-sub/src}/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.so (100%) rename {src => ihmc-pub-sub/src}/test/java/us/ihmc/idl/PreallocatedListTest.java (100%) rename {src => ihmc-pub-sub/src}/test/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainTest.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/CMakeLists.txt (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/FastRTPS.i (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/BuiltinAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ChangeKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DISCOVERY_STATUS.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DeadlineQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicyKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicyKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityServiceQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPS.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSConstants.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/GroupDataQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicyKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LatencyBudgetQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LifespanQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicyKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LocatorList_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Locator_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LogLevel.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MatchingStatus.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MemoryManagementPolicy_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantImpl.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantListener.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantPublisherEDPListener.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantSubscriberEDPListener.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherImpl.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherListener.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberImpl.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberListener.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicyKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipStrengthQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PartitionQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PortParameters.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicyAccessScopeKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicyKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublisherAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/QosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSParticipantAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSWriterPublishMode.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderQos.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderTimes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicyKind.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteReaderAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteWriterAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ResourceLimitsQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CDRMessage_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CacheChange_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_PropertyPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_unsigned_char.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SampleInfoMarshaller.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SimpleEDPAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SubscriberAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ThroughputControllerDescriptor.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TimeBasedFilterQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Time_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicDataQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicKind_t.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TransportPriorityQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/UserDataQosPolicy.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterAttributes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterQos.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterTimes.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/octetVector.java (100%) rename {swig => ihmc-pub-sub/swig}/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/stringVector.java (100%) delete mode 160000 thirdparty/Fast-RTPS diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5604e81b..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "thirdparty/Fast-RTPS"] - path = thirdparty/Fast-RTPS - url = https://github.com/eProsima/Fast-RTPS.git diff --git a/build.gradle b/build.gradle index 051b2eae..1e040ba2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,145 +1,11 @@ buildscript { repositories { - mavenCentral() - maven { url "http://dl.bintray.com/ihmcrobotics/maven-release" } - maven { url "http://dl.bintray.com/ihmcrobotics/maven-vendor" } maven { url "https://plugins.gradle.org/m2/" } mavenLocal() jcenter() } dependencies { classpath "us.ihmc:ihmc-build:0.12.8" - classpath "us.ihmc:ihmc-pub-sub-generator:0.3.7" - classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1" } } apply plugin: "us.ihmc.ihmc-build" -apply plugin: "com.github.hierynomus.license" - -ihmc { - group = "us.ihmc" - version = "0.4.0" - vcsUrl = "https://github.com/ihmcrobotics/ihmc-pub-sub" - openSource = true - maintainer = "Jesper Smith (jesper@halodi.com)" - - configureDependencyResolution() - resourceDirectory("main", "idl") - javaDirectory("main", "generated") - javaDirectory("main", "../../swig/FastRTPS/generated") - configurePublications() -} - -// For swig builds -//buildDir = 'build-java' - -task generateChatMessage(type: us.ihmc.idl.generator.IDLGeneratorTask) { - idlFiles = fileTree(dir: 'idl') - includeDirs = files(".", "idl") - targetDirectory = file("src/main/generated") - packagePrefix = "us.ihmc.idl.generated" -} - -license { - header rootProject.file('license-header.txt') - ext.year = Calendar.getInstance().get(Calendar.YEAR) - strictCheck true -} - -mainDependencies { - compile group: 'us.ihmc', name: 'IHMCNativeLibraryLoader', version: '1.0' - compile group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3' - compile group: "us.ihmc", name: "euclid-core", version: "0.4.13" -} - -testDependencies { - compile group: 'junit', name: 'junit', version: '4.11' -} - -task wrapper(type: Wrapper) { - gradleVersion = '4.5' -} - -//sourceSets { -// main { -// java { -// srcDirs += ['swig/FastRTPS/generated'] -// srcDirs += ['generated'] -// } -// } -// -// code { -// java { -// srcDirs += ['src', 'test'] -// } -// } -//} - -// sourceSets = project.container(SourceSet) -// sourceSets.add(project.sourceSets.code) - -//task sourceJar(type: Jar) { -// from sourceSets.main.allJava -//} -// -//jar { -// manifest { -// attributes( -// "Created-By": "IHMC Gradle Build Script", -// "Implementation-Title": project.name, -// "Implementation-Version": project.version, -// "Implementation-Vendor": "IHMC", -// -// "Bundle-Name": project.name, -// "Bundle-Version": project.version, -// "Bundle-License": "http://www.apache.org/licenses/LICENSE-2.0.txt", -// "Bundle-Vendor": "IHMC") -// } -//} - -//repositories { -// jcenter() -// mavenCentral() -// maven { url "http://dl.bintray.com/ihmcrobotics/maven-release" } -//} - -//publishing { -// publications { -// mavenJava(MavenPublication) { -// -// groupId 'us.ihmc' -// artifactId project.name -// version "$version" -// from components.java -// -// pom.withXml { -// asNode().children().last() + { -// resolveStrategy = Closure.DELEGATE_FIRST -// name project.name -// url project.ext.vcsUrl -// licenses { -// license { -// name 'The Apache Software License, Version 2.0' -// url 'http://www.apache.org/license/LICENSE-2.0.txt' -// distribution 'repo' -// } -// } -// developers { -// developer { -// id 'jsmith' -// name 'Jesper Smith' -// email 'jsmith@ihmc.us' -// } -// } -// } -// } -// -// artifact sourceJar { -// classifier "sources" -// } -// } -// } -//} - -//def labels = ['ihmc', 'java', 'rtps', 'dds', 'net'] -//ihmc.configureForIHMCOpenSourceBintrayPublish(false, "mavenJava", "maven-release", labels) diff --git a/gradle.properties b/gradle.properties index 472a16bf..db74f267 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ -kebabCasedName = ihmc-pub-sub -pascalCasedName = IHMCPubSub -extraSourceSets = ["test"] +isProjectGroup = true +kebabCasedName = ihmc-pub-sub-group +pascalCasedName = IHMCPubSubGroup publishMode = LOCAL depthFromWorkspaceDirectory = 0 excludeFromCompositeBuild = false \ No newline at end of file diff --git a/ihmc-pub-sub-generator/Readme.md b/ihmc-pub-sub-generator/Readme.md new file mode 100644 index 00000000..8787fa6d --- /dev/null +++ b/ihmc-pub-sub-generator/Readme.md @@ -0,0 +1,78 @@ +# IHMC Pub/Sub Generator + +The IHMC Pub/Sub generator creates Java classes from OMG DDS IDL formatted files. The resulting classes can be used in conjunction with [IHMC Pub/Sub](https://github.com/ihmcrobotics/ihmc-pub-sub) to serialize and deserialize to the Common Data Representation(CDR) format. + +## Toolchain +- [IHMC Pub/Sub](https://github.com/ihmcrobotics/ihmc-pub-sub): IHMC Pub/Sub RTPS library +- [IHMC Pub/Sub generator](https://github.com/ihmcrobotics/ihmc-pub-sub-generator): Gradle plugin and standalone application to generate java classes from .idl messages. +- [IHMC RTPS Visualizer](https://github.com/ihmcrobotics/ihmc-rtps-visualizer): GUI to display partitions, topics, participants, subscribers, publisher and publisher data on a RTPS domain. +- [IHMC Pub/Sub serializers extra](https://github.com/ihmcrobotics/ihmc-pub-sub-serializers-extra): Optional serializer to generated JSON, BSON, YAML, Java Properties and XML(limited) output from .idl messages. + +## License +The IHMC Pub/Sub generator is licensed under the Apache 2.0. See LICENSE.txt + +## Features +- Pure Java serialization/deserialization. Allows message generation without having to compile native libraries. +- Allocation free during serialization/deserialization. All elements of the message are preallocated. +- StringBuilder instead of string allow allocation free string deserialzation. +- Support for wchar and wstring to map directly to Java's UTF-16. +- Automatically generated equals() and toString() methods for testing and debugging. +- Support for #include directives and other C preprocessor directives. The include search path is the current directory and the parent directory of the .idl file. +- Optional (using [IHMC pub/sub serializers extra](https://github.com/ihmcrobotics/ihmc-pub-sub-serializers-extra) ) serialization and deserialization to JSON/BSON/YAML and XML. +- @Abstract(type="[fully qualified class name]") annotation to generate an abstract Pub/Sub type. This allows reusing exisiting Java data objects in combination with IDL specified data without marshalling. Use [Name]PubSubType.setImplementation() to implement. + +### Limitations +- Sequences of arrays and arrays of sequences are not supported. +- Long Doubles are not supported due to limitations in the Java language. +- Union, alias, value, sparse, set and map are not implemented. +- Interfaces are not implemented. + +### Compatibility notes +- CDR Byte stream is validated against FastCDR generated byte stream. +- FastRTPS's fastrtpsgen does not seem to support wstring and Sequence\ + + +## Usage + +The IHMC Pub/Sub generator can either be used as a gradle plugin (recommended) or standalone library. + +### Gradle +Include the IHMC Pub Sub Generator into your build file +``` +buildscript { + repositories { + maven { + url "http://dl.bintray.com/ihmcrobotics/maven-release" + } + } + + dependencies { + classpath group: 'us.ihmc', name: 'IHMCPubSubGenerator', version: '0.2.4' + } +} +``` + +This creates a task to compile IDL files. The following properties can be set +- idlFiles: FileCollection of idl files to compile [Required] +- inludeDirs: FileCollection of include directories +- targetDirectory: File target directory + +``` +task generateIDL(type: us.ihmc.idl.generator.IDLGeneratorTask) { + idlFiles = fileTree(dir: 'idl') + includeDirs = files(".") + targetDirectory = file("generated") + packagePrefix = "us.ihmc.idl.generated" +} +``` + + + +### Java application +Run us.ihmc.idl.generator.IDLGenerator. There are three options for generating IDL files + +- No command line arguments: Dialogs will popup to select the IDL file and provide a target directory and package name. +- Command line arguments: us.ihmc.idl.generator.IDLGenerator \[idl filename\] \[package\] \[target directory\] +- Call directly from Java: us.ihmc.idl.generator.IDLGenerator.execute(String idlFilename, String packageName, File targetDirectory) + + diff --git a/ihmc-pub-sub-generator/build.gradle b/ihmc-pub-sub-generator/build.gradle new file mode 100644 index 00000000..aadb2be3 --- /dev/null +++ b/ihmc-pub-sub-generator/build.gradle @@ -0,0 +1,62 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + mavenLocal() + maven { url "http://dl.bintray.com/ihmcrobotics/maven-release" } + maven { url "http://dl.bintray.com/ihmcrobotics/maven-vendor" } + jcenter() + } + dependencies { + classpath "us.ihmc:ihmc-build:0.12.8" + classpath group: "us.ihmc", name: "ihmc-pub-sub-generator", version: "0.3.8-LOCAL" + classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1" + } +} +apply plugin: "us.ihmc.ihmc-build" +apply plugin: "com.github.hierynomus.license" +apply plugin: "application" + +buildDir = "build-java" +mainClassName = "us.ihmc.idl.generator.IDLGenerator" + +ihmc { + group = "us.ihmc" + version = "0.3.8" + vcsUrl = "https://stash.ihmc.us/projects/LIBS/repos/ihmc-pub-sub-generator" + openSource = true + maintainer = "Jesper Smith (jsmith@ihmc.us)" + + configureDependencyResolution() + resourceDirectory("main", "templates") + javaDirectory("test", "generated-java") + resourceDirectory("test", "idl") + configurePublications() +} + +dependencies { + compile gradleApi() + compile group: "us.ihmc.thirdparty.eprosima", name: "idl-parser", version: "1.0.0-ihmc3" + compile group: "org.anarres", name: "jcpp", version: "1.4.12" + compile group: "us.ihmc", name: "euclid-core", version: "0.4.13" +} + +testDependencies { + compile group: "us.ihmc", name: "ihmc-pub-sub", version: "0.4.0" + compile group: "junit", name: "junit", version: "4.12" +} + +license { + header rootProject.file("license-header.txt") + ext.year = Calendar.getInstance().get(Calendar.YEAR) + strictCheck true + + sourceSets = project.container(SourceSet) + sourceSets.add(ihmc.sourceSet("main")) +} + +task generateIDLElementTest(type: us.ihmc.idl.generator.IDLGeneratorTask) { + idlFiles = fileTree(dir: "src/test/idl") + includeDirs = files(".", "idl") + targetDirectory = file("src/test/generated-java") + packagePrefix = "us.ihmc.idl.generated" +} diff --git a/ihmc-pub-sub-generator/gradle.properties b/ihmc-pub-sub-generator/gradle.properties new file mode 100644 index 00000000..8e805714 --- /dev/null +++ b/ihmc-pub-sub-generator/gradle.properties @@ -0,0 +1,7 @@ +kebabCasedName = ihmc-pub-sub-generator +pascalCasedName = IHMCPubSubGenerator +extraSourceSets = ["test"] +publishMode = LOCAL +groupDependencyVersion = source +depthFromWorkspaceDirectory = 1 +excludeFromCompositeBuild = false \ No newline at end of file diff --git a/ihmc-pub-sub-generator/settings.gradle b/ihmc-pub-sub-generator/settings.gradle new file mode 100644 index 00000000..314fa855 --- /dev/null +++ b/ihmc-pub-sub-generator/settings.gradle @@ -0,0 +1,19 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + mavenLocal() + } + dependencies { + classpath "us.ihmc:ihmc-build:0.12.8" + } +} + +import us.ihmc.build.IHMCSettingsConfigurator + +/** + * Browse source at https://github.com/ihmcrobotics/ihmc-build + */ +def ihmcSettingsConfigurator = new IHMCSettingsConfigurator(settings, logger, ext) +ihmcSettingsConfigurator.checkRequiredPropertiesAreSet() +ihmcSettingsConfigurator.configureExtraSourceSets() +ihmcSettingsConfigurator.findAndIncludeCompositeBuilds() diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractStructTypeCode.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractStructTypeCode.java new file mode 100644 index 00000000..d394eba6 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractStructTypeCode.java @@ -0,0 +1,87 @@ +/* + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import org.antlr.stringtemplate.StringTemplate; + +import com.eprosima.idl.parser.tree.Annotation; +import com.eprosima.idl.parser.tree.TypeDeclaration; +import com.eprosima.idl.parser.typecode.Member; + +public class AbstractStructTypeCode extends StructTypeCode +{ + private final String abstractTypeName; + private final String abstractImplementation; + public AbstractStructTypeCode(TypeDeclaration declaration) + { + super(((StructTypeCode)declaration.getTypeCode()).getScope(), ((StructTypeCode)declaration.getTypeCode()).getName()); + Annotation abstractAnnotation = declaration.getAnnotations().get("Abstract"); + if(abstractAnnotation == null) + { + throw new RuntimeException("No Abstract annotation"); + } + String rawType = abstractAnnotation.getValue("type"); + this.abstractTypeName = rawType.substring(1, rawType.length() - 1); + if(abstractAnnotation.getValue("impl") != null) + { + String rawImpl = abstractAnnotation.getValue("impl"); + this.abstractImplementation = rawImpl.substring(1, rawImpl.length() - 1); + } + else + { + this.abstractImplementation = "null"; + } + + for(Member member : ((StructTypeCode) declaration.getTypeCode()).getMembers()) + { + addMember(member); + } + } + + @Override + public String getJavaScopedname() + { + return abstractTypeName; + } + + + public String getAbstractimpl() + { + return abstractImplementation; + } + + protected StringTemplate getJavaTypenameFromStringTemplate() + { + StringTemplate st = javatypesgr.getInstanceOf("type_" + Integer.toHexString(getKind())); + st.setAttribute("package", ""); + return st; + } + + @Override + public String getPubsubTypename() + { + StringTemplate st = getJavaTypenameFromStringTemplate(); + st.setAttribute("package", javapackage); + st.setAttribute("name", super.getJavaScopedname() + "PubSubType"); + return st.toString(); + } + + @Override + public boolean isAbstract() + { + return true; + } +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractTypeDeclaration.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractTypeDeclaration.java new file mode 100644 index 00000000..81dbbbc8 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/AbstractTypeDeclaration.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import java.util.Map.Entry; + +import com.eprosima.idl.parser.tree.Annotation; +import com.eprosima.idl.parser.tree.TypeDeclaration; + +public class AbstractTypeDeclaration extends TypeDeclaration +{ + + public AbstractTypeDeclaration(TypeDeclaration typeDeclaration) + { + super(typeDeclaration.getScopeFile(), typeDeclaration.isInScope(), typeDeclaration.getScope(), typeDeclaration.getName(), new AbstractStructTypeCode(typeDeclaration), typeDeclaration.getToken()); + for(Entry entry : typeDeclaration.getAnnotations().entrySet()) + { + addAnnotation(null, entry.getValue()); + } + } + +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/Context.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/Context.java new file mode 100644 index 00000000..e308e7ba --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/Context.java @@ -0,0 +1,746 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package us.ihmc.idl.generator; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Stack; +import java.util.Scanner; +import java.util.NoSuchElementException; +import java.util.Collection; + +import com.eprosima.idl.util.Pair; +import com.eprosima.idl.parser.tree.TreeNode; +import com.eprosima.idl.parser.tree.Notebook; +import com.eprosima.idl.parser.tree.Definition; +import com.eprosima.idl.parser.tree.Module; +import com.eprosima.idl.parser.tree.Interface; +import com.eprosima.idl.parser.tree.Operation; +import com.eprosima.idl.parser.tree.Param; +import com.eprosima.idl.parser.tree.AnnotationDeclaration; +import com.eprosima.idl.parser.tree.TypeDeclaration; +import com.eprosima.idl.parser.typecode.TypeCode; +import com.eprosima.idl.parser.typecode.StructTypeCode; + +import com.eprosima.idl.util.Util; +import com.eprosima.idl.parser.exception.ParseException; + +import org.antlr.v4.runtime.Token; + +public class Context extends com.eprosima.idl.context.Context +{ + public Context(String filename, String file, ArrayList includePaths) + { + super(filename, file, includePaths); + // Detect OS + m_os = System.getProperty("os.name"); + m_userdir = System.getProperty("user.dir"); + + m_filename = filename; + m_directoryFile = Util.getIDLFileDirectoryOnly(file); + m_file = file; + + // Remove absolute directory where the application was executed + if(startsWith(m_file, m_userdir)) + { + m_file = m_file.substring(m_userdir.length()); + + // Remove possible separator + if(startsWith(m_file, java.io.File.separator)) + m_file = m_file.substring(1); + } + /* + // Remove relative directory if is equal that where the processed IDL is. + if(m_directoryFile != null && startsWith(m_file, m_directoryFile)) + m_file = m_file.substring(m_directoryFile.length()); + */ + + m_definitions = new ArrayList(); + m_modules = new HashMap(); + m_interfaces = new HashMap(); + m_exceptions = new HashMap(); + m_types = new HashMap(); + m_annotations = new HashMap(); + + // TODO Quitar porque solo es para tipos RTI (usado para las excepciones). Mirar alternativa. + m_includedependency = new HashSet(); + + // The scope file has to be initialized because could occur the preprocessor + // is not called (using -ppDisable). + m_scopeFile = m_file; + + m_includePaths = new ArrayList(); + m_dependencies = new LinkedHashSet(); + m_directIncludeDependencies = new HashSet(); + m_scopeFilesStack = new Stack>(); + + for(int i = 0; i < includePaths.size(); ++i) + { + String include = (String)includePaths.get(i); + if(startsWith(include, includeFlag)) + include = include.substring(includeFlag.length()); + if(startsWith(include, m_userdir)) + { + include = include.substring(m_userdir.length()); + + // Remove possible separator + if(startsWith(include, java.io.File.separator)) + include = include.substring(1); + } + if(m_directoryFile != null && startsWith(include, m_directoryFile)) + include = include.substring(m_directoryFile.length()); + // Add last separator. + if(include.charAt(include.length() - 1) != java.io.File.separatorChar) + include += java.io.File.separator; + m_includePaths.add(include); + } + + // Reorder include paths; + int pointer = 0; + while(pointer < m_includePaths.size()) + { + int count = pointer + 1; + + while(count < m_includePaths.size()) + { + if(startsWith(m_includePaths.get(count), m_includePaths.get(pointer))) + { + String first = m_includePaths.get(pointer); + String second = m_includePaths.get(count); + m_includePaths.set(pointer, second); + m_includePaths.set(count, first); + break; + } + ++count; + } + + if(count == m_includePaths.size()) + ++pointer; + } + } + + public String getFilename() + { + return m_filename; + } + + public void setFilename(String filename) + { + m_filename = filename; + } + + public String getTrimfilename() + { + return Util.stringTrimAll(m_filename); + } + + public String getScope() + { + return m_scope; + } + + public void setScope(String scope) + { + m_scope = scope; + } + + /*! + * @return True if current call is in scoped file. + */ + public boolean isInScopedFile() + { + return m_scopeFile.equals(m_file); + } + + public String getScopeFile() + { + return m_scopeFile; + } + + public boolean isScopeLimitToAll() + { + return m_scopeLimitToAll; + } + + public void setScopeLimitToAll(boolean scopeLimitToAll) + { + m_scopeLimitToAll = scopeLimitToAll; + } + + public int getCurrentIncludeLine() + { + return m_currentincludeline; + } + + public Stack> getScopeFilesStack() + { + return m_scopeFilesStack; + } + + /*! + * @brief This function stores a global definition of the IDL file. + */ + public void addDefinition(Definition definition) + { + m_definitions.add(definition); + } + + public ArrayList getDefinitions() + { + return m_definitions; + } + + /*! + * @brief This function adds a module to the context. + * This function is used in the parser. + */ + public void addModule(Module module) + { + if(!m_modules.containsKey(module.getScopedname())) + { + m_modules.put(module.getScopedname(), module); + } + } + + public Module existsModule(String scopedName) + { + if(m_modules.containsKey(scopedName)) + { + return m_modules.get(scopedName); + } + + return null; + } + + public Interface createInterface(String name, Token token) + { + Interface interfaceObject = new Interface(m_scopeFile, isInScopedFile(), m_scope, name, token); + addInterface(interfaceObject); + return interfaceObject; + } + + /*! + * @brief This function adds a interface to the context. + * This function is used in the parser. + */ + protected void addInterface(Interface interf) + { + Interface prev = m_interfaces.put(interf.getScopedname(), interf); + + // TODO: Excepcion + if(prev != null) + System.out.println("Warning: Redefined interface " + prev.getScopedname()); + } + + public Interface getInterface(String name) + { + int lastIndex = -1; + Interface returnedValue = m_interfaces.get(name); + + if(returnedValue == null) + { + String scope = m_scope; + + while(returnedValue == null && !scope.isEmpty()) + { + returnedValue = m_interfaces.get(scope + "::" + name); + lastIndex = scope.lastIndexOf("::"); + + if(lastIndex != -1) + { + scope = scope.substring(0, lastIndex); + } + else + { + scope = ""; + } + } + } + + return returnedValue; + } + + /*! + * @brief This function returns all interfaces. + * This function is used in string templates. + */ + public ArrayList getInterfaces() + { + return new ArrayList(m_interfaces.values()); + } + + public ArrayList getScopedInterfaces() + { + ArrayList ret = new ArrayList(); + + for(Interface interf : m_interfaces.values()) + { + if(interf.isInScope()) + ret.add(interf); + } + + return ret; + } + + public com.eprosima.idl.parser.tree.Exception createException(String name, Token token) + { + com.eprosima.idl.parser.tree.Exception exceptionObject = new com.eprosima.idl.parser.tree.Exception(m_scopeFile, isInScopedFile(), m_scope, name, token); + addException(exceptionObject); + return exceptionObject; + } + + /*! + * @brief This function adds a global exception to the context. + */ + protected void addException(com.eprosima.idl.parser.tree.Exception exception) + { + com.eprosima.idl.parser.tree.Exception prev = m_exceptions.put(exception.getScopedname(), exception); + + // TODO: Exception. + if(prev != null) + System.out.println("Warning: Redefined exception " + prev.getScopedname()); + } + + /*! + * @brief This function tries to retrieve a global typecode. + */ + public com.eprosima.idl.parser.tree.Exception getException(String name) + { + int lastIndex = -1; + com.eprosima.idl.parser.tree.Exception returnedValue = m_exceptions.get(name); + + // Probar si no tiene scope, con el scope actual. + if(returnedValue == null) + { + String scope = m_scope; + + while(returnedValue == null && !scope.isEmpty()) + { + returnedValue = m_exceptions.get(scope + "::" + name); + lastIndex = scope.lastIndexOf("::"); + + if(lastIndex != -1) + { + scope = scope.substring(0, lastIndex); + } + else + { + scope = ""; + } + } + } + + return returnedValue; + } + + public Operation createOperation(String name, Token token) + { + Operation operationObject = new Operation(m_scopeFile, isInScopedFile(), null, name, token); + return operationObject; + } + + public Param createParam(String name, TypeCode typecode, Param.Kind kind) + { + Param paramObject = new Param(name, typecode, kind); + return paramObject; + } + + public StructTypeCode createStructTypeCode(String name) + { + StructTypeCode structObject = new StructTypeCode(m_scope, name); + return structObject; + } + + public Collection getTypes() + { + return m_types.values(); + } + + /*! + * @brief This function adds a global typecode to the context. + */ + public void addTypeDeclaration(TypeDeclaration typedecl) + { + TypeDeclaration prev = m_types.put(typedecl.getScopedname(), typedecl); + + if(prev != null) + throw new ParseException(typedecl.getToken(), "was redefined"); + } + + /*! + * @brief This function tries to retrieve a global typecode. + */ + public TypeCode getTypeCode(String name) + { + int lastIndex = -1; + TypeCode returnedValue = null; + TypeDeclaration typedecl = m_types.get(name); + + // Probar si no tiene scope, con el scope actual. + if(typedecl == null) + { + String scope = m_scope; + + while(typedecl == null && !scope.isEmpty()) + { + typedecl = m_types.get(scope + "::" + name); + lastIndex = scope.lastIndexOf("::"); + + if(lastIndex != -1) + { + scope = scope.substring(0, lastIndex); + } + else + { + scope = ""; + } + } + } + + if(typedecl != null) + returnedValue = typedecl.getTypeCode(); + + + return returnedValue; + } + + + public AnnotationDeclaration createAnnotationDeclaration(String name, Token token) + { + AnnotationDeclaration annotationObject = new AnnotationDeclaration(m_scopeFile, isInScopedFile(), m_scope, name, token); + addAnnotationDeclaration(annotationObject); + return annotationObject; + } + + /*! + * @brief This function adds an annotation to the context. + */ + protected void addAnnotationDeclaration(AnnotationDeclaration annotation) + { + AnnotationDeclaration prev = m_annotations.put(annotation.getScopedname(), annotation); + + // TODO: Exception. + if(prev != null) + System.out.println("Warning: Redefined annotation " + prev.getScopedname()); + } + + public AnnotationDeclaration getAnnotationDeclaration(String name) + { + int lastIndex = -1; + AnnotationDeclaration returnedValue = m_annotations.get(name); + + // Probar si no tiene scope, con el scope actual. + if(returnedValue == null) + { + String scope = m_scope; + + while(returnedValue == null && !scope.isEmpty()) + { + returnedValue = m_annotations.get(scope + "::" + name); + lastIndex = scope.lastIndexOf("::"); + + if(lastIndex != -1) + { + scope = scope.substring(0, lastIndex); + } + else + { + scope = ""; + } + } + } + + return returnedValue; + } + + /*! + * @brief This function add a new library dependency to the project. + */ + public void addDependency(String dependency) + { + m_dependencies.add(dependency); + } + + /*! + * @brief This function get the library dependencies of a project. + */ + public LinkedHashSet getDependencies() + { + // At this level the dependencies are in reverse order. Return them + // in correct order. + LinkedHashSet set = new LinkedHashSet(); + LinkedList list = new LinkedList(m_dependencies); + Iterator it = list.descendingIterator(); + + while(it.hasNext()) + { + String dep = it.next(); + + if(getOS().contains("Windows")) + { + // In windows substitute \\ by / + int count = 0; + while((count = dep.indexOf("/")) != -1) + { + dep = dep.substring(0, count) + "\\" + dep.substring(count + 1); + } + } + + set.add(dep); + } + + return set; + } + + /*! + * @brief This function is used in the stringtemplates. For these reason this function + * returns an ArrayList + */ + public ArrayList getDirectIncludeDependencies() + { + return new ArrayList(m_directIncludeDependencies); + } + + // TODO Quitar porque solo es para tipos RTI (usado para las excepciones). Mirar alternativa. + /*! + * @brief This function add a new include dependency to the project. + * This dependency will be needed to include our generated file with the types that + * the RTI DDS middleware doesn't generate (right now only exceptions). + * The include dependencies are added without the .idl extension. + */ + public void addIncludeDependency(String dependency) + { + // Remove .idl extension. + String dep = dependency.substring(0, dependency.length() - 4); + // Remove directory if it is the same than main IDL file. + if(m_directoryFile != null && startsWith(dep, m_directoryFile)) + dep = dep.substring(m_directoryFile.length()); + m_includedependency.add(dep); + } + + // TODO Quitar porque solo es para tipos RTI (usado para las excepciones). Mirar alternativa. + /*! + * @brief This function is used in the stringtemplates. For these reason this function + * returns an ArrayList + */ + public ArrayList getIncludeDependencies() + { + return new ArrayList(m_includedependency); + } + + /*! + * @brief This function is call when a preprocessor line was found by the lexer. + * In case the line referring to the content included file, this function sets this file as current scope file. + * Also this function saves the scope file in the library dependecy map. + * In case it is a #include directive, this is saved as direct include dependency. + */ + public void processPreprocessorLine(String line, int nline) + { + // If there is a line referring to the content of an included file. + if(line.startsWith("# ")) + { + String line_ = line.substring(2); + + /* The received preprocessor line has the following form: + * ' numline filename flags' + * where: + * - numline Number of the line where the include was. + * - filename The filename whose content was included. + * - flags + */ + Scanner scanner = new Scanner(line_); + + // Read numline + int numline = scanner.nextInt(); + + line_ = scanner.nextLine(); + scanner = new Scanner(line_).useDelimiter("\""); + + // Read filename + scanner.next(); + String file = scanner.next(); + System.out.println("file: " + file); + // Read flags. + boolean systemFile = false, enteringFile = false, exitingFile = false; + + if(m_os.contains("Linux")) + { + try + { + line_ = scanner.nextLine(); + scanner = new Scanner(line_); + scanner.next(); + + while(true) + { + Integer flag = scanner.nextInt(); + + if(flag == 1) + enteringFile = true; + else if(flag == 2) + exitingFile = true; + else if(flag == 3) + systemFile = true; + } + } + catch(NoSuchElementException ex) + { + // The line finishes. + } + } + + // Only not system files are processed. + if(!systemFile) + { + if(!m_scopeFile.equals(file)) + { + // Remove absolute directory where the application was executed + if(startsWith(file, m_userdir)) + { + file = file.substring(m_userdir.length()); + + // Remove possible separator + if(startsWith(file, java.io.File.separator)) + file = file.substring(1); + + } + // Remove relative ./ directory. + if(startsWith(file, currentDirS)) + { + file = file.substring(currentDirS.length()); + // Remove possible separator + if(startsWith(file, java.io.File.separator)) + file = file.substring(1); + } + + + + //if it is a idl file. + if(file.substring(file.length() - 4, file.length()).equals(".idl")) + { + if(!m_scopeFile.equals(file)) + { + if(!m_scopeFilesStack.empty() && m_scopeFilesStack.peek().first().equals(file)) + { + m_scopeFilesStack.pop(); + + // Add to dependency if there is different IDL file than the processed + addDependency(m_scopeFile); + + // See if it is a direct dependency. + if(file.equals(m_file)) + { + String includeFile = m_scopeFile; + // Remove relative directory if is equal that where the processed IDL is. + if(m_directoryFile != null && startsWith(includeFile, m_directoryFile)) + includeFile = includeFile.substring(m_directoryFile.length()); + // Remove relative directory if is equal to a include path. + for(int i = 0; i < m_includePaths.size(); ++i) + { + if(startsWith(includeFile, m_includePaths.get(i))) + { + includeFile = includeFile.substring(m_includePaths.get(i).length()); + break; + } + } + + m_directIncludeDependencies.add(includeFile.substring(0, includeFile.length() - 4)); + } + } + else + { + m_scopeFilesStack.push(new Pair(m_scopeFile, nline - m_currentincludeline - 1)); + } + + m_scopeFile = file; + } + } + } + + //Update the current line. + m_currentincludeline = nline - numline; + } + } + } + + protected String getOS() + { + return m_os; + } + + /*** Function to generate random loop variables in string templates ***/ + public String getNewLoopVarName() + { + m_loopVarName = 'a'; + return Character.toString(m_loopVarName); + } + + public String getNextLoopVarName() + { + return Character.toString(++m_loopVarName); + } + /*** End ***/ + + // OS + String m_os = null; + String m_userdir = null; + + private String m_filename = ""; + private String m_file = ""; + private String m_directoryFile = ""; + + private String m_scope = ""; + private String m_scopeFile = ""; + private boolean m_scopeLimitToAll = false; + + private int m_currentincludeline = 0; + + final String currentDirS = "." + File.separator; + final String includeFlag = "-I"; + + //! Store all global definitions. + private ArrayList m_definitions; + //! Map that contains all modules that were found processing the IDL file (after preprocessing): + private HashMap m_modules = null; + //! Map that contains all interfaces that were found processing the IDL file (after preprocessing): + private HashMap m_interfaces = null; + //! Map that contains all global exceptions that were found processing the IDL file (after preprocessing). + private HashMap m_exceptions = null; + //! Map that contains all types that were found processing the IDL file (after preprocessing). + protected HashMap m_types = null; + //! Map that contains all annotations that where found processing the IDL file. + private HashMap m_annotations = null; + + private ArrayList m_includePaths = null; + //! Set that contains the library dependencies that were found because there was a line of the preprocessor. + private LinkedHashSet m_dependencies = null; + + //! Set that contains the direct include dependencies in the IDL file. Used to regenerate the IDL in a supported form. + private HashSet m_directIncludeDependencies = null; + + // TODO Quitar porque solo es para tipos RTI (usado para las excepciones). Mirar alternativa. + //! Set that contains the include dependencies that force to include our type generated file (right now only with exceptions in RTI DDS types). + private HashSet m_includedependency = null; + + // TODO Lleva la cuenta del nombre de variables para bucles anidados. + private char m_loopVarName = 'a'; + + private Stack> m_scopeFilesStack; +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGenerator.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGenerator.java new file mode 100644 index 00000000..3626b618 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGenerator.java @@ -0,0 +1,214 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import java.awt.FileDialog; +import java.awt.Frame; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; + +import org.anarres.cpp.CppReader; +import org.anarres.cpp.Feature; +import org.antlr.v4.runtime.ANTLRInputStream; +import org.antlr.v4.runtime.CommonTokenStream; + +import com.eprosima.idl.generator.manager.TemplateGroup; +import com.eprosima.idl.generator.manager.TemplateManager; +import com.eprosima.idl.parser.grammar.IDLLexer; +import com.eprosima.idl.parser.grammar.IDLParser; +import com.eprosima.idl.parser.tree.AnnotationDeclaration; +import com.eprosima.idl.parser.tree.AnnotationMember; +import com.eprosima.idl.parser.typecode.PrimitiveTypeCode; +import com.eprosima.idl.parser.typecode.TypeCode; +import com.eprosima.idl.util.Util; + +/** + * The IDL file parser and code generator. + * + * Includes are resolved against the path of the source .idl and the current directory. + * + * @author Jesper Smith + * + */ +public class IDLGenerator +{ + + public static void main(String[] args) throws IOException + { + ArrayList defaultIncludePath = new ArrayList<>(); + defaultIncludePath.add(new File(".")); + + if (args.length == 3) + { + execute(new File(args[0]), args[1], new File(args[2]), defaultIncludePath); + } + else + { + FileDialog dialog = new FileDialog((Frame) null, "Select idl file", FileDialog.LOAD); + dialog.setFile("*.idl"); + dialog.setVisible(true); + if (dialog.getFile() == null) + { + dialog.dispose(); + return; + } + File file = new File(dialog.getDirectory(), dialog.getFile()); + + String res = JOptionPane.showInputDialog("Desired package path"); + + if (res == null) + { + JOptionPane.showMessageDialog(null, "No package path given"); + dialog.dispose(); + return; + } + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + fileChooser.setCurrentDirectory(new File(".")); + if (!(fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)) + { + dialog.dispose(); + return; + } + + execute(file, res, fileChooser.getSelectedFile(), defaultIncludePath); + dialog.dispose(); + } + } + + private static Reader createPreProcessedInputStream(File idlFile, List includePathIn) throws IOException + { + + PreprocessorFilter preprocessor = new PreprocessorFilter(); + preprocessor.addFeature(Feature.KEEPALLCOMMENTS); + preprocessor.addFeature(Feature.KEEPCOMMENTS); + preprocessor.addFeature(Feature.LINEMARKERS); + preprocessor.addFeature(Feature.INCLUDENEXT); + + ArrayList includePath = new ArrayList<>(); + includePath.add(idlFile.getParent()); + for(File include : includePathIn) + { + includePath.add(include.getAbsolutePath()); + } + + preprocessor.setSystemIncludePath(includePath); + preprocessor.setQuoteIncludePath(includePath); + + preprocessor.addInput(idlFile); + + + CppReader reader = new CppReader(preprocessor); + return new BufferedReader(reader); + + } + + /** + * Generate java classes from an IDL file + * + * @param idlFilename IDL file to parse + * @param packageName Target package (IDL Module gets added to this) + * @param targetDirectory Directory to save the generated files in. The whole package structure is generated in this directory + * + * @throws IOException + */ + public static void execute(File idlFile, String packageName, File targetDirectory, List includePath) throws IOException + { + String idlFilename = idlFile.getAbsolutePath(); + + Field field; + try + { + field = TemplateManager.class.getDeclaredField("m_loaderDirectories"); + field.setAccessible(true); + field.set(null, "us/ihmc/idl/templates"); + } + catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) + { + throw new RuntimeException("API changed, fixme", e); + } + + String onlyFileName = Util.getIDLFileNameOnly(idlFilename); + + MyContext ctx = new MyContext(onlyFileName, idlFilename, new ArrayList<>()); + ctx.setPackage(packageName); + TypeCode.javapackage = ctx.isIsPackageEmpty() ? "" : (ctx.getPackage() + "."); + + // Create default @Key annotation. + AnnotationDeclaration keyann = ctx.createAnnotationDeclaration("Key", null); + keyann.addMember(new AnnotationMember("value", new PrimitiveTypeCode(TypeCode.KIND_BOOLEAN), "true")); + + // Create default @Topic annotation. + AnnotationDeclaration topicann = ctx.createAnnotationDeclaration("Topic", null); + topicann.addMember(new AnnotationMember("value", new PrimitiveTypeCode(TypeCode.KIND_BOOLEAN), "true")); + + + AnnotationDeclaration abstractann = ctx.createAnnotationDeclaration("Abstract", null); + abstractann.addMember(new AnnotationMember("type", new PrimitiveTypeCode(TypeCode.KIND_STRING), "java.lang.Object")); + abstractann.addMember(new AnnotationMember("impl", new PrimitiveTypeCode(TypeCode.KIND_STRING), "")); + + AnnotationDeclaration typecode = ctx.createAnnotationDeclaration("TypeCode", null); + typecode.addMember(new AnnotationMember("type", new PrimitiveTypeCode(TypeCode.KIND_BOOLEAN), "INVALID_TYPE_CODE")); + + // Create template manager + TemplateManager tmanager = new TemplateManager("FastCdrCommon:Common"); + + // Create main template + TemplateGroup maintemplates = tmanager.createTemplateGroup("main"); + maintemplates.setAttribute("ctx", ctx); + + if(idlFile.exists()) + { + Reader reader = createPreProcessedInputStream(idlFile, includePath); + ANTLRInputStream input = new ANTLRInputStream(reader); + IDLLexer lexer = new IDLLexer(input); + lexer.setContext(ctx); + CommonTokenStream tokens = new CommonTokenStream(lexer); + IDLParser parser = new IDLParser(tokens); + // Pass the filename without the extension + + parser.specification(ctx, tmanager, maintemplates); + + File packageDir = new File(targetDirectory, ctx.getPackageDir()); + if (packageDir.isDirectory() || packageDir.mkdirs()) + { + TypesGenerator gen = new TypesGenerator(tmanager, true); + if(!gen.generate(ctx, packageDir.getPath() + "/", ctx.getPackage(), null)) + { + throw new IOException("Cannot create Java files"); + } + } + else + { + throw new IOException("Cannot create output dir " + packageDir); + } + } + else + { + throw new IOException("The File " + idlFilename + " was not found."); + } + + } + +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGeneratorTask.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGeneratorTask.java new file mode 100644 index 00000000..63efed86 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/IDLGeneratorTask.java @@ -0,0 +1,101 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; + +import org.gradle.api.DefaultTask; +import org.gradle.api.file.FileCollection; +import org.gradle.api.tasks.TaskAction; + +public class IDLGeneratorTask extends DefaultTask +{ + /** + * [Required] Collection of IDL files to compile + */ + public FileCollection idlFiles; + + /** + * [Optional] Include directories used to resolve includes in IDL files + */ + public FileCollection includeDirs; + + /** + * [Optional] Prefix to the package path + */ + public String packagePrefix = ""; + + /** + * [Required] output directory + */ + public File targetDirectory; + + @TaskAction + public void compile() throws IOException + { + if (idlFiles == null) + { + throw new IOException("No IDL files to compile."); + } + + ArrayList idlList = new ArrayList<>(); + for (File idl : idlFiles) + { + if (!idl.exists()) + { + throw new IOException("Cannot find " + idl); + } + idlList.add(idl); + } + + ArrayList includeList = new ArrayList<>(); + if (includeDirs != null) + { + for (File include : includeDirs) + { + includeList.add(include); + } + } + + String packagePrefix = this.packagePrefix; + if (packagePrefix == null) + { + packagePrefix = ""; + } + + if (targetDirectory == null) + { + throw new IOException("Target directory not set."); + } + + if (!targetDirectory.exists()) + { + throw new IOException("Target directory " + targetDirectory + " does not exist."); + } + if (!targetDirectory.isDirectory()) + { + throw new IOException("Target directory " + targetDirectory + " is not a directory."); + } + + for (File idl : idlList) + { + IDLGenerator.execute(idl, packagePrefix, targetDirectory, includeList); + } + + } +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/MyContext.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/MyContext.java new file mode 100644 index 00000000..468511b4 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/MyContext.java @@ -0,0 +1,121 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import java.util.ArrayList; + +/** + * Internal class for the code generator + * + * @author Jesper Smith + * + */ +public class MyContext extends Context +{ + private String m_package = ""; + private String m_onlypackage = ""; + private String m_packageDir = ""; + + private String m_file; + + MyContext(String onlyFileName, String idlFilename, ArrayList arg2) + { + super(onlyFileName, idlFilename, arg2); + this.m_file = idlFilename; + + createAnnotationDeclaration("startInclude", null); + createAnnotationDeclaration("endInclude", null); + + } + + + public void setPackage(String pack) + { + if(pack != null && !pack.isEmpty()) + { + m_package = pack; + m_onlypackage = pack; + m_packageDir = m_package.replace('.', '/'); + } + } + + public String getIDLFileName() + { + return m_file; + } + + public boolean isIsPackageEmpty() + { + return m_package.isEmpty(); + } + + public String getPackage() + { + return m_package; + } + + public String getOnlyPackage() + { + return m_onlypackage; + } + + public String getPackageDir() + { + return m_packageDir; + } + + public String getPackageUnder() + { + return m_package.replace('.', '_'); + } + + @Override + public StructTypeCode createStructTypeCode(String name) + { + return new StructTypeCode(getScope(), name); + } + + public boolean isPrintexception() + { + return false; + } + + public boolean isPrintoperation() + { + return false; + } + + public String getProduct() + { + return "IHMC IDL Generator"; + } + + public String getNamespace() + { + return "fastcdr"; + } + + public boolean isCdr() + { + return true; + } + + public boolean isFastcdr() + { + return false; + } + +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/PreprocessorFilter.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/PreprocessorFilter.java new file mode 100644 index 00000000..e9572e54 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/PreprocessorFilter.java @@ -0,0 +1,45 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package us.ihmc.idl.generator; + +import java.io.IOException; + +import org.anarres.cpp.LexerException; +import org.anarres.cpp.Preprocessor; +import org.anarres.cpp.Token; + +/** + * Helper class the replace tokens to the format IDLParser expects. + * + * Replaces #line with #. + * + * @author Jesper Smith + * + */ +public class PreprocessorFilter extends Preprocessor +{ + @Override + public Token token() throws IOException, LexerException + { + Token next = super.token(); + if(next != null && next.getType() == Token.P_LINE) + { + next = new Token(Token.P_LINE, next.getLine(), next.getColumn(), next.getText().replaceFirst("#line", "#")); + } + + return next; + } +} diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/StructTypeCode.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/StructTypeCode.java new file mode 100644 index 00000000..6d7b749b --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/StructTypeCode.java @@ -0,0 +1,101 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package us.ihmc.idl.generator; + +import com.eprosima.idl.parser.typecode.Member; + +import org.antlr.stringtemplate.StringTemplate; + +import com.eprosima.idl.parser.tree.Annotation; + +/** + * + * Internal class for the code generator + * + * @author Jesper Smith + * + */ +class StructTypeCode extends com.eprosima.idl.parser.typecode.StructTypeCode +{ + public StructTypeCode(String scope, String name) + { + super(scope, name); + } + + public boolean isHasKey() + { + boolean returnedValue = false; + + for(int count = 0; count < getMembers().size() && !returnedValue; ++count) + { + Member member = getMembers().get(count); + Annotation key = member.getAnnotations().get("Key"); + + if(key != null) + { + String value = key.getValue("value"); + + if(value != null && value.equals("true")) + returnedValue = true; + } + } + + return returnedValue; + } + + public String getAbstractimpl() + { + return null; + } + + public boolean isAbstract() + { + return false; + } + + public void setIsTopic(boolean value) + { + istopic_ = value; + } + + public boolean isIsTopic() + { + return istopic_; + } + + public String getPubsubTypename() + { + StringTemplate st = getJavaTypenameFromStringTemplate(); + st.setAttribute("name", getJavaScopedname() + "PubSubType"); + return st.toString(); + } + + private boolean istopic_ = true; +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/TypesGenerator.java b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/TypesGenerator.java new file mode 100644 index 00000000..fbceb30d --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/java/us/ihmc/idl/generator/TypesGenerator.java @@ -0,0 +1,449 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package us.ihmc.idl.generator; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import org.antlr.stringtemplate.StringTemplate; +import org.antlr.stringtemplate.StringTemplateGroup; + +import com.eprosima.idl.generator.manager.TemplateManager; +import com.eprosima.idl.parser.tree.Definition; +import com.eprosima.idl.parser.tree.Export; +import com.eprosima.idl.parser.tree.Interface; +import com.eprosima.idl.parser.tree.Module; +import com.eprosima.idl.parser.tree.TypeDeclaration; +import com.eprosima.idl.parser.typecode.ContainerTypeCode; +import com.eprosima.idl.parser.typecode.EnumTypeCode; +import com.eprosima.idl.parser.typecode.Member; +import com.eprosima.idl.parser.typecode.TypeCode; +import com.eprosima.idl.parser.typecode.UnionTypeCode; +import com.eprosima.log.ColorMessage; + +/** + * Internal class for the code generator + * + * + * @author Jesper Smith + * + */ +class TypesGenerator +{ + + private static final String PUB_SUB_TYPE_NAME = "PubSubType"; + + private final HashMap updatedTypes = new HashMap<>(); + private final ArrayList members = new ArrayList<>(); + + + TypesGenerator(TemplateManager tmanager, boolean replace) + { + tmanager_ = tmanager; + replace_ = replace; + } + + /* + * @brief This function generates data types in Java. It uses a context that + * was processed by the IDL parser. + */ + boolean generate(MyContext context, String packagDir, String packag, Map extensions) + { + ArrayList definitions = context.getDefinitions(); + + processAbstractDefinitions(definitions); + + StringTemplateGroup javaTypeTemplate = tmanager_.createStringTemplateGroup("JavaType"); + boolean returnedValue = processDefinitions(javaTypeTemplate, context, definitions, packagDir, packag, "", extensions); + if (returnedValue) + { + StringTemplateGroup javaPubSubTypeTemplate = tmanager_.createStringTemplateGroup("JavaPubSubType"); + returnedValue = processDefinitions(javaPubSubTypeTemplate, context, definitions, packagDir, packag, PUB_SUB_TYPE_NAME, extensions); + } + + return returnedValue; + } + + private void processAbstractDefinitions(ArrayList definitions) + { + if (definitions != null) + { + for (int i = 0 ; i < definitions.size(); i++) + { + Definition definition = definitions.get(i); + + if (definition.isIsModule()) + { + Module module = (Module) definition; + processAbstractDefinitions(module.getDefinitions()); + } + else if (definition.isIsTypeDeclaration()) + { + TypeDeclaration typedecl = (TypeDeclaration) definition; + if(typedecl.getTypeCode().getKind() == TypeCode.KIND_STRUCT) + { + boolean abstractAnnotation = typedecl.getAnnotations().containsKey("Abstract"); + if(abstractAnnotation) + { + AbstractTypeDeclaration newDeclaration = new AbstractTypeDeclaration(typedecl); + definitions.set(i, newDeclaration); + updatedTypes.put(typedecl.getTypeCode(), (AbstractStructTypeCode) newDeclaration.getTypeCode()); + } + members.addAll(((StructTypeCode) typedecl.getTypeCode()).getMembers()); + } + + + } + } + + for(Member member: members) + { + if(updatedTypes.containsKey(member.getTypecode())) + { + member.setTypecode(updatedTypes.get(member.getTypecode())); + } + else if (member.getTypecode().getKind() == TypeCode.KIND_SEQUENCE || member.getTypecode().getKind() == TypeCode.KIND_ARRAY) + { + ContainerTypeCode containerTypeCode = (ContainerTypeCode) member.getTypecode(); + if(containerTypeCode.getContentTypeCode().getKind() == TypeCode.KIND_STRUCT) + { + for(AbstractStructTypeCode entry : updatedTypes.values()) + { + if(entry.getIdlTypename().equals(containerTypeCode.getContentTypeCode().getIdlTypename())) + { + containerTypeCode.setContentTypeCode(entry); + break; + } + } + + } + } + } + } + } + + private boolean isInScope(MyContext context, String filename) + { + Path input = Paths.get(context.getIDLFileName()); + Path current = Paths.get(filename); + try + { + return Files.isSameFile(input, current); + } + catch (IOException e) + { + e.printStackTrace(); + return false; // Probably not the same file; + } + } + + private boolean processDefinitions(StringTemplateGroup stg_, MyContext context, ArrayList definitions, String packagDir, String packag, + String moduleNamePostfix, Map extensions) + { + if (definitions != null) + { + + + for (Definition definition : definitions) + { + if (definition.isIsModule()) + { + Module module = (Module) definition; + if (isInScope(context, module.getScopeFile())) + { + // Create directory for module. + String outputDir = packagDir + module.getName(); + File dir = new File(outputDir); + + if (!dir.exists()) + { + if (!dir.mkdir()) + { + System.out.println(ColorMessage.error() + "Cannot create directory for module " + module.getName()); + return false; + } + } + + String packageName = packag.isEmpty() ? "" : (packag + "."); + if (!processDefinitions(stg_, context, module.getDefinitions(), outputDir + File.separator, packageName + module.getName(), + moduleNamePostfix, extensions)) + return false; + } + } + else if (definition.isIsInterface()) + { + Interface ifc = (Interface) definition; + if (isInScope(context, ifc.getScopeFile())) + { + // Create StringTemplate of the interface + StringTemplate ifcst = stg_.getInstanceOf("interface"); + ifcst.setAttribute("ctx", context); + ifcst.setAttribute("parent", ifc.getParent()); + ifcst.setAttribute("interface", ifc); + + StringTemplate extensionst = null; + String extensionname = null; + if (extensions != null && (extensionname = extensions.get("interface")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("ctx", context); + extensionst.setAttribute("parent", ifc.getParent()); + extensionst.setAttribute("interface", ifc); + ifcst.setAttribute("extension", extensionst.toString()); + } + + if (processExports(stg_, context, ifc.getExports(), ifcst, extensions)) + { + // Save file. + StringTemplate st = stg_.getInstanceOf("main"); + st.setAttribute("ctx", context); + st.setAttribute("definitions", ifcst.toString()); + st.setAttribute("package", (!packag.isEmpty() ? packag : null)); + + if (extensions != null && (extensionname = extensions.get("main")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("ctx", context); + st.setAttribute("extension", extensionst.toString()); + } + + if (!writeFile(packagDir + ifc.getName() + moduleNamePostfix + ".java", st)) + { + System.out.println(ColorMessage.error() + "Cannot write file " + packagDir + ifc.getName() + ".java"); + return false; + } + } + else + return false; + } + } + else if (definition.isIsTypeDeclaration()) + { + TypeDeclaration typedecl = (TypeDeclaration) definition; + if (isInScope(context, typedecl.getScopeFile())) + { + + boolean abstractAnnotation = typedecl.getAnnotations().containsKey("Abstract"); + boolean notEnumPubSubType = !moduleNamePostfix.equals(PUB_SUB_TYPE_NAME) || typedecl.getTypeCode().getKind() != TypeCode.KIND_ENUM; + boolean notAbstractDefinition = moduleNamePostfix.equals(PUB_SUB_TYPE_NAME) || !abstractAnnotation; + + + if(notEnumPubSubType && notAbstractDefinition) + { + // get StringTemplate of the structure + StringTemplate typest = processTypeDeclaration(stg_, context, typedecl, extensions); + + if (typest != null) + { + // Save file. + StringTemplate st = stg_.getInstanceOf("main"); + st.setAttribute("ctx", context); + st.setAttribute("definitions", typest.toString()); + st.setAttribute("package", (!packag.isEmpty() ? packag : null)); + + StringTemplate extensionst = null; + String extensionname = null; + if (extensions != null && (extensionname = extensions.get("main")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("ctx", context); + st.setAttribute("extension", extensionst.toString()); + } + + if (!writeFile(packagDir + typedecl.getName() + moduleNamePostfix + ".java", st)) + { + System.out.println(ColorMessage.error() + "Cannot write file " + packagDir + typedecl.getName() + ".java"); + return false; + } + } + } + } + } + } + } + + return true; + } + + boolean processExports(StringTemplateGroup stg_, MyContext context, ArrayList exports, StringTemplate ifcst, Map extensions) + { + for (Export export : exports) + { + if (export.isIsTypeDeclaration()) + { + TypeDeclaration typedecl = (TypeDeclaration) export; + + // get StringTemplate of the structure + StringTemplate typest = processTypeDeclaration(stg_, context, typedecl, extensions); + + if (typest != null) + { + // Add type stringtemplate to interface stringtemplate. + ifcst.setAttribute("exports", typest.toString()); + } + } + } + + return true; + } + + StringTemplate processTypeDeclaration(StringTemplateGroup stg_, MyContext context, TypeDeclaration typedecl, Map extensions) + { + StringTemplate typest = null, extensionst = null; + String extensionname = null; + + if (typedecl.getTypeCode().getKind() == TypeCode.KIND_STRUCT) + { + typest = stg_.getInstanceOf("struct_type"); + typest.setAttribute("struct", typedecl.getTypeCode()); + if(typedecl.getAnnotations().containsKey("TypeCode")) + { + typest.setAttribute("typecode", getTypeCodeAnnotation(typedecl)); + } + else + { + typest.setAttribute("typecode", ((StructTypeCode) typedecl.getTypeCode()).getScopedname()); + } + // Get extension + if (extensions != null && (extensionname = extensions.get("struct_type")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("struct", typedecl.getTypeCode()); + } + } + else if (typedecl.getTypeCode().getKind() == TypeCode.KIND_UNION) + { + typest = stg_.getInstanceOf("union_type"); + typest.setAttribute("union", typedecl.getTypeCode()); + + if(typedecl.getAnnotations().containsKey("TypeCode")) + { + typest.setAttribute("typecode", getTypeCodeAnnotation(typedecl)); + } + else + { + typest.setAttribute("typecode", ((UnionTypeCode) typedecl.getTypeCode()).getScopedname()); + } + + // Get extension + if (extensions != null && (extensionname = extensions.get("union_type")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("union", typedecl.getTypeCode()); + } + } + else if (typedecl.getTypeCode().getKind() == TypeCode.KIND_ENUM) + { + typest = stg_.getInstanceOf("enum_type"); + typest.setAttribute("enum", typedecl.getTypeCode()); + + if(typedecl.getAnnotations().containsKey("TypeCode")) + { + typest.setAttribute("typecode", getTypeCodeAnnotation(typedecl)); + } + else + { + typest.setAttribute("typecode", ((EnumTypeCode) typedecl.getTypeCode()).getScopedname()); + } + + // Get extension + if (extensions != null && (extensionname = extensions.get("enum_type")) != null) + { + extensionst = stg_.getInstanceOf(extensionname); + extensionst.setAttribute("enum", typedecl.getTypeCode()); + } + } + + if (typest != null) + { + // Generate extension + if (extensionst != null) + { + extensionst.setAttribute("ctx", context); + extensionst.setAttribute("parent", typedecl.getParent()); + typest.setAttribute("extension", extensionst.toString()); + } + + // Main stringtemplate + typest.setAttribute("ctx", context); + typest.setAttribute("parent", typedecl.getParent()); + } + + return typest; + } + + private String getTypeCodeAnnotation(TypeDeclaration typedecl) + { + String raw = typedecl.getAnnotations().get("TypeCode").getValue("type"); + return raw.substring(1, raw.length() - 1); + } + + private boolean writeFile(String file, StringTemplate template) + { + boolean returnedValue = false; + + try + { + File handle = new File(file); + + if (!handle.exists() || replace_) + { + FileWriter fw = new FileWriter(file); + String data = template.toString(); + + data = data.replaceAll("\r\n", "\n"); + fw.write(data, 0, data.length()); + fw.close(); + } + else + { + System.out.println("INFO: " + file + " exists. Skipping."); + } + + returnedValue = true; + } + catch (IOException e) + { + e.printStackTrace(); + } + + return returnedValue; + } + + private TemplateManager tmanager_ = null; + private boolean replace_ = false; +} diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Common.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Common.stg new file mode 100644 index 00000000..a78a49df --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Common.stg @@ -0,0 +1,27 @@ +group Common; + +fileHeader() ::= << +>> + + +classdescription(type, name, filename) ::= << +/** +* +* Definition of the $type$ "$name$" defined in $filename$. +* +* This file was automatically generated from $filename$ by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit $filename$ instead. +* +*/ +>> + +javadocpubsub(type, name, filename) ::= << +/** +* +* Topic data type of the $type$ "$name$" defined in "$filename$". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from $filename$ by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit $filename$ instead. +* +*/ +>> \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/FastCdrCommon.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/FastCdrCommon.stg new file mode 100644 index 00000000..14f2149d --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/FastCdrCommon.stg @@ -0,0 +1,316 @@ +group FastCdrCommon; + +paramRetType(typecode) ::= << +$if(typecode)$ +$typecode.javaTypename$ +$else$ +void +$endif$ +>> + +paramTypeByValue(typecode) ::= << +$if(typecode.primitive)$ +$typecode.pubsubTypename$ +$else$ +const $typecode.javaTypename$& +$endif$ +>> + +paramTypeByRef(typecode) ::= << +$typecode.javaTypename$& +>> + +paramDeclarations(params, separatorInicial) ::= << +$if(params)$$separatorInicial$$endif$$params : {param | /*$param.comment$*/ $if(param.output)$$paramTypeByRef(typecode=param.typecode)$$else$$paramTypeByValue(typecode=param.typecode)$$endif$ $param.name$}; separator=", "$ +>> + +paramDeclarationsByValue(params, separatorInicial) ::= << +$if(params)$$separatorInicial$$endif$$params : {param | /*$param.comment$*/ $paramTypeByValue(typecode=param.typecode)$ $param.name$}; separator=", "$ +>> + +object_serialization(ctx, object, arg, element) ::= << + +$if(object.typecode.maxsize)$ +if($element$get$object.javaName$($arg$).$sizeFunction.(object.typecode.stType)$ <= $object.typecode.maxsize$) + +$endif$ +$if(object.typecode.isType_c)$cdr.write_$object.typecode.stType$($element$get$object.javaName$($arg$).ordinal()); +$elseif(object.typecode.isType_f)$$array_serialize(ctx=ctx, typecodeArr=object.typecode, data=[element, "get", object.javaName, "(", arg, ")"], loopvar=ctx.newLoopVarName, dimensions=object.typecode.dimensions)$ +$elseif(object.typecode.isType_a)$$object.typecode.pubsubTypename$.write($element$get$object.javaName$($arg$), cdr); +$else$cdr.write_$object.typecode.stType$($element$get$object.javaName$($arg$)); +$endif$ +$if(object.typecode.maxsize)$ +else + throw new RuntimeException("$object.name$ field exceeds the maximum length"); +$endif$ +>> + +array_init(ctx, typecodeArr, data, loopvar, elemInit, dimensions) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_init(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], elemInit=elemInit, loopvar=ctx.nextLoopVarName, dimensions=rest(dimensions))$ +} +$else$ + $data$ = $elemInit$; +$endif$ +>> + +array_copy(ctx, typecodeArr, data, loopvar, other, dimensions) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_copy(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], other=[other, "[", loopvar, "]"], loopvar=ctx.nextLoopVarName, dimensions=rest(dimensions))$ +} +$else$ + $if(typecodeArr.contentTypeCode.primitive)$ + $data$ = $other$; + $elseif(typecodeArr.contentTypeCode.isType_d)$ + $data$.setLength(0); + $data$.append($other$); + $elseif(typecodeArr.contentTypeCode.isType_a)$ + $typecodeArr.contentTypeCode.pubsubTypename$.staticCopy($other$, $data$); + $else$ + $other$.set($data$); + $endif$ +$endif$ +>> + +array_equals(ctx, typecodeArr, data, loopvar, other, dimensions) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_equals(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], loopvar=ctx.nextLoopVarName, other=[other, "[", loopvar, "]"], dimensions=rest(dimensions))$ +} +$else$ + $if(typecodeArr.contentTypeCode.primitive)$ + if(this.$data$ != $other$) return false; + $elseif(typecodeArr.contentTypeCode.isType_d)$ + if (!us.ihmc.idl.IDLTools.equals(this.$data$, $other$)) return false; + $else$ + if (!this.$data$.equals($other$)) return false; + $endif$ +$endif$ +>> + +array_epsilon_equals(ctx, typecodeArr, data, loopvar, other, dimensions, epsilon) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_epsilon_equals(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], loopvar=ctx.nextLoopVarName, other=[other, "[", loopvar, "]"], dimensions=rest(dimensions), epsilon=epsilon)$ +} +$else$ + $if(typecodeArr.contentTypeCode.isType_7)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsBoolean(this.$data$, $other$, epsilon)) return false; + $elseif(typecodeArr.contentTypeCode.primitive)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsPrimitive(this.$data$, $other$, epsilon)) return false; + $elseif(typecodeArr.contentTypeCode.isType_d)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsStringBuilder(this.$data$, $other$, epsilon)) return false; + $else$ + if (!this.$data$.epsilonEquals($other$, epsilon)) return false; + $endif$ +$endif$ +>> + + +array_serialize(ctx, typecodeArr, data, loopvar, dimensions) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_serialize(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], loopvar=ctx.nextLoopVarName, dimensions=rest(dimensions))$ +} +$else$ +$if(typecodeArr.contentTypeCode.isType_c)$ + cdr.write_$typecodeArr.contentTypeCode.stType$($data$.ordinal()) +$elseif(typecodeArr.contentTypeCode.isType_a)$ + $typecodeArr.contentTypeCode.pubsubTypename$.write($data$, cdr); +$else$ + cdr.write_$typecodeArr.contentTypeCode.stType$($data$); +$endif$ +$endif$ +>> + +object_deserialization(ctx, object, arg, argsep, element) ::= << + +$if(object.typecode.isType_c)$ + $element$set$object.javaName$($arg$$argsep$$object.typecode.javaTypename$.values[cdr.read_$object.typecode.stType$()]); +$elseif(object.typecode.isType_f)$ + $array_deserialize(ctx=ctx, typecodeArr=object.typecode, data=[element, "get", object.javaName, "(", arg, ")"], loopvar=ctx.newLoopVarName, dimensions=object.typecode.dimensions)$ +$elseif(object.typecode.primitive)$ + $element$set$object.javaName$($arg$$argsep$cdr.read_$object.typecode.stType$()); +$elseif(object.typecode.isType_a)$ + $object.typecode.pubsubTypename$.read($element$get$object.javaName$($arg$), cdr); +$else$ + cdr.read_$object.typecode.stType$($element$get$object.javaName$($arg$)); +$endif$ +>> + +array_deserialize(ctx, typecodeArr, data, loopvar, dimensions) ::= << +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_deserialize(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], loopvar=ctx.nextLoopVarName, dimensions=rest(dimensions))$ +} +$else$ +$if(typecodeArr.contentTypeCode.isType_c)$ + $data$ = $typecodeArr.contentTypeCode.javaTypename$.values[cdr.read_$typecodeArr.contentTypeCode.stType$()]; +$elseif(typecodeArr.contentTypeCode.primitive)$ + $data$ = cdr.read_$typecodeArr.contentTypeCode.stType$(); +$elseif(typecodeArr.contentTypeCode.isType_a)$ + $typecodeArr.contentTypeCode.pubsubTypename$.read($data$, cdr); +$else$ + cdr.read_$typecodeArr.contentTypeCode.stType$($data$); +$endif$ +$endif$ +>> + + + +// TODO Todos los tipos. MEJORAR. size of 1 no deberia generar alignment. +max_serialized_size(ctx, typecode, var) ::= << +$if(typecode.primitive)$ +$var$ += $typecode.size$$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecode.size$)$endif$; +$elseif(typecode.isType_d)$ +$var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $typecode.maxsize$ + 1; +$elseif(typecode.isType_e)$ +$var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; +$sequence_max_serialized_size(ctx=ctx, typecodeSeq=typecode, var=var, loopvar=ctx.newLoopVarName)$ +$elseif(typecode.isType_f)$ +$array_max_serialized_size(ctx=ctx, typecodeArr=typecode, var=var, loopvar=ctx.newLoopVarName)$ +$else$ +$var$ += $typecode.pubsubTypename$.getMaxCdrSerializedSize($var$); +$endif$ +>> + +serialized_size_type(ctx, typecode, var) ::= << +$if(typecode.primitive)$ +$var$ += $typecode.size$$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecode.size$)$endif$; +$endif$ +>> + +serialized_size(ctx, object, data, var) ::= << +$if(object.typecode.primitive)$ +$var$ += $object.typecode.size$$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $object.typecode.size$)$endif$; +$elseif(object.typecode.isType_d)$ +$var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $data$.length() + 1; +$elseif(object.typecode.isType_e)$ +$var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; +$sequence_serialized_size(ctx=ctx, typecodeSeq=object.typecode, data=data, var=var, loopvar=ctx.newLoopVarName)$ +$elseif(object.typecode.isType_f)$ +$array_serialized_size(ctx=ctx, typecodeArr=object.typecode, data=data, var=var, loopvar=ctx.newLoopVarName, dimensions=object.typecode.dimensions)$ +$else$ +$var$ += $object.typecode.pubsubTypename$.getCdrSerializedSize($data$, $var$); +$endif$ +>> + +sequence_max_serialized_size(ctx, typecodeSeq, var, loopvar) ::= << +$if(typecodeSeq.contentTypeCode.primitive)$ +$var$ += ($typecodeSeq.maxsize$ * $typecodeSeq.contentTypeCode.size$)$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecodeSeq.contentTypeCode.size$)$endif$; +$elseif(typecodeSeq.contentTypeCode.isType_d)$ +for(int $loopvar$ = 0; $loopvar$ < $typecodeSeq.maxsize$; ++$loopvar$) +{ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $typecodeSeq.contentTypeCode.maxsize$ + 1; +} +$else$ +for(int $loopvar$ = 0; $loopvar$ < $typecodeSeq.maxsize$; ++$loopvar$) +{ +$if(typecodeSeq.contentTypeCode.isType_e)$ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; + $sequence_max_serialized_size(ctx=ctx, typecodeSeq=typecodeSeq.contentTypeCode, var=var, loopvar=ctx.nextLoopVarName)$ +$elseif(typecodeSeq.contentTypeCode.isType_f)$ +$array_max_serialized_size(ctx=ctx, typecodeArr=typecodeSeq.contentTypeCode, var=var, loopvar=ctx.nextLoopVarName)$ +$else$ + $var$ += $typecodeSeq.contentTypeCode.pubsubTypename$.getMaxCdrSerializedSize($var$); +$endif$ +} +$endif$ +>> + +sequence_serialized_size(ctx, typecodeSeq, data, var, loopvar) ::= << +$if(typecodeSeq.contentTypeCode.primitive)$ +$var$ += ($data$.size() * $typecodeSeq.contentTypeCode.size$)$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecodeSeq.contentTypeCode.size$)$endif$; +$elseif(typecodeSeq.contentTypeCode.isType_d)$ +for(int $loopvar$ = 0; $loopvar$ < $data$.size(); ++$loopvar$) +{ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $data$.get($loopvar$).length() + 1; +} +$else$ +for(int $loopvar$ = 0; $loopvar$ < $data$.size(); ++$loopvar$) +{ +$if(typecodeSeq.contentTypeCode.isType_e)$ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; + $sequence_serialized_size(ctx=ctx, typecodeSeq=typecodeSeq.contentTypeCode, data=[data, ".at(", loopvar, ")"], var=var, loopvar=ctx.nextLoopVarName)$ +$elseif(typecodeSeq.contentTypeCode.isType_f)$ +$array_serialized_size(ctx=ctx, typecodeArr=typecodeSeq.contentTypeCode, data=[data, ".at(", loopvar, ")"], var=var, loopvar=ctx.nextLoopVarName, dimensions=typecodeSeq.contentTypeCode.dimensions)$ +$else$ + $var$ += $typecodeSeq.contentTypeCode.pubsubTypename$.getCdrSerializedSize($data$.get($loopvar$), $var$); +$endif$ +} +$endif$ +>> + +array_max_serialized_size(ctx, typecodeArr, var, loopvar) ::= << +$if(typecodeArr.contentTypeCode.primitive)$ +$var$ += ($typecodeArr.size$ * $typecodeArr.contentTypeCode.size$)$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecodeArr.contentTypeCode.size$)$endif$; +$elseif(typecodeArr.contentTypeCode.isType_d)$ +for(int $loopvar$ = 0; $loopvar$ < $typecodeArr.size$; ++$loopvar$) +{ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $typecodeArr.contentTypeCode.maxsize$ + 1; +} +$else$ +for(int $loopvar$ = 0; $loopvar$ < $typecodeArr.size$; ++$loopvar$) +{ +$if(typecodeArr.contentTypeCode.isType_e)$ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; + $sequence_max_serialized_size(ctx=ctx, typecodeArr=typecodeArr.contentTypeCode, var=var, loopvar=ctx.nextLoopVarName)$ +$elseif(typecodeArr.contentTypeCode.isType_f)$ +$array_max_serialized_size(ctx=ctx, typecodeArr=typecodeArr.contentTypeCode, var=var, loopvar=ctx.nextLoopVarName)$ +$else$ + $var$ += $typecodeArr.contentTypeCode.pubsubTypename$.getMaxCdrSerializedSize($var$); +$endif$ +} +$endif$ +>> + +array_serialized_size(ctx, typecodeArr, data, var, loopvar, dimensions) ::= << +$if(typecodeArr.contentTypeCode.primitive)$ +$var$ += ($typecodeArr.size$ * $typecodeArr.contentTypeCode.size$)$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, $typecodeArr.contentTypeCode.size$)$endif$; +$else$ +$if(first(dimensions))$ +for(int $loopvar$ = 0; $loopvar$ < $data$.length; ++$loopvar$) +{ + $array_serialized_size(ctx=ctx, typecodeArr=typecodeArr, data=[data, "[", loopvar, "]"], var=var, loopvar=ctx.nextLoopVarName, dimensions=rest(dimensions))$ +} +$else$ +$if(typecodeArr.contentTypeCode.isType_d)$ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$ + $data$.length() + 1; +$elseif(typecodeArr.contentTypeCode.isType_e)$ + $var$ += 4$if(ctx.cdr)$ + us.ihmc.idl.CDR.alignment($var$, 4)$endif$; + $sequence_serialized_size(ctx=ctx, typecodeArr=typecodeArr.contentTypeCode, data=[data, "[", loopvar, "]"], var=var, loopvar=ctx.nextLoopVarName)$ +$elseif(typecodeArr.contentTypeCode.isType_f)$ + $array_serialized_size(ctx=ctx, typecodeArr=typecodeArr.contentTypeCode, data=data, var=var, loopvar=loopvar, dimensions=typecodeArr.contentTypeCode.dimensions)$ +$else$ + $var$ += $typecodeArr.contentTypeCode.pubsubTypename$.getCdrSerializedSize($data$, $var$); +$endif$ +$endif$ +$endif$ +>> + +serializeCasting(typecode) ::= << +$if(typecode.isType_c)$ +(uint32_t) +$endif$ +>> + +deserializeCasting(typecode) ::= << +$if(typecode.isType_c)$ +(uint32_t&) +$endif$ +>> + +sizeFunction ::= [ + "type_e":"size()", + "type_d":"length()", + "type_15":"length()", + default: // not basic type. +] diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaPubSubType.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaPubSubType.stg new file mode 100644 index 00000000..fd006d3d --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaPubSubType.stg @@ -0,0 +1,380 @@ +group JavaType; + +main(ctx, definitions, package) ::= << +$if(package)$ +package $package$; +$endif$ + + +$definitions$ +>> + +interface(ctx, parent, interface, exports, extension) ::= << +$javadocpubsub(type="interface", name=interface.name, filename=[ctx.filename, ".idl"])$ +public class $interface.name$PubSubType +{ + $extension$ + + $exports$ +} +>> + +struct_type(ctx, parent, struct, extension, typecode) ::= << +$javadocpubsub(type="struct", name=struct.name, filename=[ctx.filename, ".idl"])$ +public class $struct.name$PubSubType implements us.ihmc.pubsub.TopicDataType<$struct.javaTypename$> +{ + public static final java.lang.String name = "$typecode$"; + + + + public $struct.name$PubSubType() + { + + } + +$if(struct.abstract)$ + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + + private static Abstract$struct.name$PubSubTypeImplementation impl = $struct.abstractimpl$; + + /** + * Abstract implementation of $struct.name$PubSubType. + * + * Extend this class to create a custom PubSubType for @Abstract idl datatypes. + * + */ + public static abstract class Abstract$struct.name$PubSubTypeImplementation + { + + + /** + * Copy src into dest. + * + * @param src Source object to copy data from + * @param dest Destination object to copy data to + */ + protected abstract void copy($struct.javaTypename$ src, $struct.javaTypename$ dest); + + +$struct.members : { member | + + /** + * Getter for $member.javaName$ + * + * @param data object to read from + * @return value of X + */ + protected abstract $member.typecode.javaTypename$ get$member.javaName$($struct.javaTypename$ data); + $if(!member.typecode.isType_e)$ + $if(member.typecode.primitive)$ + /** + * Setter for $member.javaName$ + * + * @param data object to write to + * @param $member.name$ value + */ + protected abstract void set$member.javaName$($struct.javaTypename$ data, $member.typecode.javaTypename$ $member.name$); + $endif$ + $endif$ + + }; separator="\n"$ + + + public abstract $struct.javaTypename$ createData(); + } + + private static Abstract$struct.name$PubSubTypeImplementation getImpl() + { + if(impl == null) + { + throw new RuntimeException("Abstract pub/sub type implementation not set. Call setImplementation(Abstract$struct.name$PubSubTypeImplementation implementation) before using this type."); + } + return impl; + } + + public static void setImplementation(Abstract$struct.name$PubSubTypeImplementation implementation) + { + $struct.name$PubSubType.impl = implementation; + } + + + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + $struct.members : { member |$max_serialized_size(ctx=ctx, typecode=member.typecode, var="current_alignment")$}; separator="\n"$ + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize($struct.javaTypename$ data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize($struct.javaTypename$ data, int current_alignment) + { + int initial_alignment = current_alignment; + + $struct.members : { member |$serialized_size(ctx=ctx, object=member, data=["getImpl().get", member.javaName, "(data)"], var="current_alignment")$}; separator="\n"$ + + return current_alignment - initial_alignment; + } + + + @Override + public void serialize($struct.javaTypename$ data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + + } + + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, $struct.javaTypename$ data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + + public static void write($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + $struct.members : { member |$object_serialization(ctx=ctx, object=member, arg="data", element="getImpl().")$}; separator="\n"$ + } + + public static void read($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + $struct.members : { member |$object_deserialization(ctx=ctx, object=member, arg="data", argsep=",", element="getImpl().")$}; separator="\n"$ + } + + @Override + public final void serialize($struct.javaTypename$ data, us.ihmc.idl.InterchangeSerializer ser) + { + $struct.members : { member | + $if(member.typecode.isType_a)$ + ser.write_$member.typecode.stType$("$member.name$", new $member.typecode.pubsubTypename$(), getImpl().get$member.javaName$(data)); + $elseif(member.typecode.isType_f)$ + $if(member.typecode.contentTypeCode.isType_a)$ + ser.write_$member.typecode.stType$("$member.name$", new $member.typecode.contentTypeCode.pubsubTypename$(), getImpl().get$member.javaName$(data)); + $else$ + ser.write_$member.typecode.stType$("$member.name$", getImpl().get$member.javaName$(data)); + $endif$ + $else$ + ser.write_$member.typecode.stType$("$member.name$", getImpl().get$member.javaName$(data)); + $endif$ + }; separator="\n"$ + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, $struct.javaTypename$ data) + { + $struct.members : { member | + $if(member.typecode.isType_c)$ + getImpl().set$member.javaName$(data, ($member.typecode.javaTypename$)ser.read_$member.typecode.stType$("$member.name$", $member.typecode.javaTypename$.class)); + $elseif(member.typecode.isType_a)$ + ser.read_type_a("$member.name$", new $member.typecode.pubsubTypename$(), getImpl().get$member.javaName$(data)); + $elseif(member.typecode.isType_f)$ + $if(member.typecode.contentTypeCode.isType_a)$ + ser.read_$member.typecode.stType$("$member.name$", new $member.typecode.contentTypeCode.pubsubTypename$(), getImpl().get$member.javaName$(data)); + $else$ + ser.read_$member.typecode.stType$("$member.name$", getImpl().get$member.javaName$(data)); + $endif$ + $elseif(member.typecode.primitive)$ + getImpl().set$member.javaName$(data, ser.read_$member.typecode.stType$("$member.name$")); + $else$ + ser.read_$member.typecode.stType$("$member.name$", getImpl().get$member.javaName$(data)); + $endif$ + }; separator="\n"$ + } + + + public static void staticCopy($struct.javaTypename$ src, $struct.javaTypename$ dest) + { + getImpl().copy(src, dest); + } + + + @Override + public $struct.javaTypename$ createData() + { + return getImpl().createData(); + } + +$else$ + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize($struct.javaTypename$ data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, $struct.javaTypename$ data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + $struct.members : { member |$max_serialized_size(ctx=ctx, typecode=member.typecode, var="current_alignment")$}; separator="\n"$ + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize($struct.javaTypename$ data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize($struct.javaTypename$ data, int current_alignment) + { + int initial_alignment = current_alignment; + + $struct.members : { member |$serialized_size(ctx=ctx, object=member, data=["data.get", member.javaName, "()"], var="current_alignment")$}; separator="\n"$ + + return current_alignment - initial_alignment; + } + + public static void write($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + $struct.members : { member |$object_serialization(ctx=ctx, object=member, arg="", element="data.")$}; separator="\n"$ + } + + public static void read($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + $struct.members : { member |$object_deserialization(ctx=ctx, object=member, arg="", argsep="", element="data.")$}; separator="\n"$ + } + + @Override + public final void serialize($struct.javaTypename$ data, us.ihmc.idl.InterchangeSerializer ser) + { + $struct.members : { member | + $if(member.typecode.isType_a)$ + ser.write_$member.typecode.stType$("$member.name$", new $member.typecode.pubsubTypename$(), data.get$member.javaName$()); + $elseif(member.typecode.isType_f)$ + $if(member.typecode.contentTypeCode.isType_a)$ + ser.write_$member.typecode.stType$("$member.name$", new $member.typecode.contentTypeCode.pubsubTypename$(), data.get$member.javaName$()); + $else$ + ser.write_$member.typecode.stType$("$member.name$", data.get$member.javaName$()); + $endif$ + $else$ + ser.write_$member.typecode.stType$("$member.name$", data.get$member.javaName$()); + $endif$ + }; separator="\n"$ + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, $struct.javaTypename$ data) + { + $struct.members : { member | + $if(member.typecode.isType_c)$ + data.set$member.javaName$(($member.typecode.javaTypename$)ser.read_$member.typecode.stType$("$member.name$", $member.typecode.javaTypename$.class)); + $elseif(member.typecode.isType_a)$ + ser.read_type_a("$member.name$", new $member.typecode.pubsubTypename$(), data.get$member.javaName$()); + $elseif(member.typecode.isType_f)$ + $if(member.typecode.contentTypeCode.isType_a)$ + ser.read_$member.typecode.stType$("$member.name$", new $member.typecode.contentTypeCode.pubsubTypename$(), data.get$member.javaName$()); + $else$ + ser.read_$member.typecode.stType$("$member.name$", data.get$member.javaName$()); + $endif$ + $elseif(member.typecode.primitive)$ + data.set$member.javaName$(ser.read_$member.typecode.stType$("$member.name$")); + $else$ + ser.read_$member.typecode.stType$("$member.name$", data.get$member.javaName$()); + $endif$ + }; separator="\n"$ + } + + public static void staticCopy($struct.javaTypename$ src, $struct.javaTypename$ dest) + { + dest.set(src); + } + + + @Override + public $struct.javaTypename$ createData() + { + return new $struct.javaTypename$(); + } + +$endif$ + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize($struct.javaTypename$ data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy($struct.javaTypename$ src, $struct.javaTypename$ dest) + { + staticCopy(src, dest); + } + + + @Override + public $struct.name$PubSubType newInstance() + { + return new $struct.name$PubSubType(); + } + $extension$ +} +>> + +union_type(ctx, parent, union, extension, typecode) ::= << +/** +* No pub sub type for Union types is provided. Use struct to define topic data types. +* +*/ +>> + +enum_type(ctx, parent, enum, extension, typecode) ::= << +/** +* No pub sub type for Enum types is provided. Use structs to define topic data types. +* +*/ +>> diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaType.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaType.stg new file mode 100644 index 00000000..6d016829 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaType.stg @@ -0,0 +1,326 @@ +group JavaType; + +main(ctx, definitions, package) ::= << +$fileHeader()$ +$if(package)$ +package $package$; +$endif$ + +$definitions$ +>> + +interface(ctx, parent, interface, exports, extension) ::= << +$classdescription(type="interface", name=interface.name, filename=[ctx.filename, ".idl"])$ +public interface $interface.name$ +{ + $extension$ + + $exports$ +} +>> + +struct_type(ctx, parent, struct, extension, typecode) ::= << +import us.ihmc.euclid.interfaces.Settable; +import us.ihmc.euclid.interfaces.EpsilonComparable; +$classdescription(type="class", name=struct.name, filename=[ctx.filename, ".idl"])$ +public class $struct.name$ implements Settable<$struct.name$>, EpsilonComparable<$struct.name$> +{ + public $struct.name$() + { + $struct.members : { member | $if(member.typecode.isType_e)$ + $if(member.typecode.ContentTypeCode.isType_c)$ + $member.name$_ = new $member.typecode.javaTypename$($member.typecode.Maxsize$, $member.typecode.ContentTypeCode.javaTypename$.class, $member.typecode.ContentTypeCode.javaTypename$.values); + $elseif(member.typecode.ContentTypeCode.primitive)$ + $member.name$_ = new $member.typecode.javaTypename$($member.typecode.Maxsize$, "$member.typecode.ContentTypeCode.stType$"); + $elseif(member.typecode.ContentTypeCode.isType_d)$ + $member.name$_ = new $member.typecode.javaTypename$($member.typecode.Maxsize$, "$member.typecode.ContentTypeCode.stType$"); + $else$ + $member.name$_ = new $member.typecode.javaTypename$($member.typecode.Maxsize$, $member.typecode.ContentTypeCode.JavaTypename$.class, new $member.typecode.ContentTypeCode.pubsubTypename$()); + $endif$ + $elseif(member.typecode.isType_f)$ + $member.name$_ = new $member.typecode.ContentTypeCode.JavaTypename$[$member.typecode.Dimensions;separator="]["$]; + $if(!member.typecode.ContentTypeCode.primitive)$ + $array_init(ctx=ctx, typecodeArr=member.typecode, data=[member.name, "_"], elemInit=["new ", member.typecode.ContentTypeCode.JavaTypename, "()"], loopvar=ctx.nextLoopVarName, dimensions=member.typecode.dimensions)$ + $endif$ + $elseif(member.typecode.isType_d)$ + $member.name$_ = new $member.typecode.javaTypename$($member.typecode.Maxsize$); + $elseif(!member.typecode.primitive)$ + $member.name$_ = new $member.typecode.javaTypename$(); + $else$ + $endif$ +}; separator="\n"$ + } + + public $struct.name$($struct.name$ other) + { + set(other); + } + + public void set($struct.name$ other) + { + $struct.members : { member | $if(member.typecode.primitive)$ + $member.name$_ = other.$member.name$_; + $elseif(member.typecode.isType_d)$ + $member.name$_.setLength(0); + $member.name$_.append(other.$member.name$_); + $elseif(member.typecode.isType_f)$ + $array_copy(ctx=ctx, typecodeArr=member.typecode, data=[member.name, "_"], other=["other.", member.name, "_"], loopvar=ctx.nextLoopVarName, dimensions=member.typecode.dimensions)$ + + $elseif(member.typecode.isType_a)$ + $member.typecode.pubsubTypename$.staticCopy(other.$member.name$_, $member.name$_); + $else$ + $member.name$_.set(other.$member.name$_); + $endif$}; separator="\n"$ + } + + $struct.members : { member | + $if(!member.typecode.isType_e)$ + $if(member.typecode.primitive)$ +public void set$member.javaName$($member.typecode.javaTypename$ $member.name$) +{ + $member.name$_ = $member.name$; +} + $endif$ + $endif$ + $if(member.typecode.isType_d)$ + public void set$member.javaName$(String $member.name$) + { + $member.name$_.setLength(0); + $member.name$_.append($member.name$); + } + + public java.lang.String get$member.javaName$AsString() + { + return get$member.javaName$().toString(); + } + $endif$ + +public $member.typecode.javaTypename$ get$member.javaName$() +{ + return $member.name$_; +} + + }; separator="\n"$ + + + @Override + public boolean epsilonEquals($struct.name$ other, double epsilon) + { + if(other == null) return false; + if(other == this) return true; + + $struct.members : { member | + $if(member.typecode.isType_7)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsBoolean(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.primitive)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsPrimitive(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isType_d)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsStringBuilder(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isType_f)$ + $array_epsilon_equals(ctx=ctx, typecodeArr=member.typecode, data=[member.name, "_"], loopvar=ctx.nextLoopVarName, other=["other.", member.name, "_"], dimensions=member.typecode.dimensions)$ + $elseif(member.typecode.isStringBuilderSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsStringBuilderSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isObjectSequence)$ + if (this.$member.name$_.isEnum()) { if (!this.$member.name$_.equals(other.$member.name$_)) return false; } + else if (this.$member.name$_.size() == other.$member.name$_.size()) { return false; } + else + { + for (int i = 0; i < this.$member.name$_.size(); i++) + { if (!this.$member.name$_.get(i).epsilonEquals(other.$member.name$_.get(i), epsilon)) return false; } + } + $elseif(member.typecode.isBooleanSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsBooleanSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isByteSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsByteSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isCharSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsCharSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isShortSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsShortSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isIntegerSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsIntegerSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isLongSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsLongSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isFloatSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsFloatSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isDoubleSequence)$ + if (!us.ihmc.idl.IDLTools.epsilonEqualsDoubleSequence(this.$member.name$_, other.$member.name$_, epsilon)) return false; + $elseif(member.typecode.isIdlSequence)$ + if (this.$member.name$_.size() != other.$member.name$_.size()) return false; + else + for (int i = 0; i < this.$member.name$_.size(); i++) + { if (!us.ihmc.idl.IDLTools.epsilonEquals(this.$member.name$_.get(i), other.$member.name$_.get(i), epsilon)) return false; } + $else$ + if (!this.$member.name$_.epsilonEquals(other.$member.name$_, epsilon)) return false; + $endif$ + }; separator="\n"$ + + return true; + } + + @Override + public boolean equals(Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof $struct.name$)) return false; + + $struct.name$ otherMyClass = ($struct.name$) other; + + $struct.members : { member | + $if(member.typecode.primitive)$ + if(this.$member.name$_ != otherMyClass.$member.name$_) return false; + $elseif(member.typecode.isType_d)$ + if (!us.ihmc.idl.IDLTools.equals(this.$member.name$_, otherMyClass.$member.name$_)) return false; + $elseif(member.typecode.isType_f)$ + $array_equals(ctx=ctx, typecodeArr=member.typecode, data=[member.name, "_"], loopvar=ctx.nextLoopVarName, other=["otherMyClass.", member.name, "_"], dimensions=member.typecode.dimensions)$ + $else$ + if (!this.$member.name$_.equals(otherMyClass.$member.name$_)) return false; + $endif$ + }; separator="\n"$ + + return true; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("$struct.name$ {"); + $struct.members : { member | +builder.append("$member.name$="); +$if(member.typecode.isType_f)$ +$if(first(rest(member.typecode.dimensions)))$builder.append(java.util.Arrays.deepToString(this.$member.name$_)); +$else$builder.append(java.util.Arrays.toString(this.$member.name$_)); +$endif$ +$else$builder.append(this.$member.name$_);$endif$ + + }; separator="builder.append(\", \");\n"$ + builder.append("}"); + return builder.toString(); + } + + $struct.members : { member |private $member.typecode.javaTypename$ $member.name$_; }; separator="\n"$ + + $extension$ +} +>> + +union_type(ctx, parent, union, extension, typecode) ::= << +$classdescription(type="union", name=union.name, filename=[ctx.filename, ".idl"])$ +public class $union.name$ +{ + public $union.name$() + { + $if(union.javaDefaultvalue)$ + d__ = $union.javaDefaultvalue$; + $else$ + d__ = $first(first(union.members).javaLabels)$; + $endif$ + + $union.members : { member | + $if(!member.typecode.primitive)$$member.name$_ = new $member.typecode.javaTypename$();$endif$ + }; separator="\n"$ + } + + public $union.discriminator.javaTypename$ getDiscriminator() + { + return d__; + } + + $union.members : { member | + $if(!member.typecode.isType_e)$ + public void set$member.javaName$($member.typecode.javaTypename$ $member.name$) + { + $member.name$_ = $member.name$; + + $if(member.default)$ + d__ = $union.javaDefaultvalue$; + $else$ + d__ = $first(member.javaLabels)$; + $endif$ + } + + public void set$member.javaName$($union.discriminator.javaTypename$ discriminator, $member.typecode.javaTypename$ $member.name$) + throws Exception + { + $if(member.default)$ + if($[union.javaDefaultvalue, member.javaLabels] : {label | discriminator == $label$}; separator=" || "$) + $else$ + if($member.javaLabels : {label | discriminator == $label$}; separator=" || "$) + $endif$ + { + $member.name$_ = $member.name$; + d__ = discriminator; + return; + } + + throw new Exception("Given discriminator is not a valid value for member $member.name$"); + } + $endif$ + + public $member.typecode.javaTypename$ get$member.javaName$() + throws Exception + { + $if(member.default)$ + if($[union.javaDefaultvalue, member.javaLabels] : {label | d__ == $label$}; separator=" || "$) + $else$ + if($member.javaLabels : {label | d__ == $label$}; separator=" || "$) + $endif$ + return $member.name$_; + + throw new Exception("Union member not selected by discriminator"); + } + + }; separator="\n"$ + + @Override + public boolean equals(Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof $union.name$)) return false; + $union.name$ otherMyClass = ($union.name$)other; + + if(this.d__ == otherMyClass.d__) + { + $union.members : { member | + $if(member.default)$ + if($[union.javaDefaultvalue, member.javaLabels] : {label | d__ == $label$}; separator=" || "$) + $else$ + if($member.javaLabels : {label | d__ == $label$}; separator=" || "$) + $endif$ + { + if(this.$member.name$_ == otherMyClass.$member.name$_) + return true; + else + return false; + } + }; separator="\n"$ + } + + return false; + } + + $union.discriminator.javaTypename$ d__; + + $union.members : { member |private $member.typecode.javaTypename$ $member.name$_; }; separator="\n"$ + + $extension$ +} +>> + +enum_type(ctx, parent, enum, extension, typecode) ::= << +$classdescription(type="enum", name=enum.name, filename=[ctx.filename, ".idl"])$ +public enum $enum.name$ +{ + $enum.members:{ member | + $member.name$, + }; separator="\n"$ + ; + + public static $enum.name$[] values = values(); + + $extension$ +} +>> diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaTypes.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaTypes.stg new file mode 100644 index 00000000..bb875acf --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/JavaTypes.stg @@ -0,0 +1,66 @@ +group Types; + +type_5(package) ::= <> + +type_6(package) ::= <> + +type_13(package) ::= <> + +type_1(package) ::= <> + +type_2(package) ::= <> + +type_11(package) ::= <> + +type_3(package) ::= <> + +type_4(package) ::= <> + +type_12(package) ::= <> + +type_8(package) ::= <> + +type_14(package) ::= <> + +type_7(package) ::= <> + +type_9(package) ::= <> + +type_d(package) ::= <> + +type_15(package) ::= <> + +type_f_first(prev) ::= <> +type_f_second(prev, size) ::= <<, $size$>$prev$>> +type_f(package, firs, secon, type) ::= <<$firs$$type$$secon$>> + +type_a(package, name) ::= <<$package$$name$>> + +type_b(package, name) ::= <<$package$$name$>> + +type_c(package, name) ::= <<$package$$name$>> + +type_10(package, name) ::= <<$name$>> + +// TODO Para que sirve empty en FastBuffers? +type_e(package, type, maxsize, empty) ::= <$endif$ $empty$>> + +type_e_content_types ::= [ + "boolean":".Boolean", + "byte":".Byte", + "char":".Char", + "short":".Short", + "int":".Integer", + "long":".Long", + "float":".Float", + "double":".Double", + "java.lang.StringBuilder":".StringBuilderHolder", + default: +] + +initialValues ::= [ + "type_d":"\"\"", + "type_15":"\"\"", + default: // not basic type. +] + diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Types.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Types.stg new file mode 100644 index 00000000..f26d3f0d --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/Types.stg @@ -0,0 +1,52 @@ +group Types; + +type_5() ::= <> + +type_6() ::= <> + +type_13() ::= <> + +type_1() ::= <> + +type_2() ::= <> + +type_11() ::= <> + +type_3() ::= <> + +type_4() ::= <> + +type_12() ::= <> + +type_8() ::= <> + +type_14() ::= <> + +type_7() ::= <> + +type_9() ::= <> + +type_d() ::= <> + +type_15() ::= <> + +type_f_first(prev) ::= <<$prev$>> +type_f_second(prev, size) ::= <<[]$prev$>> +type_f(firs, secon, type) ::= <<$firs$$type$$secon$>> + +type_a(name) ::= <<$name$>> + +type_b(name) ::= <<$name$>> + +type_c(name) ::= <<$name$>> + +type_10(name) ::= <<$name$>> + +// TODO Para que sirve empty en FastBuffers? +type_e(type, maxsize, empty) ::= <$empty$>> + +initialValues ::= [ + "type_d":"\"\"", + "type_15":"\"\"", + default: // not basic type. +] diff --git a/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/idlTypes.stg b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/idlTypes.stg new file mode 100644 index 00000000..0543b0e7 --- /dev/null +++ b/ihmc-pub-sub-generator/src/main/templates/us/ihmc/idl/templates/idlTypes.stg @@ -0,0 +1,45 @@ +group Types; + +type_5() ::= <> + +type_6() ::= <> + +type_13() ::= <> + +type_1() ::= <> + +type_2() ::= <> + +type_11() ::= <> + +type_3() ::= <> + +type_4() ::= <> + +type_12() ::= <> + +type_8() ::= <> + +type_14() ::= <> + +type_7() ::= <> + +type_9() ::= <> + +type_d() ::= <> + +type_15() ::= <> + +type_f_first(prev) ::= <> +type_f_second(prev, size) ::= <<, $size$>$prev$>> +type_f(firs, secon, type) ::= <<$firs$$type$$secon$>> + +type_a(name) ::= <<$name$>> + +type_b(name) ::= <<$name$>> + +type_c(name) ::= <<$name$>> + +type_10(name) ::= <<$name$>> + +type_e(type, maxsize, empty) ::= <$empty$>> diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Box.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Box.java new file mode 100644 index 00000000..8357aaa6 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Box.java @@ -0,0 +1,125 @@ +package us.ihmc.idl.generated.Geometry; +/** +* +* Definition of the class "Box" defined in Vector.idl. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class Box +{ + public Box() + { + center_ = new java.lang.Object(); + + } + + public void set(Box other) + { + us.ihmc.idl.generated.Geometry.VectorPubSubType.staticCopy(other.center_, center_);w_ = other.w_; + l_ = other.l_; + h_ = other.h_; + + } + + + public java.lang.Object getCenter() + { + return center_; + } + + + public void setW(double w) + { + w_ = w; + } + + public double getW() + { + return w_; + } + + + public void setL(double l) + { + l_ = l; + } + + public double getL() + { + return l_; + } + + + public void setH(double h) + { + h_ = h; + } + + public double getH() + { + return h_; + } + + + + + + + @Override + public boolean equals(java.lang.Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof Box)) return false; + Box otherMyClass = (Box)other; + boolean returnedValue = true; + + returnedValue &= this.center_.equals(otherMyClass.center_); + + returnedValue &= this.w_ == otherMyClass.w_; + + + returnedValue &= this.l_ == otherMyClass.l_; + + + returnedValue &= this.h_ == otherMyClass.h_; + + + + return returnedValue; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("Box {"); + builder.append("center="); + builder.append(this.center_); + + builder.append(", "); + builder.append("w="); + builder.append(this.w_); + + builder.append(", "); + builder.append("l="); + builder.append(this.l_); + + builder.append(", "); + builder.append("h="); + builder.append(this.h_); + + + builder.append("}"); + return builder.toString(); + } + + private java.lang.Object center_; + private double w_; + private double l_; + private double h_; + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/BoxPubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/BoxPubSubType.java new file mode 100644 index 00000000..3ffb8724 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/BoxPubSubType.java @@ -0,0 +1,183 @@ +package us.ihmc.idl.generated.Geometry; + +/** +* +* Topic data type of the struct "Box" defined in "Vector.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class BoxPubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "Geometry::Box"; + + + + public BoxPubSubType() + { + + } + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.idl.generated.Geometry.Box data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getMaxCdrSerializedSize(current_alignment); + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Box data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Box data, int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getCdrSerializedSize(data.getCenter(), current_alignment); + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; + } + + public static void write(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.idl.CDR cdr) + { + + us.ihmc.idl.generated.Geometry.VectorPubSubType.write(data.getCenter(), cdr); + + cdr.write_type_6(data.getW()); + + cdr.write_type_6(data.getL()); + + cdr.write_type_6(data.getH()); + } + + public static void read(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.idl.CDR cdr) + { + + us.ihmc.idl.generated.Geometry.VectorPubSubType.read(data.getCenter(), cdr); + + data.setW(cdr.read_type_6()); + + + data.setL(cdr.read_type_6()); + + + data.setH(cdr.read_type_6()); + + } + + @Override + public final void serialize(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_a("center", new us.ihmc.idl.generated.Geometry.VectorPubSubType(), data.getCenter()); + + + ser.write_type_6("w", data.getW()); + + ser.write_type_6("l", data.getL()); + + ser.write_type_6("h", data.getH()); + + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.idl.generated.Geometry.Box data) + { + ser.read_type_a("center", new us.ihmc.idl.generated.Geometry.VectorPubSubType(), data.getCenter()); + + + data.setW(ser.read_type_6("w")); + + data.setL(ser.read_type_6("l")); + + data.setH(ser.read_type_6("h")); + + } + + public static void staticCopy(us.ihmc.idl.generated.Geometry.Box src, us.ihmc.idl.generated.Geometry.Box dest) + { + dest.set(src); + } + + + @Override + public us.ihmc.idl.generated.Geometry.Box createData() + { + return new us.ihmc.idl.generated.Geometry.Box(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(us.ihmc.idl.generated.Geometry.Box data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(us.ihmc.idl.generated.Geometry.Box src, us.ihmc.idl.generated.Geometry.Box dest) + { + staticCopy(src, dest); + } + + + @Override + public BoxPubSubType newInstance() + { + return new BoxPubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Polygon.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Polygon.java new file mode 100644 index 00000000..2c5c5816 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Polygon.java @@ -0,0 +1,68 @@ +package us.ihmc.idl.generated.Geometry; +/** +* +* Definition of the class "Polygon" defined in Vector.idl. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class Polygon +{ + public Polygon() + { + points_ = new us.ihmc.idl.IDLSequence.Object (100, java.lang.Object.class, new us.ihmc.idl.generated.Geometry.VectorPubSubType()); + + + + + } + + public void set(Polygon other) + { + points_.set(other.points_); + } + + + public us.ihmc.idl.IDLSequence.Object getPoints() + { + return points_; + } + + + + + + + @Override + public boolean equals(java.lang.Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof Polygon)) return false; + Polygon otherMyClass = (Polygon)other; + boolean returnedValue = true; + + returnedValue &= this.points_.equals(otherMyClass.points_); + + + return returnedValue; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("Polygon {"); + builder.append("points="); + builder.append(this.points_); + + + builder.append("}"); + return builder.toString(); + } + + private us.ihmc.idl.IDLSequence.Object points_; + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/PolygonPubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/PolygonPubSubType.java new file mode 100644 index 00000000..1121daf7 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/PolygonPubSubType.java @@ -0,0 +1,150 @@ +package us.ihmc.idl.generated.Geometry; + +/** +* +* Topic data type of the struct "Polygon" defined in "Vector.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class PolygonPubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "Geometry::Polygon"; + + + + public PolygonPubSubType() + { + + } + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.idl.generated.Geometry.Polygon data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < 100; ++a) + { + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Polygon data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Polygon data, int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < data.getPoints().size(); ++a) + { + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getCdrSerializedSize(data.getPoints().get(a), current_alignment);} + + return current_alignment - initial_alignment; + } + + public static void write(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.idl.CDR cdr) + { + + if(data.getPoints().size() <= 100) + cdr.write_type_e(data.getPoints());else + throw new RuntimeException("points field exceeds the maximum length"); + } + + public static void read(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.idl.CDR cdr) + { + + cdr.read_type_e(data.getPoints()); + } + + @Override + public final void serialize(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_e("points", data.getPoints()); + + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.idl.generated.Geometry.Polygon data) + { + ser.read_type_e("points", data.getPoints()); + + } + + public static void staticCopy(us.ihmc.idl.generated.Geometry.Polygon src, us.ihmc.idl.generated.Geometry.Polygon dest) + { + dest.set(src); + } + + + @Override + public us.ihmc.idl.generated.Geometry.Polygon createData() + { + return new us.ihmc.idl.generated.Geometry.Polygon(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(us.ihmc.idl.generated.Geometry.Polygon data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(us.ihmc.idl.generated.Geometry.Polygon src, us.ihmc.idl.generated.Geometry.Polygon dest) + { + staticCopy(src, dest); + } + + + @Override + public PolygonPubSubType newInstance() + { + return new PolygonPubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Triangle.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Triangle.java new file mode 100644 index 00000000..8ee6e369 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/Triangle.java @@ -0,0 +1,75 @@ +package us.ihmc.idl.generated.Geometry; +/** +* +* Definition of the class "Triangle" defined in Vector.idl. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class Triangle +{ + public Triangle() + { + points_ = new java.lang.Object[3]; + for(int b = 0; b < points_.length; ++b) + { + points_[b] = new java.lang.Object(); + } + + + } + + public void set(Triangle other) + { + for(int d = 0; d < points_.length; ++d) + { + us.ihmc.idl.generated.Geometry.VectorPubSubType.staticCopy(other.points_[d], points_[d]); } + + } + + + public java.lang.Object[] getPoints() + { + return points_; + } + + + + + + + @Override + public boolean equals(java.lang.Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof Triangle)) return false; + Triangle otherMyClass = (Triangle)other; + boolean returnedValue = true; + + for(int f = 0; f < points_.length; ++f) + { + returnedValue &= points_[f].equals(otherMyClass.points_[f]); + } + + return returnedValue; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("Triangle {"); + builder.append("points="); + builder.append(java.util.Arrays.toString(this.points_)); + + + builder.append("}"); + return builder.toString(); + } + + private java.lang.Object[] points_; + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/TrianglePubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/TrianglePubSubType.java new file mode 100644 index 00000000..b90921f2 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/TrianglePubSubType.java @@ -0,0 +1,153 @@ +package us.ihmc.idl.generated.Geometry; + +/** +* +* Topic data type of the struct "Triangle" defined in "Vector.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class TrianglePubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "Geometry::Triangle"; + + + + public TrianglePubSubType() + { + + } + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.idl.generated.Geometry.Triangle data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + for(int a = 0; a < (3); ++a) + { + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getMaxCdrSerializedSize(current_alignment);} + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Triangle data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.Geometry.Triangle data, int current_alignment) + { + int initial_alignment = current_alignment; + + for(int a = 0; a < data.getPoints().length; ++a) + { + current_alignment += us.ihmc.idl.generated.Geometry.VectorPubSubType.getCdrSerializedSize(data.getPoints()[a], current_alignment); + } + return current_alignment - initial_alignment; + } + + public static void write(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.idl.CDR cdr) + { + + for(int a = 0; a < data.getPoints().length; ++a) + { + us.ihmc.idl.generated.Geometry.VectorPubSubType.write(data.getPoints()[a], cdr); + } + + } + + public static void read(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.idl.CDR cdr) + { + + for(int a = 0; a < data.getPoints().length; ++a) + { + us.ihmc.idl.generated.Geometry.VectorPubSubType.read(data.getPoints()[a], cdr); + } + + } + + @Override + public final void serialize(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_f("points", new us.ihmc.idl.generated.Geometry.VectorPubSubType(), data.getPoints()); + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.idl.generated.Geometry.Triangle data) + { + ser.read_type_f("points", new us.ihmc.idl.generated.Geometry.VectorPubSubType(), data.getPoints()); + + + } + + public static void staticCopy(us.ihmc.idl.generated.Geometry.Triangle src, us.ihmc.idl.generated.Geometry.Triangle dest) + { + dest.set(src); + } + + + @Override + public us.ihmc.idl.generated.Geometry.Triangle createData() + { + return new us.ihmc.idl.generated.Geometry.Triangle(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(us.ihmc.idl.generated.Geometry.Triangle data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(us.ihmc.idl.generated.Geometry.Triangle src, us.ihmc.idl.generated.Geometry.Triangle dest) + { + staticCopy(src, dest); + } + + + @Override + public TrianglePubSubType newInstance() + { + return new TrianglePubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/VectorPubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/VectorPubSubType.java new file mode 100644 index 00000000..d7f6ddb3 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/Geometry/VectorPubSubType.java @@ -0,0 +1,354 @@ +package us.ihmc.idl.generated.Geometry; + +/** +* +* Topic data type of the struct "Vector" defined in "Vector.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from Vector.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit Vector.idl instead. +* +*/ +public class VectorPubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "Geometry::Vector"; + + + + public VectorPubSubType() + { + + } + + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + + private static AbstractVectorPubSubTypeImplementation impl = null; + + /** + * Abstract implementation of VectorPubSubType. + * + * Extend this class to create a custom PubSubType for @Abstract idl datatypes. + * + */ + public static abstract class AbstractVectorPubSubTypeImplementation + { + + + /** + * Copy src into dest. + * + * @param src Source object to copy data from + * @param dest Destination object to copy data to + */ + protected abstract void copy(java.lang.Object src, java.lang.Object dest); + + + + /** + * Getter for Frame + * + * @param data object to read from + * @return value of X + */ + protected abstract java.lang.StringBuilder getFrame(java.lang.Object data); + + + + /** + * Getter for X + * + * @param data object to read from + * @return value of X + */ + protected abstract double getX(java.lang.Object data); + /** + * Setter for X + * + * @param data object to write to + * @param x value + */ + protected abstract void setX(java.lang.Object data, double x); + + + + /** + * Getter for Y + * + * @param data object to read from + * @return value of X + */ + protected abstract double getY(java.lang.Object data); + /** + * Setter for Y + * + * @param data object to write to + * @param y value + */ + protected abstract void setY(java.lang.Object data, double y); + + + + /** + * Getter for Z + * + * @param data object to read from + * @return value of X + */ + protected abstract double getZ(java.lang.Object data); + /** + * Setter for Z + * + * @param data object to write to + * @param z value + */ + protected abstract void setZ(java.lang.Object data, double z); + + + + /** + * Getter for Bla + * + * @param data object to read from + * @return value of X + */ + protected abstract us.ihmc.idl.IDLSequence.Double getBla(java.lang.Object data); + + + + /** + * Getter for Waa + * + * @param data object to read from + * @return value of X + */ + protected abstract double[] getWaa(java.lang.Object data); + + + + + public abstract java.lang.Object createData(); + } + + private static AbstractVectorPubSubTypeImplementation getImpl() + { + if(impl == null) + { + throw new RuntimeException("Abstract pub/sub type implementation not set. Call setImplementation(AbstractVectorPubSubTypeImplementation implementation) before using this type."); + } + return impl; + } + + public static void setImplementation(AbstractVectorPubSubTypeImplementation implementation) + { + VectorPubSubType.impl = implementation; + } + + + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 128 + 1; + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (100 * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += ((3) * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(java.lang.Object data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(java.lang.Object data, int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + getImpl().getFrame(data).length() + 1; + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (getImpl().getBla(data).size() * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += ((3) * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + return current_alignment - initial_alignment; + } + + + @Override + public void serialize(java.lang.Object data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + + } + + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, java.lang.Object data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + + public static void write(java.lang.Object data, us.ihmc.idl.CDR cdr) + { + + if(getImpl().getFrame(data).length() <= 128) + cdr.write_type_d(getImpl().getFrame(data));else + throw new RuntimeException("frame field exceeds the maximum length"); + + cdr.write_type_6(getImpl().getX(data)); + + cdr.write_type_6(getImpl().getY(data)); + + cdr.write_type_6(getImpl().getZ(data)); + + if(getImpl().getBla(data).size() <= 100) + cdr.write_type_e(getImpl().getBla(data));else + throw new RuntimeException("bla field exceeds the maximum length"); + + for(int a = 0; a < getImpl().getWaa(data).length; ++a) + { + cdr.write_type_6(getImpl().getWaa(data)[a]); + } + + } + + public static void read(java.lang.Object data, us.ihmc.idl.CDR cdr) + { + + cdr.read_type_d(getImpl().getFrame(data)); + + getImpl().setX(data,cdr.read_type_6()); + + + getImpl().setY(data,cdr.read_type_6()); + + + getImpl().setZ(data,cdr.read_type_6()); + + + cdr.read_type_e(getImpl().getBla(data)); + + for(int a = 0; a < getImpl().getWaa(data).length; ++a) + { + getImpl().getWaa(data)[a] = cdr.read_type_6(); + + } + + } + + @Override + public final void serialize(java.lang.Object data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_d("frame", getImpl().getFrame(data)); + + ser.write_type_6("x", getImpl().getX(data)); + + ser.write_type_6("y", getImpl().getY(data)); + + ser.write_type_6("z", getImpl().getZ(data)); + + ser.write_type_e("bla", getImpl().getBla(data)); + + ser.write_type_f("waa", getImpl().getWaa(data)); + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, java.lang.Object data) + { + ser.read_type_d("frame", getImpl().getFrame(data)); + + getImpl().setX(data, ser.read_type_6("x")); + + getImpl().setY(data, ser.read_type_6("y")); + + getImpl().setZ(data, ser.read_type_6("z")); + + ser.read_type_e("bla", getImpl().getBla(data)); + + ser.read_type_f("waa", getImpl().getWaa(data)); + + + } + + + public static void staticCopy(java.lang.Object src, java.lang.Object dest) + { + getImpl().copy(src, dest); + } + + + @Override + public java.lang.Object createData() + { + return getImpl().createData(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(java.lang.Object data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(java.lang.Object data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(java.lang.Object src, java.lang.Object dest) + { + staticCopy(src, dest); + } + + + @Override + public VectorPubSubType newInstance() + { + return new VectorPubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/Color.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/Color.java new file mode 100644 index 00000000..e1466b54 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/Color.java @@ -0,0 +1,22 @@ +package us.ihmc.idl.generated.IDLElement; +/** +* +* Definition of the enum "Color" defined in IDLElementTest.idl. +* +* This file was automatically generated from IDLElementTest.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit IDLElementTest.idl instead. +* +*/ +public enum Color +{ + red, + + green, + + blue, + + ; + + public static Color[] values = values(); + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTest.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTest.java new file mode 100644 index 00000000..62adc50a --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTest.java @@ -0,0 +1,647 @@ +package us.ihmc.idl.generated.IDLElement; +/** +* +* Definition of the class "IDLElementTest" defined in IDLElementTest.idl. +* +* This file was automatically generated from IDLElementTest.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit IDLElementTest.idl instead. +* +*/ +public class IDLElementTest +{ + public IDLElementTest() + { + nestedElementTest_ = new us.ihmc.idl.generated.IDLNestedElement.NestedElement();stringTest_ = new java.lang.StringBuilder(255); + longArray_ = new int[10]; + nestedArray_ = new us.ihmc.idl.generated.IDLNestedElement.NestedElement[5][3]; + for(int b = 0; b < nestedArray_.length; ++b) + { + for(int c = 0; c < nestedArray_[b].length; ++c) + { + nestedArray_[b][c] = new us.ihmc.idl.generated.IDLNestedElement.NestedElement(); + } + } + stringArray_ = new java.lang.StringBuilder[4]; + for(int e = 0; e < stringArray_.length; ++e) + { + stringArray_[e] = new java.lang.StringBuilder(); + } + charSeqTest_ = new us.ihmc.idl.IDLSequence.Char (25, "type_8"); + wcharSeqTest_ = new us.ihmc.idl.IDLSequence.Char (25, "type_14"); + octetSeqTest_ = new us.ihmc.idl.IDLSequence.Byte (25, "type_9"); + shortSeqTest_ = new us.ihmc.idl.IDLSequence.Short (25, "type_1"); + ushortSeqTest_ = new us.ihmc.idl.IDLSequence.Integer (25, "type_3"); + longSeqTest_ = new us.ihmc.idl.IDLSequence.Integer (25, "type_2"); + ulongSeqTest_ = new us.ihmc.idl.IDLSequence.Long (25, "type_4"); + longlongSeqtest_ = new us.ihmc.idl.IDLSequence.Long (25, "type_11"); + ulonglongSeqTest_ = new us.ihmc.idl.IDLSequence.Long (25, "type_12"); + floatSeqTest_ = new us.ihmc.idl.IDLSequence.Float (25, "type_5"); + doubleSeqTest_ = new us.ihmc.idl.IDLSequence.Double (25, "type_6"); + booleanSeqTest_ = new us.ihmc.idl.IDLSequence.Boolean (25, "type_7"); + nestedSeqTest_ = new us.ihmc.idl.IDLSequence.Object (25, us.ihmc.idl.generated.IDLNestedElement.NestedElement.class, new us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType()); + + stringSeqTest_ = new us.ihmc.idl.IDLSequence.StringBuilderHolder (25, "type_d"); + + + } + + public void set(IDLElementTest other) + { + charTest_ = other.charTest_; + wcharTest_ = other.wcharTest_; + octetTest_ = other.octetTest_; + shortTest_ = other.shortTest_; + ushortTest_ = other.ushortTest_; + longTest_ = other.longTest_; + ulongTest_ = other.ulongTest_; + longlongTest_ = other.longlongTest_; + ulonglongTest_ = other.ulonglongTest_; + floatTest_ = other.floatTest_; + doubleTest_ = other.doubleTest_; + booleanTest_ = other.booleanTest_; + colorTest_ = other.colorTest_; + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.staticCopy(other.nestedElementTest_, nestedElementTest_);stringTest_.setLength(0); + stringTest_.append(other.stringTest_); + for(int g = 0; g < longArray_.length; ++g) + { + longArray_[g] = other.longArray_[g]; + + } + + for(int i = 0; i < nestedArray_.length; ++i) + { + for(int j = 0; j < nestedArray_[i].length; ++j) + { + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.staticCopy(other.nestedArray_[i][j], nestedArray_[i][j]); } + } + + for(int l = 0; l < stringArray_.length; ++l) + { + stringArray_[l].setLength(0); + stringArray_[l].append(other.stringArray_[l]); + } + + charSeqTest_.set(other.charSeqTest_); wcharSeqTest_.set(other.wcharSeqTest_); octetSeqTest_.set(other.octetSeqTest_); shortSeqTest_.set(other.shortSeqTest_); ushortSeqTest_.set(other.ushortSeqTest_); longSeqTest_.set(other.longSeqTest_); ulongSeqTest_.set(other.ulongSeqTest_); longlongSeqtest_.set(other.longlongSeqtest_); ulonglongSeqTest_.set(other.ulonglongSeqTest_); floatSeqTest_.set(other.floatSeqTest_); doubleSeqTest_.set(other.doubleSeqTest_); booleanSeqTest_.set(other.booleanSeqTest_); nestedSeqTest_.set(other.nestedSeqTest_); stringSeqTest_.set(other.stringSeqTest_); + } + + public void setCharTest(char charTest) + { + charTest_ = charTest; + } + + public char getCharTest() + { + return charTest_; + } + + + public void setWcharTest(char wcharTest) + { + wcharTest_ = wcharTest; + } + + public char getWcharTest() + { + return wcharTest_; + } + + + public void setOctetTest(byte octetTest) + { + octetTest_ = octetTest; + } + + public byte getOctetTest() + { + return octetTest_; + } + + + public void setShortTest(short shortTest) + { + shortTest_ = shortTest; + } + + public short getShortTest() + { + return shortTest_; + } + + + public void setUshortTest(int ushortTest) + { + ushortTest_ = ushortTest; + } + + public int getUshortTest() + { + return ushortTest_; + } + + + public void setLongTest(int longTest) + { + longTest_ = longTest; + } + + public int getLongTest() + { + return longTest_; + } + + + public void setUlongTest(long ulongTest) + { + ulongTest_ = ulongTest; + } + + public long getUlongTest() + { + return ulongTest_; + } + + + public void setLonglongTest(long longlongTest) + { + longlongTest_ = longlongTest; + } + + public long getLonglongTest() + { + return longlongTest_; + } + + + public void setUlonglongTest(long ulonglongTest) + { + ulonglongTest_ = ulonglongTest; + } + + public long getUlonglongTest() + { + return ulonglongTest_; + } + + + public void setFloatTest(float floatTest) + { + floatTest_ = floatTest; + } + + public float getFloatTest() + { + return floatTest_; + } + + + public void setDoubleTest(double doubleTest) + { + doubleTest_ = doubleTest; + } + + public double getDoubleTest() + { + return doubleTest_; + } + + + public void setBooleanTest(boolean booleanTest) + { + booleanTest_ = booleanTest; + } + + public boolean getBooleanTest() + { + return booleanTest_; + } + + + public void setColorTest(us.ihmc.idl.generated.IDLElement.Color colorTest) + { + colorTest_ = colorTest; + } + + public us.ihmc.idl.generated.IDLElement.Color getColorTest() + { + return colorTest_; + } + + + + public us.ihmc.idl.generated.IDLNestedElement.NestedElement getNestedElementTest() + { + return nestedElementTest_; + } + + + public void setStringTest(String stringTest) + { + stringTest_.setLength(0); + stringTest_.append(stringTest); + } + + public java.lang.String getStringTestAsString() + { + return getStringTest().toString(); + } + + public java.lang.StringBuilder getStringTest() + { + return stringTest_; + } + + + + public int[] getLongArray() + { + return longArray_; + } + + + + public us.ihmc.idl.generated.IDLNestedElement.NestedElement[][] getNestedArray() + { + return nestedArray_; + } + + + + public java.lang.StringBuilder[] getStringArray() + { + return stringArray_; + } + + + + public us.ihmc.idl.IDLSequence.Char getCharSeqTest() + { + return charSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Char getWcharSeqTest() + { + return wcharSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Byte getOctetSeqTest() + { + return octetSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Short getShortSeqTest() + { + return shortSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Integer getUshortSeqTest() + { + return ushortSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Integer getLongSeqTest() + { + return longSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Long getUlongSeqTest() + { + return ulongSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Long getLonglongSeqtest() + { + return longlongSeqtest_; + } + + + + public us.ihmc.idl.IDLSequence.Long getUlonglongSeqTest() + { + return ulonglongSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Float getFloatSeqTest() + { + return floatSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Double getDoubleSeqTest() + { + return doubleSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Boolean getBooleanSeqTest() + { + return booleanSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.Object getNestedSeqTest() + { + return nestedSeqTest_; + } + + + + public us.ihmc.idl.IDLSequence.StringBuilderHolder getStringSeqTest() + { + return stringSeqTest_; + } + + + + + + + @Override + public boolean equals(java.lang.Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof IDLElementTest)) return false; + IDLElementTest otherMyClass = (IDLElementTest)other; + boolean returnedValue = true; + + returnedValue &= this.charTest_ == otherMyClass.charTest_; + + + returnedValue &= this.wcharTest_ == otherMyClass.wcharTest_; + + + returnedValue &= this.octetTest_ == otherMyClass.octetTest_; + + + returnedValue &= this.shortTest_ == otherMyClass.shortTest_; + + + returnedValue &= this.ushortTest_ == otherMyClass.ushortTest_; + + + returnedValue &= this.longTest_ == otherMyClass.longTest_; + + + returnedValue &= this.ulongTest_ == otherMyClass.ulongTest_; + + + returnedValue &= this.longlongTest_ == otherMyClass.longlongTest_; + + + returnedValue &= this.ulonglongTest_ == otherMyClass.ulonglongTest_; + + + returnedValue &= this.floatTest_ == otherMyClass.floatTest_; + + + returnedValue &= this.doubleTest_ == otherMyClass.doubleTest_; + + + returnedValue &= this.booleanTest_ == otherMyClass.booleanTest_; + + + returnedValue &= this.colorTest_ == otherMyClass.colorTest_; + + + returnedValue &= this.nestedElementTest_.equals(otherMyClass.nestedElementTest_); + + returnedValue &= us.ihmc.idl.IDLTools.equals(this.stringTest_, otherMyClass.stringTest_); + + for(int n = 0; n < longArray_.length; ++n) + { + returnedValue &= this.longArray_[n] == otherMyClass.longArray_[n]; + + } + for(int p = 0; p < nestedArray_.length; ++p) + { + for(int q = 0; q < nestedArray_[p].length; ++q) + { + returnedValue &= nestedArray_[p][q].equals(otherMyClass.nestedArray_[p][q]); + } + } + for(int s = 0; s < stringArray_.length; ++s) + { + returnedValue &= us.ihmc.idl.IDLTools.equals(this.stringArray_[s], otherMyClass.stringArray_[s]);} + returnedValue &= this.charSeqTest_.equals(otherMyClass.charSeqTest_); + + returnedValue &= this.wcharSeqTest_.equals(otherMyClass.wcharSeqTest_); + + returnedValue &= this.octetSeqTest_.equals(otherMyClass.octetSeqTest_); + + returnedValue &= this.shortSeqTest_.equals(otherMyClass.shortSeqTest_); + + returnedValue &= this.ushortSeqTest_.equals(otherMyClass.ushortSeqTest_); + + returnedValue &= this.longSeqTest_.equals(otherMyClass.longSeqTest_); + + returnedValue &= this.ulongSeqTest_.equals(otherMyClass.ulongSeqTest_); + + returnedValue &= this.longlongSeqtest_.equals(otherMyClass.longlongSeqtest_); + + returnedValue &= this.ulonglongSeqTest_.equals(otherMyClass.ulonglongSeqTest_); + + returnedValue &= this.floatSeqTest_.equals(otherMyClass.floatSeqTest_); + + returnedValue &= this.doubleSeqTest_.equals(otherMyClass.doubleSeqTest_); + + returnedValue &= this.booleanSeqTest_.equals(otherMyClass.booleanSeqTest_); + + returnedValue &= this.nestedSeqTest_.equals(otherMyClass.nestedSeqTest_); + + returnedValue &= this.stringSeqTest_.equals(otherMyClass.stringSeqTest_); + + + return returnedValue; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("IDLElementTest {"); + builder.append("charTest="); + builder.append(this.charTest_); + + builder.append(", "); + builder.append("wcharTest="); + builder.append(this.wcharTest_); + + builder.append(", "); + builder.append("octetTest="); + builder.append(this.octetTest_); + + builder.append(", "); + builder.append("shortTest="); + builder.append(this.shortTest_); + + builder.append(", "); + builder.append("ushortTest="); + builder.append(this.ushortTest_); + + builder.append(", "); + builder.append("longTest="); + builder.append(this.longTest_); + + builder.append(", "); + builder.append("ulongTest="); + builder.append(this.ulongTest_); + + builder.append(", "); + builder.append("longlongTest="); + builder.append(this.longlongTest_); + + builder.append(", "); + builder.append("ulonglongTest="); + builder.append(this.ulonglongTest_); + + builder.append(", "); + builder.append("floatTest="); + builder.append(this.floatTest_); + + builder.append(", "); + builder.append("doubleTest="); + builder.append(this.doubleTest_); + + builder.append(", "); + builder.append("booleanTest="); + builder.append(this.booleanTest_); + + builder.append(", "); + builder.append("colorTest="); + builder.append(this.colorTest_); + + builder.append(", "); + builder.append("nestedElementTest="); + builder.append(this.nestedElementTest_); + + builder.append(", "); + builder.append("stringTest="); + builder.append(this.stringTest_); + + builder.append(", "); + builder.append("longArray="); + builder.append(java.util.Arrays.toString(this.longArray_)); + + builder.append(", "); + builder.append("nestedArray="); + builder.append(java.util.Arrays.deepToString(this.nestedArray_)); + + builder.append(", "); + builder.append("stringArray="); + builder.append(java.util.Arrays.toString(this.stringArray_)); + + builder.append(", "); + builder.append("charSeqTest="); + builder.append(this.charSeqTest_); + + builder.append(", "); + builder.append("wcharSeqTest="); + builder.append(this.wcharSeqTest_); + + builder.append(", "); + builder.append("octetSeqTest="); + builder.append(this.octetSeqTest_); + + builder.append(", "); + builder.append("shortSeqTest="); + builder.append(this.shortSeqTest_); + + builder.append(", "); + builder.append("ushortSeqTest="); + builder.append(this.ushortSeqTest_); + + builder.append(", "); + builder.append("longSeqTest="); + builder.append(this.longSeqTest_); + + builder.append(", "); + builder.append("ulongSeqTest="); + builder.append(this.ulongSeqTest_); + + builder.append(", "); + builder.append("longlongSeqtest="); + builder.append(this.longlongSeqtest_); + + builder.append(", "); + builder.append("ulonglongSeqTest="); + builder.append(this.ulonglongSeqTest_); + + builder.append(", "); + builder.append("floatSeqTest="); + builder.append(this.floatSeqTest_); + + builder.append(", "); + builder.append("doubleSeqTest="); + builder.append(this.doubleSeqTest_); + + builder.append(", "); + builder.append("booleanSeqTest="); + builder.append(this.booleanSeqTest_); + + builder.append(", "); + builder.append("nestedSeqTest="); + builder.append(this.nestedSeqTest_); + + builder.append(", "); + builder.append("stringSeqTest="); + builder.append(this.stringSeqTest_); + + + builder.append("}"); + return builder.toString(); + } + + private char charTest_; + private char wcharTest_; + private byte octetTest_; + private short shortTest_; + private int ushortTest_; + private int longTest_; + private long ulongTest_; + private long longlongTest_; + private long ulonglongTest_; + private float floatTest_; + private double doubleTest_; + private boolean booleanTest_; + private us.ihmc.idl.generated.IDLElement.Color colorTest_; + private us.ihmc.idl.generated.IDLNestedElement.NestedElement nestedElementTest_; + private java.lang.StringBuilder stringTest_; + private int[] longArray_; + private us.ihmc.idl.generated.IDLNestedElement.NestedElement[][] nestedArray_; + private java.lang.StringBuilder[] stringArray_; + private us.ihmc.idl.IDLSequence.Char charSeqTest_; + private us.ihmc.idl.IDLSequence.Char wcharSeqTest_; + private us.ihmc.idl.IDLSequence.Byte octetSeqTest_; + private us.ihmc.idl.IDLSequence.Short shortSeqTest_; + private us.ihmc.idl.IDLSequence.Integer ushortSeqTest_; + private us.ihmc.idl.IDLSequence.Integer longSeqTest_; + private us.ihmc.idl.IDLSequence.Long ulongSeqTest_; + private us.ihmc.idl.IDLSequence.Long longlongSeqtest_; + private us.ihmc.idl.IDLSequence.Long ulonglongSeqTest_; + private us.ihmc.idl.IDLSequence.Float floatSeqTest_; + private us.ihmc.idl.IDLSequence.Double doubleSeqTest_; + private us.ihmc.idl.IDLSequence.Boolean booleanSeqTest_; + private us.ihmc.idl.IDLSequence.Object nestedSeqTest_; + private us.ihmc.idl.IDLSequence.StringBuilderHolder stringSeqTest_; + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTestPubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTestPubSubType.java new file mode 100644 index 00000000..edbb3945 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLElement/IDLElementTestPubSubType.java @@ -0,0 +1,662 @@ +package us.ihmc.idl.generated.IDLElement; + +/** +* +* Topic data type of the struct "IDLElementTest" defined in "IDLElementTest.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from IDLElementTest.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit IDLElementTest.idl instead. +* +*/ +public class IDLElementTestPubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "IDLElement::IDLElementTest"; + + + + public IDLElementTestPubSubType() + { + + } + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.idl.generated.IDLElement.IDLElementTest data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 255 + 1; + + current_alignment += ((10) * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + for(int a = 0; a < (5 * 3); ++a) + { + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getMaxCdrSerializedSize(current_alignment);} + for(int a = 0; a < (4); ++a) + { + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 255 + 1; + } + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 2) + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 2) + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (25 * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < 25; ++a) + { + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getMaxCdrSerializedSize(current_alignment);} + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < 25; ++a) + { + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 255 + 1; + } + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.IDLElement.IDLElementTest data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.IDLElement.IDLElementTest data, int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += 8 + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + current_alignment += 1 + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getCdrSerializedSize(data.getNestedElementTest(), current_alignment); + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + data.getStringTest().length() + 1; + + current_alignment += ((10) * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < data.getNestedArray().length; ++a) + { + for(int b = 0; b < data.getNestedArray()[a].length; ++b) + { + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getCdrSerializedSize(data.getNestedArray()[a][b], current_alignment); + } + } + for(int a = 0; a < data.getStringArray().length; ++a) + { + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + data.getStringArray()[a].length() + 1; + + } + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getCharSeqTest().size() * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getWcharSeqTest().size() * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getOctetSeqTest().size() * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getShortSeqTest().size() * 2) + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getUshortSeqTest().size() * 2) + us.ihmc.idl.CDR.alignment(current_alignment, 2); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getLongSeqTest().size() * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getUlongSeqTest().size() * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getLonglongSeqtest().size() * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getUlonglongSeqTest().size() * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getFloatSeqTest().size() * 4) + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getDoubleSeqTest().size() * 8) + us.ihmc.idl.CDR.alignment(current_alignment, 8); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + current_alignment += (data.getBooleanSeqTest().size() * 1) + us.ihmc.idl.CDR.alignment(current_alignment, 1); + + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < data.getNestedSeqTest().size(); ++a) + { + current_alignment += us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.getCdrSerializedSize(data.getNestedSeqTest().get(a), current_alignment);} + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + for(int a = 0; a < data.getStringSeqTest().size(); ++a) + { + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + data.getStringSeqTest().get(a).length() + 1; + } + + return current_alignment - initial_alignment; + } + + public static void write(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.idl.CDR cdr) + { + + cdr.write_type_8(data.getCharTest()); + + cdr.write_type_14(data.getWcharTest()); + + cdr.write_type_9(data.getOctetTest()); + + cdr.write_type_1(data.getShortTest()); + + cdr.write_type_3(data.getUshortTest()); + + cdr.write_type_2(data.getLongTest()); + + cdr.write_type_4(data.getUlongTest()); + + cdr.write_type_11(data.getLonglongTest()); + + cdr.write_type_12(data.getUlonglongTest()); + + cdr.write_type_5(data.getFloatTest()); + + cdr.write_type_6(data.getDoubleTest()); + + cdr.write_type_7(data.getBooleanTest()); + + cdr.write_type_c(data.getColorTest().ordinal()); + + + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.write(data.getNestedElementTest(), cdr); + + if(data.getStringTest().length() <= 255) + cdr.write_type_d(data.getStringTest());else + throw new RuntimeException("stringTest field exceeds the maximum length"); + + for(int a = 0; a < data.getLongArray().length; ++a) + { + cdr.write_type_2(data.getLongArray()[a]); + } + + + for(int a = 0; a < data.getNestedArray().length; ++a) + { + for(int b = 0; b < data.getNestedArray()[a].length; ++b) + { + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.write(data.getNestedArray()[a][b], cdr); + } + } + + + for(int a = 0; a < data.getStringArray().length; ++a) + { + cdr.write_type_d(data.getStringArray()[a]); + } + + + if(data.getCharSeqTest().size() <= 25) + cdr.write_type_e(data.getCharSeqTest());else + throw new RuntimeException("charSeqTest field exceeds the maximum length"); + + if(data.getWcharSeqTest().size() <= 25) + cdr.write_type_e(data.getWcharSeqTest());else + throw new RuntimeException("wcharSeqTest field exceeds the maximum length"); + + if(data.getOctetSeqTest().size() <= 25) + cdr.write_type_e(data.getOctetSeqTest());else + throw new RuntimeException("octetSeqTest field exceeds the maximum length"); + + if(data.getShortSeqTest().size() <= 25) + cdr.write_type_e(data.getShortSeqTest());else + throw new RuntimeException("shortSeqTest field exceeds the maximum length"); + + if(data.getUshortSeqTest().size() <= 25) + cdr.write_type_e(data.getUshortSeqTest());else + throw new RuntimeException("ushortSeqTest field exceeds the maximum length"); + + if(data.getLongSeqTest().size() <= 25) + cdr.write_type_e(data.getLongSeqTest());else + throw new RuntimeException("longSeqTest field exceeds the maximum length"); + + if(data.getUlongSeqTest().size() <= 25) + cdr.write_type_e(data.getUlongSeqTest());else + throw new RuntimeException("ulongSeqTest field exceeds the maximum length"); + + if(data.getLonglongSeqtest().size() <= 25) + cdr.write_type_e(data.getLonglongSeqtest());else + throw new RuntimeException("longlongSeqtest field exceeds the maximum length"); + + if(data.getUlonglongSeqTest().size() <= 25) + cdr.write_type_e(data.getUlonglongSeqTest());else + throw new RuntimeException("ulonglongSeqTest field exceeds the maximum length"); + + if(data.getFloatSeqTest().size() <= 25) + cdr.write_type_e(data.getFloatSeqTest());else + throw new RuntimeException("floatSeqTest field exceeds the maximum length"); + + if(data.getDoubleSeqTest().size() <= 25) + cdr.write_type_e(data.getDoubleSeqTest());else + throw new RuntimeException("doubleSeqTest field exceeds the maximum length"); + + if(data.getBooleanSeqTest().size() <= 25) + cdr.write_type_e(data.getBooleanSeqTest());else + throw new RuntimeException("booleanSeqTest field exceeds the maximum length"); + + if(data.getNestedSeqTest().size() <= 25) + cdr.write_type_e(data.getNestedSeqTest());else + throw new RuntimeException("nestedSeqTest field exceeds the maximum length"); + + if(data.getStringSeqTest().size() <= 25) + cdr.write_type_e(data.getStringSeqTest());else + throw new RuntimeException("stringSeqTest field exceeds the maximum length"); + } + + public static void read(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.idl.CDR cdr) + { + + data.setCharTest(cdr.read_type_8()); + + + data.setWcharTest(cdr.read_type_14()); + + + data.setOctetTest(cdr.read_type_9()); + + + data.setShortTest(cdr.read_type_1()); + + + data.setUshortTest(cdr.read_type_3()); + + + data.setLongTest(cdr.read_type_2()); + + + data.setUlongTest(cdr.read_type_4()); + + + data.setLonglongTest(cdr.read_type_11()); + + + data.setUlonglongTest(cdr.read_type_12()); + + + data.setFloatTest(cdr.read_type_5()); + + + data.setDoubleTest(cdr.read_type_6()); + + + data.setBooleanTest(cdr.read_type_7()); + + + data.setColorTest(us.ihmc.idl.generated.IDLElement.Color.values[cdr.read_type_c()]); + + + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.read(data.getNestedElementTest(), cdr); + + cdr.read_type_d(data.getStringTest()); + + for(int a = 0; a < data.getLongArray().length; ++a) + { + data.getLongArray()[a] = cdr.read_type_2(); + + } + + + for(int a = 0; a < data.getNestedArray().length; ++a) + { + for(int b = 0; b < data.getNestedArray()[a].length; ++b) + { + us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType.read(data.getNestedArray()[a][b], cdr); + } + } + + + for(int a = 0; a < data.getStringArray().length; ++a) + { + cdr.read_type_d(data.getStringArray()[a]); + } + + + cdr.read_type_e(data.getCharSeqTest()); + + cdr.read_type_e(data.getWcharSeqTest()); + + cdr.read_type_e(data.getOctetSeqTest()); + + cdr.read_type_e(data.getShortSeqTest()); + + cdr.read_type_e(data.getUshortSeqTest()); + + cdr.read_type_e(data.getLongSeqTest()); + + cdr.read_type_e(data.getUlongSeqTest()); + + cdr.read_type_e(data.getLonglongSeqtest()); + + cdr.read_type_e(data.getUlonglongSeqTest()); + + cdr.read_type_e(data.getFloatSeqTest()); + + cdr.read_type_e(data.getDoubleSeqTest()); + + cdr.read_type_e(data.getBooleanSeqTest()); + + cdr.read_type_e(data.getNestedSeqTest()); + + cdr.read_type_e(data.getStringSeqTest()); + } + + @Override + public final void serialize(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_8("charTest", data.getCharTest()); + + ser.write_type_14("wcharTest", data.getWcharTest()); + + ser.write_type_9("octetTest", data.getOctetTest()); + + ser.write_type_1("shortTest", data.getShortTest()); + + ser.write_type_3("ushortTest", data.getUshortTest()); + + ser.write_type_2("longTest", data.getLongTest()); + + ser.write_type_4("ulongTest", data.getUlongTest()); + + ser.write_type_11("longlongTest", data.getLonglongTest()); + + ser.write_type_12("ulonglongTest", data.getUlonglongTest()); + + ser.write_type_5("floatTest", data.getFloatTest()); + + ser.write_type_6("doubleTest", data.getDoubleTest()); + + ser.write_type_7("booleanTest", data.getBooleanTest()); + + ser.write_type_c("colorTest", data.getColorTest()); + + ser.write_type_a("nestedElementTest", new us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType(), data.getNestedElementTest()); + + + ser.write_type_d("stringTest", data.getStringTest()); + + ser.write_type_f("longArray", data.getLongArray()); + ser.write_type_f("nestedArray", new us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType(), data.getNestedArray()); + ser.write_type_f("stringArray", data.getStringArray()); + ser.write_type_e("charSeqTest", data.getCharSeqTest()); + + ser.write_type_e("wcharSeqTest", data.getWcharSeqTest()); + + ser.write_type_e("octetSeqTest", data.getOctetSeqTest()); + + ser.write_type_e("shortSeqTest", data.getShortSeqTest()); + + ser.write_type_e("ushortSeqTest", data.getUshortSeqTest()); + + ser.write_type_e("longSeqTest", data.getLongSeqTest()); + + ser.write_type_e("ulongSeqTest", data.getUlongSeqTest()); + + ser.write_type_e("longlongSeqtest", data.getLonglongSeqtest()); + + ser.write_type_e("ulonglongSeqTest", data.getUlonglongSeqTest()); + + ser.write_type_e("floatSeqTest", data.getFloatSeqTest()); + + ser.write_type_e("doubleSeqTest", data.getDoubleSeqTest()); + + ser.write_type_e("booleanSeqTest", data.getBooleanSeqTest()); + + ser.write_type_e("nestedSeqTest", data.getNestedSeqTest()); + + ser.write_type_e("stringSeqTest", data.getStringSeqTest()); + + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.idl.generated.IDLElement.IDLElementTest data) + { + data.setCharTest(ser.read_type_8("charTest")); + + data.setWcharTest(ser.read_type_14("wcharTest")); + + data.setOctetTest(ser.read_type_9("octetTest")); + + data.setShortTest(ser.read_type_1("shortTest")); + + data.setUshortTest(ser.read_type_3("ushortTest")); + + data.setLongTest(ser.read_type_2("longTest")); + + data.setUlongTest(ser.read_type_4("ulongTest")); + + data.setLonglongTest(ser.read_type_11("longlongTest")); + + data.setUlonglongTest(ser.read_type_12("ulonglongTest")); + + data.setFloatTest(ser.read_type_5("floatTest")); + + data.setDoubleTest(ser.read_type_6("doubleTest")); + + data.setBooleanTest(ser.read_type_7("booleanTest")); + + data.setColorTest((us.ihmc.idl.generated.IDLElement.Color)ser.read_type_c("colorTest", us.ihmc.idl.generated.IDLElement.Color.class)); + + + ser.read_type_a("nestedElementTest", new us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType(), data.getNestedElementTest()); + + + ser.read_type_d("stringTest", data.getStringTest()); + + ser.read_type_f("longArray", data.getLongArray()); + + + ser.read_type_f("nestedArray", new us.ihmc.idl.generated.IDLNestedElement.NestedElementPubSubType(), data.getNestedArray()); + + + ser.read_type_f("stringArray", data.getStringArray()); + + + ser.read_type_e("charSeqTest", data.getCharSeqTest()); + + ser.read_type_e("wcharSeqTest", data.getWcharSeqTest()); + + ser.read_type_e("octetSeqTest", data.getOctetSeqTest()); + + ser.read_type_e("shortSeqTest", data.getShortSeqTest()); + + ser.read_type_e("ushortSeqTest", data.getUshortSeqTest()); + + ser.read_type_e("longSeqTest", data.getLongSeqTest()); + + ser.read_type_e("ulongSeqTest", data.getUlongSeqTest()); + + ser.read_type_e("longlongSeqtest", data.getLonglongSeqtest()); + + ser.read_type_e("ulonglongSeqTest", data.getUlonglongSeqTest()); + + ser.read_type_e("floatSeqTest", data.getFloatSeqTest()); + + ser.read_type_e("doubleSeqTest", data.getDoubleSeqTest()); + + ser.read_type_e("booleanSeqTest", data.getBooleanSeqTest()); + + ser.read_type_e("nestedSeqTest", data.getNestedSeqTest()); + + ser.read_type_e("stringSeqTest", data.getStringSeqTest()); + + } + + public static void staticCopy(us.ihmc.idl.generated.IDLElement.IDLElementTest src, us.ihmc.idl.generated.IDLElement.IDLElementTest dest) + { + dest.set(src); + } + + + @Override + public us.ihmc.idl.generated.IDLElement.IDLElementTest createData() + { + return new us.ihmc.idl.generated.IDLElement.IDLElementTest(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(us.ihmc.idl.generated.IDLElement.IDLElementTest data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(us.ihmc.idl.generated.IDLElement.IDLElementTest src, us.ihmc.idl.generated.IDLElement.IDLElementTest dest) + { + staticCopy(src, dest); + } + + + @Override + public IDLElementTestPubSubType newInstance() + { + return new IDLElementTestPubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElement.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElement.java new file mode 100644 index 00000000..ce480188 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElement.java @@ -0,0 +1,98 @@ +package us.ihmc.idl.generated.IDLNestedElement; +/** +* +* Definition of the class "NestedElement" defined in NestedElement.idl. +* +* This file was automatically generated from NestedElement.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit NestedElement.idl instead. +* +*/ +public class NestedElement +{ + public NestedElement() + { + stringTest_ = new java.lang.StringBuilder(255); + + + } + + public void set(NestedElement other) + { + stringTest_.setLength(0); + stringTest_.append(other.stringTest_); + longTest_ = other.longTest_; + + } + + public void setStringTest(String stringTest) + { + stringTest_.setLength(0); + stringTest_.append(stringTest); + } + + public java.lang.String getStringTestAsString() + { + return getStringTest().toString(); + } + + public java.lang.StringBuilder getStringTest() + { + return stringTest_; + } + + + public void setLongTest(int longTest) + { + longTest_ = longTest; + } + + public int getLongTest() + { + return longTest_; + } + + + + + + + @Override + public boolean equals(java.lang.Object other) + { + if(other == null) return false; + if(other == this) return true; + if(!(other instanceof NestedElement)) return false; + NestedElement otherMyClass = (NestedElement)other; + boolean returnedValue = true; + + returnedValue &= us.ihmc.idl.IDLTools.equals(this.stringTest_, otherMyClass.stringTest_); + + returnedValue &= this.longTest_ == otherMyClass.longTest_; + + + + return returnedValue; + } + + @Override + public java.lang.String toString() + { + StringBuilder builder = new StringBuilder(); + + builder.append("NestedElement {"); + builder.append("stringTest="); + builder.append(this.stringTest_); + + builder.append(", "); + builder.append("longTest="); + builder.append(this.longTest_); + + + builder.append("}"); + return builder.toString(); + } + + private java.lang.StringBuilder stringTest_; + private int longTest_; + +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElementPubSubType.java b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElementPubSubType.java new file mode 100644 index 00000000..ec9fa6c3 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/generated-java/us/ihmc/idl/generated/IDLNestedElement/NestedElementPubSubType.java @@ -0,0 +1,159 @@ +package us.ihmc.idl.generated.IDLNestedElement; + +/** +* +* Topic data type of the struct "NestedElement" defined in "NestedElement.idl". Use this class to provide the TopicDataType to a Participant. +* +* This file was automatically generated from NestedElement.idl by us.ihmc.idl.generator.IDLGenerator. +* Do not update this file directly, edit NestedElement.idl instead. +* +*/ +public class NestedElementPubSubType implements us.ihmc.pubsub.TopicDataType +{ + public static final java.lang.String name = "IDLNestedElement::NestedElement"; + + + + public NestedElementPubSubType() + { + + } + + private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR(); + private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR(); + + + @Override + public void serialize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException + { + serializeCDR.serialize(serializedPayload); + write(data, serializeCDR); + serializeCDR.finishSerialize(); + } + @Override + public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.idl.generated.IDLNestedElement.NestedElement data) throws java.io.IOException + { + deserializeCDR.deserialize(serializedPayload); + read(data, deserializeCDR); + deserializeCDR.finishDeserialize(); + } + + public static int getMaxCdrSerializedSize() + { + return getMaxCdrSerializedSize(0); + } + + public static int getMaxCdrSerializedSize(int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; + } + + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data) + { + return getCdrSerializedSize(data, 0); + } + + public final static int getCdrSerializedSize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, int current_alignment) + { + int initial_alignment = current_alignment; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + data.getStringTest().length() + 1; + + current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; + } + + public static void write(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.idl.CDR cdr) + { + + if(data.getStringTest().length() <= 255) + cdr.write_type_d(data.getStringTest());else + throw new RuntimeException("stringTest field exceeds the maximum length"); + + cdr.write_type_2(data.getLongTest()); + } + + public static void read(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.idl.CDR cdr) + { + + cdr.read_type_d(data.getStringTest()); + + data.setLongTest(cdr.read_type_2()); + + } + + @Override + public final void serialize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.idl.InterchangeSerializer ser) + { + ser.write_type_d("stringTest", data.getStringTest()); + + ser.write_type_2("longTest", data.getLongTest()); + + } + + @Override + public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.idl.generated.IDLNestedElement.NestedElement data) + { + ser.read_type_d("stringTest", data.getStringTest()); + + data.setLongTest(ser.read_type_2("longTest")); + + } + + public static void staticCopy(us.ihmc.idl.generated.IDLNestedElement.NestedElement src, us.ihmc.idl.generated.IDLNestedElement.NestedElement dest) + { + dest.set(src); + } + + + @Override + public us.ihmc.idl.generated.IDLNestedElement.NestedElement createData() + { + return new us.ihmc.idl.generated.IDLNestedElement.NestedElement(); + } + + + @Override + public int getTypeSize() + { + return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize()); + } + + @Override + public java.lang.String getName() + { + return name; + } + + public void serialize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.idl.CDR cdr) + { + write(data, cdr); + } + + public void deserialize(us.ihmc.idl.generated.IDLNestedElement.NestedElement data, us.ihmc.idl.CDR cdr) + { + read(data, cdr); + } + + public void copy(us.ihmc.idl.generated.IDLNestedElement.NestedElement src, us.ihmc.idl.generated.IDLNestedElement.NestedElement dest) + { + staticCopy(src, dest); + } + + + @Override + public NestedElementPubSubType newInstance() + { + return new NestedElementPubSubType(); + } +} \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/idl/IDLElementTest.idl b/ihmc-pub-sub-generator/src/test/idl/IDLElementTest.idl new file mode 100644 index 00000000..4fe9f7a8 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/idl/IDLElementTest.idl @@ -0,0 +1,68 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "NestedElement.idl" + +module IDLElement +{ + + enum Color + { + red, + green, + blue + }; + + struct IDLElementTest + { + char charTest; + wchar wcharTest; + octet octetTest; + short shortTest; + unsigned short ushortTest; + long longTest; + unsigned long ulongTest; + long long longlongTest; + unsigned long long ulonglongTest; + float floatTest; + double doubleTest; + boolean booleanTest; + Color colorTest; + IDLNestedElement::NestedElement nestedElementTest; + string stringTest; + + long longArray[10]; + IDLNestedElement::NestedElement nestedArray[5][3]; + string stringArray[4]; + + sequence charSeqTest; + sequence wcharSeqTest; + sequence octetSeqTest; + sequence shortSeqTest; + sequence ushortSeqTest; + sequence longSeqTest; + sequence ulongSeqTest; + sequence longlongSeqtest; + sequence ulonglongSeqTest; + sequence floatSeqTest; + sequence doubleSeqTest; + sequence booleanSeqTest; + sequence nestedSeqTest; + sequence stringSeqTest; + + + }; + +}; diff --git a/ihmc-pub-sub-generator/src/test/idl/NestedElement.idl b/ihmc-pub-sub-generator/src/test/idl/NestedElement.idl new file mode 100644 index 00000000..aedca4f6 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/idl/NestedElement.idl @@ -0,0 +1,23 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module IDLNestedElement +{ + struct NestedElement + { + string stringTest; + long longTest; + }; +}; \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/idl/Vector.idl b/ihmc-pub-sub-generator/src/test/idl/Vector.idl new file mode 100644 index 00000000..2e804a7d --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/idl/Vector.idl @@ -0,0 +1,47 @@ +/** + * Copyright 2017 Florida Institute for Human and Machine Cognition (IHMC) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + module Geometry{ + + @Abstract(type="java.lang.Object", impl="null") + @TypeCode(type="Geometry::Vector") + struct Vector { + string<128> frame; + + double x; + double y; + double z; + + sequence bla; + double waa[3]; + }; + + + struct Box{ + Vector center; + double w; + double l; + double h; + }; + + struct Polygon{ + sequence points; + }; + + struct Triangle{ + Vector points[3]; + }; + }; \ No newline at end of file diff --git a/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/Chat/ChatMessageTest.java b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/Chat/ChatMessageTest.java new file mode 100644 index 00000000..5f8a583d --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/Chat/ChatMessageTest.java @@ -0,0 +1,48 @@ +package us.ihmc.idl.Chat; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.io.IOException; + +import org.junit.Test; + +import us.ihmc.idl.generated.Chat.ChatMessage; +import us.ihmc.idl.generated.Chat.ChatMessagePubSubType; +import us.ihmc.pubsub.common.SerializedPayload; + +public class ChatMessageTest +{ + @Test(timeout = 30000) + public void testHelloWorld() throws IOException + { + byte[] javaHelloWorld = {(byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, 0x05, 0x00, 0x00, 0x00, 0x4a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, + 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x00}; + String senderIn = "Java"; + String msgIn = "Hello World"; + + ChatMessage msg = new ChatMessage(); + msg.getSender().append(senderIn); + msg.getMsg().append(msgIn); + + ChatMessagePubSubType type = new ChatMessagePubSubType(); + SerializedPayload payload = new SerializedPayload(type.getTypeSize()); + + type.serialize(msg, payload); + + byte[] data = new byte[payload.getData().limit()]; + payload.getData().get(data); + + assertArrayEquals(javaHelloWorld, data); + + ChatMessage invertedMsg = new ChatMessage(); + SerializedPayload invertedPayload = new SerializedPayload(type.getTypeSize()); + invertedPayload.getData().put(javaHelloWorld); + invertedPayload.getData().flip(); + type.deserialize(invertedPayload, invertedMsg); + + assertEquals(invertedMsg.getSender().toString(), senderIn); + assertEquals(invertedMsg.getMsg().toString(), msgIn); + + } +} diff --git a/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/GenerateIDLElementTest.java b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/GenerateIDLElementTest.java new file mode 100644 index 00000000..96a1e641 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/GenerateIDLElementTest.java @@ -0,0 +1,43 @@ +package us.ihmc.idl; + +import us.ihmc.idl.generator.IDLGenerator; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; + +public class GenerateIDLElementTest +{ + /** + * Must be run from $MODULE_DIR$!!! + */ + public static void main(String[] args) throws IOException + { + ArrayList idlList = new ArrayList<>(); + + Path idlPath = Paths.get("idl"); + + System.out.println(idlPath.toAbsolutePath()); + + for (Path idl : Files.list(idlPath).toArray(Path[]::new)) + { + idlList.add(idl.toFile()); + } + + ArrayList includeList = new ArrayList<>(); + includeList.add(Paths.get(".").toFile()); + includeList.add(Paths.get("idl").toFile()); + + String packagePrefix = "us.ihmc.idl.generated"; + + File targetDirectory = new File("generated-java"); + + for (File idl : idlList) + { + IDLGenerator.execute(idl, packagePrefix, targetDirectory, includeList); + } + } +} diff --git a/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestCPPData.java b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestCPPData.java new file mode 100644 index 00000000..979d81e4 --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestCPPData.java @@ -0,0 +1,155 @@ +package us.ihmc.idl.IDLElement; + +/** + * This class contains the serialized data as created by the classes generated from IDLElementTest using fastrtpsgen + * + * @author Jesper Smith + * + */ +public class IDLElementTestCPPData +{ + + /** + * Output of the C++ program SerializationTest, found in cppsrc/test + */ + + static byte[] cppData = {(byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x33, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xa9, (byte) 0x03, + (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0xf0, (byte) 0xff, (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0a, + (byte) 0x1d, (byte) 0xff, (byte) 0xff, (byte) 0x92, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0xf3, (byte) 0x49, (byte) 0x9f, (byte) 0xfa, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0xe1, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x4e, (byte) 0x18, (byte) 0x7c, (byte) 0x48, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x28, (byte) 0xfe, + (byte) 0xd8, (byte) 0x08, (byte) 0x69, (byte) 0x1b, (byte) 0x01, (byte) 0x42, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x4e, (byte) 0x65, (byte) 0x73, (byte) 0x74, + (byte) 0x65, (byte) 0x64, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x09, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x57, (byte) 0x6f, (byte) 0x6c, (byte) 0x6f, (byte) 0x6c, (byte) 0x6f, (byte) 0x6c, (byte) 0x6f, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf8, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x74, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0x01, (byte) 0x00, (byte) 0x00, + (byte) 0x6c, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0xe8, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x03, (byte) 0x00, + (byte) 0x00, (byte) 0xe0, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x5c, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, + (byte) 0x30, (byte) 0x30, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x30, (byte) 0x31, + (byte) 0x00, (byte) 0x19, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, + (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x30, (byte) 0x32, (byte) 0x00, (byte) 0x1a, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, + (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x30, (byte) 0x00, (byte) 0x19, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x31, (byte) 0x00, (byte) 0x1d, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, + (byte) 0x3a, (byte) 0x31, (byte) 0x32, (byte) 0x00, (byte) 0x21, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, + (byte) 0x30, (byte) 0x00, (byte) 0x1a, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, + (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x31, (byte) 0x00, + (byte) 0x21, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, + (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x32, (byte) 0x00, (byte) 0x28, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, + (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x30, (byte) 0x00, (byte) 0x1b, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x31, (byte) 0x00, (byte) 0x25, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, + (byte) 0x33, (byte) 0x32, (byte) 0x00, (byte) 0x2f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x34, (byte) 0x30, + (byte) 0x00, (byte) 0x1c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, + (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x34, (byte) 0x31, (byte) 0x00, (byte) 0x29, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, + (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x34, (byte) 0x32, (byte) 0x00, (byte) 0x36, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, + (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x00, (byte) 0x00, + (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x00, (byte) 0x00, (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x72, + (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x44, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x00, (byte) 0x00, (byte) 0x05, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x31, (byte) 0x32, (byte) 0x33, (byte) 0x34, (byte) 0x35, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xa9, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0xa9, (byte) 0x03, (byte) 0x00, + (byte) 0x00, (byte) 0xa9, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0xa9, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0xa9, (byte) 0x03, + (byte) 0x00, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x04, (byte) 0x06, (byte) 0x08, (byte) 0x0a, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0xfd, (byte) 0xff, + (byte) 0xfb, (byte) 0xff, (byte) 0xf9, (byte) 0xff, (byte) 0xf7, (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x09, (byte) 0x00, + (byte) 0x06, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x0e, (byte) 0x00, (byte) 0x0a, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1a, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x96, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x12, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x8e, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x02, (byte) 0x00, + (byte) 0x00, (byte) 0x96, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x8e, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x86, (byte) 0x02, + (byte) 0x00, (byte) 0x00, (byte) 0x7e, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x76, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x0a, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x29, (byte) 0x2d, (byte) 0x00, (byte) 0x00, (byte) 0x52, (byte) 0x5a, (byte) 0x00, (byte) 0x00, + (byte) 0x7b, (byte) 0x87, (byte) 0x00, (byte) 0x00, (byte) 0xa4, (byte) 0xb4, (byte) 0x00, (byte) 0x00, (byte) 0xcd, (byte) 0xe1, (byte) 0x00, + (byte) 0x00, (byte) 0x52, (byte) 0x5a, (byte) 0x00, (byte) 0x00, (byte) 0xa4, (byte) 0xb4, (byte) 0x00, (byte) 0x00, (byte) 0xf6, (byte) 0x0e, + (byte) 0x01, (byte) 0x00, (byte) 0x48, (byte) 0x69, (byte) 0x01, (byte) 0x00, (byte) 0x9a, (byte) 0xc3, (byte) 0x01, (byte) 0x00, (byte) 0x0a, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x4e, (byte) 0x51, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x31, (byte) 0x56, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x14, (byte) 0x5b, (byte) 0xdf, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf7, (byte) 0x5f, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xda, (byte) 0x64, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x31, + (byte) 0x56, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf7, (byte) 0x5f, (byte) 0xdf, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xbd, (byte) 0x69, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x83, (byte) 0x73, (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x49, (byte) 0x7d, + (byte) 0xdf, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x13, (byte) 0x50, (byte) 0xfc, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x35, (byte) 0x9f, (byte) 0xf8, (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x57, (byte) 0xee, (byte) 0xf4, + (byte) 0x11, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x79, (byte) 0x3d, (byte) 0xf1, (byte) 0x17, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x9b, (byte) 0x8c, (byte) 0xed, (byte) 0x1d, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x35, + (byte) 0x9f, (byte) 0xf8, (byte) 0x0b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x79, (byte) 0x3d, (byte) 0xf1, (byte) 0x17, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xbd, (byte) 0xdb, (byte) 0xe9, (byte) 0x23, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x01, (byte) 0x7a, (byte) 0xe2, (byte) 0x2f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x45, (byte) 0x18, + (byte) 0xdb, (byte) 0x3b, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x57, (byte) 0xee, (byte) 0xf4, (byte) 0x11, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xbd, (byte) 0xdb, (byte) 0xe9, (byte) 0x23, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x23, (byte) 0xc9, (byte) 0xde, (byte) 0x35, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x89, (byte) 0xb6, (byte) 0xd3, + (byte) 0x47, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xef, (byte) 0xa3, (byte) 0xc8, (byte) 0x59, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xa0, (byte) 0xa2, (byte) 0x43, (byte) 0x00, + (byte) 0xa0, (byte) 0x22, (byte) 0x44, (byte) 0x00, (byte) 0xf0, (byte) 0x73, (byte) 0x44, (byte) 0x00, (byte) 0xa0, (byte) 0xa2, (byte) 0x44, + (byte) 0x00, (byte) 0x48, (byte) 0xcb, (byte) 0x44, (byte) 0x00, (byte) 0xa0, (byte) 0x22, (byte) 0x44, (byte) 0x00, (byte) 0xa0, (byte) 0xa2, + (byte) 0x44, (byte) 0x00, (byte) 0xf0, (byte) 0xf3, (byte) 0x44, (byte) 0x00, (byte) 0xa0, (byte) 0x22, (byte) 0x45, (byte) 0x00, (byte) 0x48, + (byte) 0x4b, (byte) 0x45, (byte) 0x00, (byte) 0xf0, (byte) 0x73, (byte) 0x44, (byte) 0x00, (byte) 0xf0, (byte) 0xf3, (byte) 0x44, (byte) 0x00, + (byte) 0xf4, (byte) 0x36, (byte) 0x45, (byte) 0x00, (byte) 0xf0, (byte) 0x73, (byte) 0x45, (byte) 0x00, (byte) 0x76, (byte) 0x98, (byte) 0x45, + (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xcf, (byte) 0xf7, (byte) 0x53, + (byte) 0xe3, (byte) 0xf5, (byte) 0x7b, (byte) 0xcd, (byte) 0x40, (byte) 0xcf, (byte) 0xf7, (byte) 0x53, (byte) 0xe3, (byte) 0xf5, (byte) 0x7b, + (byte) 0xdd, (byte) 0x40, (byte) 0xdb, (byte) 0xf9, (byte) 0x7e, (byte) 0x6a, (byte) 0xf8, (byte) 0x1c, (byte) 0xe6, (byte) 0x40, (byte) 0xcf, + (byte) 0xf7, (byte) 0x53, (byte) 0xe3, (byte) 0xf5, (byte) 0x7b, (byte) 0xed, (byte) 0x40, (byte) 0xe1, (byte) 0x7a, (byte) 0x14, (byte) 0xae, + (byte) 0x79, (byte) 0x6d, (byte) 0xf2, (byte) 0x40, (byte) 0xcf, (byte) 0xf7, (byte) 0x53, (byte) 0xe3, (byte) 0xf5, (byte) 0x7b, (byte) 0xdd, + (byte) 0x40, (byte) 0xcf, (byte) 0xf7, (byte) 0x53, (byte) 0xe3, (byte) 0xf5, (byte) 0x7b, (byte) 0xed, (byte) 0x40, (byte) 0xdb, (byte) 0xf9, + (byte) 0x7e, (byte) 0x6a, (byte) 0xf8, (byte) 0x1c, (byte) 0xf6, (byte) 0x40, (byte) 0xcf, (byte) 0xf7, (byte) 0x53, (byte) 0xe3, (byte) 0xf5, + (byte) 0x7b, (byte) 0xfd, (byte) 0x40, (byte) 0xe1, (byte) 0x7a, (byte) 0x14, (byte) 0xae, (byte) 0x79, (byte) 0x6d, (byte) 0x02, (byte) 0x41, + (byte) 0xdb, (byte) 0xf9, (byte) 0x7e, (byte) 0x6a, (byte) 0xf8, (byte) 0x1c, (byte) 0xe6, (byte) 0x40, (byte) 0xdb, (byte) 0xf9, (byte) 0x7e, + (byte) 0x6a, (byte) 0xf8, (byte) 0x1c, (byte) 0xf6, (byte) 0x40, (byte) 0x64, (byte) 0x3b, (byte) 0xdf, (byte) 0x4f, (byte) 0xba, (byte) 0x95, + (byte) 0x00, (byte) 0x41, (byte) 0xdb, (byte) 0xf9, (byte) 0x7e, (byte) 0x6a, (byte) 0xf8, (byte) 0x1c, (byte) 0x06, (byte) 0x41, (byte) 0x52, + (byte) 0xb8, (byte) 0x1e, (byte) 0x85, (byte) 0x36, (byte) 0xa4, (byte) 0x0b, (byte) 0x41, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0f, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x30, + (byte) 0x00, (byte) 0x00, (byte) 0x1d, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x31, (byte) 0x00, (byte) 0x00, (byte) 0x3a, (byte) 0x04, (byte) 0x00, (byte) 0x00, + (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x32, (byte) 0x00, + (byte) 0x00, (byte) 0x57, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x33, (byte) 0x00, (byte) 0x00, (byte) 0x74, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x07, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x34, (byte) 0x00, (byte) 0x00, + (byte) 0x91, (byte) 0x0a, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, + (byte) 0x3a, (byte) 0x32, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x3a, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x31, (byte) 0x00, (byte) 0x00, (byte) 0x74, + (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, + (byte) 0x32, (byte) 0x32, (byte) 0x00, (byte) 0x00, (byte) 0xae, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x33, (byte) 0x00, (byte) 0x00, (byte) 0xe8, (byte) 0x10, + (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, + (byte) 0x34, (byte) 0x00, (byte) 0x00, (byte) 0x22, (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x57, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x31, + (byte) 0x00, (byte) 0x00, (byte) 0xae, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x32, (byte) 0x00, (byte) 0x00, (byte) 0x05, (byte) 0x13, (byte) 0x00, (byte) 0x00, + (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x33, (byte) 0x00, + (byte) 0x00, (byte) 0x5c, (byte) 0x19, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x64, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x34, (byte) 0x00, (byte) 0x00, (byte) 0xb3, (byte) 0x1f, (byte) 0x00, (byte) 0x00, (byte) 0x0f, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, + (byte) 0x3a, (byte) 0x31, (byte) 0x30, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x31, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x32, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, + (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x33, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x31, (byte) 0x34, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x30, (byte) 0x00, (byte) 0x08, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x31, (byte) 0x00, (byte) 0x08, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x32, (byte) 0x00, + (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, (byte) 0x33, + (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x32, + (byte) 0x34, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, + (byte) 0x33, (byte) 0x30, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, (byte) 0x6d, + (byte) 0x3a, (byte) 0x33, (byte) 0x31, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, (byte) 0x69, + (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x32, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, (byte) 0x64, + (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x33, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x73, + (byte) 0x64, (byte) 0x69, (byte) 0x6d, (byte) 0x3a, (byte) 0x33, (byte) 0x34, (byte) 0x00}; +} diff --git a/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestTest.java b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestTest.java new file mode 100644 index 00000000..f5b266bd --- /dev/null +++ b/ihmc-pub-sub-generator/src/test/java/us/ihmc/idl/IDLElement/IDLElementTestTest.java @@ -0,0 +1,362 @@ +package us.ihmc.idl.IDLElement; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +import java.io.IOException; + +import org.junit.Test; + +import us.ihmc.idl.generated.IDLElement.Color; +import us.ihmc.idl.generated.IDLElement.IDLElementTest; +import us.ihmc.idl.generated.IDLElement.IDLElementTestPubSubType; +import us.ihmc.idl.generated.IDLNestedElement.NestedElement; +import us.ihmc.pubsub.common.SerializedPayload; + +/** + * Test cases for the IDLElementTest type. + * + * IDLElementTest contains all supported types, this class makes sure it gets correctly serialized, the equals and set methods works + * and the serialized byte stream corresponds to one serialized using the c++ classes created by fastrtpsgen. + * + * @author Jesper Smith + * + */ +public class IDLElementTestTest +{ + private void populateIDLElementTest(IDLElementTest test) + { + + test.setCharTest('3'); + test.setWcharTest('\u03a9'); + test.setOctetTest((byte) 0xa); + test.setShortTest((short) -16); + test.setUshortTest(15); + test.setLongTest(-58102); + test.setUlongTest(914); + test.setLonglongTest(-90224141); + test.setUlonglongTest(582142); + test.setFloatTest(258145.2143f); + test.setDoubleTest(9184289051.1241); + test.setBooleanTest(true); + test.setColorTest(Color.blue); + test.getNestedElementTest().setLongTest(518); + test.getNestedElementTest().getStringTest().append("Nested"); + test.getStringTest().append("Wolololo"); + + for (int i = 0; i < 10; i++) + { + test.getLongArray()[i] = i * 124; + } + + for (int a = 0; a < 5; a++) + { + for (int b = 0; b < 3; b++) + { + test.getNestedArray()[a][b].setLongTest(a + a * b * 3 + b + 24); + test.getNestedArray()[a][b].getStringTest().append("arrayDim:" + a + b); + } + } + + for (int i = 0; i < 4; i++) + { + test.getStringArray()[i].append("arrayDim:" + i); + } + + for (int s = 1; s < 4; s++) + { + for (int w = 0; w < 5; w++) + { + int i = s + s * w; + + switch (s) + { + case 1: + test.getCharSeqTest().add(String.valueOf(i).charAt(0)); + test.getWcharSeqTest().add('\u03a9'); + test.getOctetSeqTest().add((byte) (i * 2)); + test.getShortSeqTest().add((short) (-2 * i + 1)); + test.getBooleanSeqTest().add(i % 2 == 0); + case 2: + test.getUshortSeqTest().add(i + 4); + test.getLongSeqTest().add(i * 124 - 98); + test.getUlongSeqTest().add(i * 11561); + test.getLonglongSeqtest().add(-2143125l + i * 1251); + case 3: + test.getUlonglongSeqTest().add(241l + i * 100421410l); + test.getFloatSeqTest().add(325.25f * i); + test.getDoubleSeqTest().add(15095.921 * i); + NestedElement elem = test.getNestedSeqTest().add(); + elem.setLongTest(i * 541); + elem.getStringTest().append("dim:" + s + w); + StringBuilder builder = test.getStringSeqTest().add(); + builder.append("sdim:" + s + w); + + } + } + } + } + + public IDLElementTest createPopulatedIDLElementTest() + { + IDLElementTest idlElementTest = new IDLElementTest(); + populateIDLElementTest(idlElementTest); + return idlElementTest; + } + + @Test(timeout = 30000) + public void testIDLElementEquals() + { + IDLElementTest orig = createPopulatedIDLElementTest(); + + IDLElementTest test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setCharTest('4'); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setWcharTest('z'); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setOctetTest((byte) 0xb); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setShortTest((short) -1); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setUshortTest(1); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setLongTest(-5102); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setUlongTest(14); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setLonglongTest(-9024141); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setUlonglongTest(58142); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setFloatTest(25814.2143f); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setDoubleTest(918289051.1241); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setBooleanTest(false); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.setColorTest(Color.green); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getNestedElementTest().setLongTest(58); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getNestedElementTest().getStringTest().setLength(0); + test.getNestedElementTest().getStringTest().append("Wested"); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getStringTest().setLength(0); + test.getStringTest().append("Lolololo"); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + + for (int i = 0; i < 10; i++) + { + test.getLongArray()[i] = i * 14 + 1; + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + } + + for (int a = 0; a < 5; a++) + { + for (int b = 0; b < 3; b++) + { + test.getNestedArray()[a][b].setLongTest(a + a * b * 3 + b + 25); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getNestedArray()[a][b].getStringTest().setLength(0); + test.getNestedArray()[a][b].getStringTest().append("arrayDim:" + a + b + "invalid"); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + } + } + + for (int i = 0; i < 4; i++) + { + test.getStringArray()[i].setLength(0); + ; + test.getStringArray()[i].append("arrayDimNew:" + i); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + } + int c1 = 0, c2 = 0, c3 = 0; + for (int s = 1; s < 4; s++) + { + for (int w = 0; w < 5; w++) + { + int i = s + s * w; + + switch (s) + { + case 1: + test.getCharSeqTest().set(c1, String.valueOf(i * 2).charAt(0)); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getWcharSeqTest().set(c1, 'b'); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getOctetSeqTest().set(c1, (byte) (i * 3)); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getShortSeqTest().set(c1, (short) (-4 * i + 1)); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getBooleanSeqTest().set(c1, !test.getBooleanSeqTest().getBoolean(c1)); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + c1++; + case 2: + test.getUshortSeqTest().set(c2, i + 5); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getLongSeqTest().set(c2, i * 124 - 99); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getUlongSeqTest().set(c2, i * 1161); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getLonglongSeqtest().set(c2, -243125l + i * 1251); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + c2++; + case 3: + test.getUlonglongSeqTest().set(c3, 242l + i * 100421410l); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getFloatSeqTest().set(c3, 525.25f * i); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + test.getDoubleSeqTest().set(c3, 19095.921 * i); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + NestedElement elem = test.getNestedSeqTest().add(); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + elem = test.getNestedSeqTest().get(c3); + elem.setLongTest(i * 541 + 18); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + elem = test.getNestedSeqTest().get(c3); + elem.getStringTest().setLength(0); + elem.getStringTest().append("dimnew:" + s + w); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + StringBuilder builder = test.getStringSeqTest().add(); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + builder = test.getStringSeqTest().get(c3); + builder.append("newsdim:" + s + w); + assertNotEquals(orig, test); + test = createPopulatedIDLElementTest(); + assertEquals(orig, test); + c3++; + } + } + } + + } + + @Test(timeout = 30000) + public void testIDLElementTestSet() + { + IDLElementTest a = createPopulatedIDLElementTest(); + IDLElementTest b = new IDLElementTest(); + + assertNotEquals(a, b); + + b.set(a); + + assertEquals(a, b); + } + + @Test(timeout = 30000) + public void testIDLElementSerializeDeserialize() throws IOException + { + IDLElementTest test = new IDLElementTest(); + populateIDLElementTest(test); + + IDLElementTestPubSubType type = new IDLElementTestPubSubType(); + SerializedPayload payload = new SerializedPayload(type.getTypeSize()); + type.serialize(test, payload); + + IDLElementTest other = new IDLElementTest(); + type.deserialize(payload, other); + assertEquals(test, other); + + } + + @Test(timeout = 30000) + public void testIDLElementWithFastRTPSGenCPPCode() throws IOException + { + IDLElementTest test = new IDLElementTest(); + populateIDLElementTest(test); + + IDLElementTestPubSubType type = new IDLElementTestPubSubType(); + SerializedPayload payload = new SerializedPayload(type.getTypeSize()); + + type.serialize(test, payload); + + byte[] javadata = new byte[payload.getLength()]; + payload.getData().get(javadata); + + IDLElementTest cppElement = new IDLElementTest(); + + SerializedPayload cppPayload = new SerializedPayload(type.getTypeSize()); + cppPayload.getData().put(IDLElementTestCPPData.cppData); + cppPayload.getData().flip(); + cppPayload.setLength(IDLElementTestCPPData.cppData.length); + type.deserialize(cppPayload, cppElement); + + assertArrayEquals(IDLElementTestCPPData.cppData, javadata); + assertEquals(cppElement, test); + } +} diff --git a/ihmc-pub-sub/.gitignore b/ihmc-pub-sub/.gitignore new file mode 100644 index 00000000..a798013e --- /dev/null +++ b/ihmc-pub-sub/.gitignore @@ -0,0 +1,18 @@ +.classpath +.project +.settings +bin +out +build +build-java +classes +.gradle +CMakeLists.txt.user +hs_err_* +*.swp +*.autosave +Win32 +.idea/ +**/*.iml +cmake-build-debug/ +swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.cxx diff --git a/CMakeLists.txt b/ihmc-pub-sub/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to ihmc-pub-sub/CMakeLists.txt diff --git a/ihmc-pub-sub/build.gradle b/ihmc-pub-sub/build.gradle new file mode 100644 index 00000000..051b2eae --- /dev/null +++ b/ihmc-pub-sub/build.gradle @@ -0,0 +1,145 @@ +buildscript { + repositories { + mavenCentral() + maven { url "http://dl.bintray.com/ihmcrobotics/maven-release" } + maven { url "http://dl.bintray.com/ihmcrobotics/maven-vendor" } + maven { url "https://plugins.gradle.org/m2/" } + mavenLocal() + jcenter() + } + dependencies { + classpath "us.ihmc:ihmc-build:0.12.8" + classpath "us.ihmc:ihmc-pub-sub-generator:0.3.7" + classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1" + } +} +apply plugin: "us.ihmc.ihmc-build" +apply plugin: "com.github.hierynomus.license" + +ihmc { + group = "us.ihmc" + version = "0.4.0" + vcsUrl = "https://github.com/ihmcrobotics/ihmc-pub-sub" + openSource = true + maintainer = "Jesper Smith (jesper@halodi.com)" + + configureDependencyResolution() + resourceDirectory("main", "idl") + javaDirectory("main", "generated") + javaDirectory("main", "../../swig/FastRTPS/generated") + configurePublications() +} + +// For swig builds +//buildDir = 'build-java' + +task generateChatMessage(type: us.ihmc.idl.generator.IDLGeneratorTask) { + idlFiles = fileTree(dir: 'idl') + includeDirs = files(".", "idl") + targetDirectory = file("src/main/generated") + packagePrefix = "us.ihmc.idl.generated" +} + +license { + header rootProject.file('license-header.txt') + ext.year = Calendar.getInstance().get(Calendar.YEAR) + strictCheck true +} + +mainDependencies { + compile group: 'us.ihmc', name: 'IHMCNativeLibraryLoader', version: '1.0' + compile group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3' + compile group: "us.ihmc", name: "euclid-core", version: "0.4.13" +} + +testDependencies { + compile group: 'junit', name: 'junit', version: '4.11' +} + +task wrapper(type: Wrapper) { + gradleVersion = '4.5' +} + +//sourceSets { +// main { +// java { +// srcDirs += ['swig/FastRTPS/generated'] +// srcDirs += ['generated'] +// } +// } +// +// code { +// java { +// srcDirs += ['src', 'test'] +// } +// } +//} + +// sourceSets = project.container(SourceSet) +// sourceSets.add(project.sourceSets.code) + +//task sourceJar(type: Jar) { +// from sourceSets.main.allJava +//} +// +//jar { +// manifest { +// attributes( +// "Created-By": "IHMC Gradle Build Script", +// "Implementation-Title": project.name, +// "Implementation-Version": project.version, +// "Implementation-Vendor": "IHMC", +// +// "Bundle-Name": project.name, +// "Bundle-Version": project.version, +// "Bundle-License": "http://www.apache.org/licenses/LICENSE-2.0.txt", +// "Bundle-Vendor": "IHMC") +// } +//} + +//repositories { +// jcenter() +// mavenCentral() +// maven { url "http://dl.bintray.com/ihmcrobotics/maven-release" } +//} + +//publishing { +// publications { +// mavenJava(MavenPublication) { +// +// groupId 'us.ihmc' +// artifactId project.name +// version "$version" +// from components.java +// +// pom.withXml { +// asNode().children().last() + { +// resolveStrategy = Closure.DELEGATE_FIRST +// name project.name +// url project.ext.vcsUrl +// licenses { +// license { +// name 'The Apache Software License, Version 2.0' +// url 'http://www.apache.org/license/LICENSE-2.0.txt' +// distribution 'repo' +// } +// } +// developers { +// developer { +// id 'jsmith' +// name 'Jesper Smith' +// email 'jsmith@ihmc.us' +// } +// } +// } +// } +// +// artifact sourceJar { +// classifier "sources" +// } +// } +// } +//} + +//def labels = ['ihmc', 'java', 'rtps', 'dds', 'net'] +//ihmc.configureForIHMCOpenSourceBintrayPublish(false, "mavenJava", "maven-release", labels) diff --git a/cmake/Modules/FindFastRTPS.cmake b/ihmc-pub-sub/cmake/Modules/FindFastRTPS.cmake similarity index 100% rename from cmake/Modules/FindFastRTPS.cmake rename to ihmc-pub-sub/cmake/Modules/FindFastRTPS.cmake diff --git a/cppsrc/FastRTPS/CMakeLists.txt b/ihmc-pub-sub/cppsrc/FastRTPS/CMakeLists.txt similarity index 100% rename from cppsrc/FastRTPS/CMakeLists.txt rename to ihmc-pub-sub/cppsrc/FastRTPS/CMakeLists.txt diff --git a/cppsrc/FastRTPS/commonfunctions.h b/ihmc-pub-sub/cppsrc/FastRTPS/commonfunctions.h similarity index 100% rename from cppsrc/FastRTPS/commonfunctions.h rename to ihmc-pub-sub/cppsrc/FastRTPS/commonfunctions.h diff --git a/cppsrc/FastRTPS/fastrtpsexception.h b/ihmc-pub-sub/cppsrc/FastRTPS/fastrtpsexception.h similarity index 100% rename from cppsrc/FastRTPS/fastrtpsexception.h rename to ihmc-pub-sub/cppsrc/FastRTPS/fastrtpsexception.h diff --git a/cppsrc/FastRTPS/loglevel.cpp b/ihmc-pub-sub/cppsrc/FastRTPS/loglevel.cpp similarity index 100% rename from cppsrc/FastRTPS/loglevel.cpp rename to ihmc-pub-sub/cppsrc/FastRTPS/loglevel.cpp diff --git a/cppsrc/FastRTPS/loglevel.h b/ihmc-pub-sub/cppsrc/FastRTPS/loglevel.h similarity index 100% rename from cppsrc/FastRTPS/loglevel.h rename to ihmc-pub-sub/cppsrc/FastRTPS/loglevel.h diff --git a/cppsrc/FastRTPS/nativeparticipantimpl.cpp b/ihmc-pub-sub/cppsrc/FastRTPS/nativeparticipantimpl.cpp similarity index 100% rename from cppsrc/FastRTPS/nativeparticipantimpl.cpp rename to ihmc-pub-sub/cppsrc/FastRTPS/nativeparticipantimpl.cpp diff --git a/cppsrc/FastRTPS/nativeparticipantimpl.h b/ihmc-pub-sub/cppsrc/FastRTPS/nativeparticipantimpl.h similarity index 100% rename from cppsrc/FastRTPS/nativeparticipantimpl.h rename to ihmc-pub-sub/cppsrc/FastRTPS/nativeparticipantimpl.h diff --git a/cppsrc/FastRTPS/nativepublisherimpl.cpp b/ihmc-pub-sub/cppsrc/FastRTPS/nativepublisherimpl.cpp similarity index 100% rename from cppsrc/FastRTPS/nativepublisherimpl.cpp rename to ihmc-pub-sub/cppsrc/FastRTPS/nativepublisherimpl.cpp diff --git a/cppsrc/FastRTPS/nativepublisherimpl.h b/ihmc-pub-sub/cppsrc/FastRTPS/nativepublisherimpl.h similarity index 100% rename from cppsrc/FastRTPS/nativepublisherimpl.h rename to ihmc-pub-sub/cppsrc/FastRTPS/nativepublisherimpl.h diff --git a/cppsrc/FastRTPS/nativesubscriberimpl.cpp b/ihmc-pub-sub/cppsrc/FastRTPS/nativesubscriberimpl.cpp similarity index 100% rename from cppsrc/FastRTPS/nativesubscriberimpl.cpp rename to ihmc-pub-sub/cppsrc/FastRTPS/nativesubscriberimpl.cpp diff --git a/cppsrc/FastRTPS/nativesubscriberimpl.h b/ihmc-pub-sub/cppsrc/FastRTPS/nativesubscriberimpl.h similarity index 100% rename from cppsrc/FastRTPS/nativesubscriberimpl.h rename to ihmc-pub-sub/cppsrc/FastRTPS/nativesubscriberimpl.h diff --git a/cppsrc/FastRTPS/publisherhistory.cpp b/ihmc-pub-sub/cppsrc/FastRTPS/publisherhistory.cpp similarity index 100% rename from cppsrc/FastRTPS/publisherhistory.cpp rename to ihmc-pub-sub/cppsrc/FastRTPS/publisherhistory.cpp diff --git a/cppsrc/FastRTPS/publisherhistory.h b/ihmc-pub-sub/cppsrc/FastRTPS/publisherhistory.h similarity index 100% rename from cppsrc/FastRTPS/publisherhistory.h rename to ihmc-pub-sub/cppsrc/FastRTPS/publisherhistory.h diff --git a/cppsrc/FastRTPS/sampleinfomarshaller.h b/ihmc-pub-sub/cppsrc/FastRTPS/sampleinfomarshaller.h similarity index 100% rename from cppsrc/FastRTPS/sampleinfomarshaller.h rename to ihmc-pub-sub/cppsrc/FastRTPS/sampleinfomarshaller.h diff --git a/cppsrc/test/CMakeLists.txt b/ihmc-pub-sub/cppsrc/test/CMakeLists.txt similarity index 100% rename from cppsrc/test/CMakeLists.txt rename to ihmc-pub-sub/cppsrc/test/CMakeLists.txt diff --git a/cppsrc/test/IDLElementTest.cxx b/ihmc-pub-sub/cppsrc/test/IDLElementTest.cxx similarity index 100% rename from cppsrc/test/IDLElementTest.cxx rename to ihmc-pub-sub/cppsrc/test/IDLElementTest.cxx diff --git a/cppsrc/test/IDLElementTest.h b/ihmc-pub-sub/cppsrc/test/IDLElementTest.h similarity index 100% rename from cppsrc/test/IDLElementTest.h rename to ihmc-pub-sub/cppsrc/test/IDLElementTest.h diff --git a/cppsrc/test/IDLElementTestPubSubTypes.cxx b/ihmc-pub-sub/cppsrc/test/IDLElementTestPubSubTypes.cxx similarity index 100% rename from cppsrc/test/IDLElementTestPubSubTypes.cxx rename to ihmc-pub-sub/cppsrc/test/IDLElementTestPubSubTypes.cxx diff --git a/cppsrc/test/IDLElementTestPubSubTypes.h b/ihmc-pub-sub/cppsrc/test/IDLElementTestPubSubTypes.h similarity index 100% rename from cppsrc/test/IDLElementTestPubSubTypes.h rename to ihmc-pub-sub/cppsrc/test/IDLElementTestPubSubTypes.h diff --git a/cppsrc/test/NestedElement.cxx b/ihmc-pub-sub/cppsrc/test/NestedElement.cxx similarity index 100% rename from cppsrc/test/NestedElement.cxx rename to ihmc-pub-sub/cppsrc/test/NestedElement.cxx diff --git a/cppsrc/test/NestedElement.h b/ihmc-pub-sub/cppsrc/test/NestedElement.h similarity index 100% rename from cppsrc/test/NestedElement.h rename to ihmc-pub-sub/cppsrc/test/NestedElement.h diff --git a/cppsrc/test/NestedElementPubSubTypes.cxx b/ihmc-pub-sub/cppsrc/test/NestedElementPubSubTypes.cxx similarity index 100% rename from cppsrc/test/NestedElementPubSubTypes.cxx rename to ihmc-pub-sub/cppsrc/test/NestedElementPubSubTypes.cxx diff --git a/cppsrc/test/NestedElementPubSubTypes.h b/ihmc-pub-sub/cppsrc/test/NestedElementPubSubTypes.h similarity index 100% rename from cppsrc/test/NestedElementPubSubTypes.h rename to ihmc-pub-sub/cppsrc/test/NestedElementPubSubTypes.h diff --git a/cppsrc/test/idlelementserializetest.cpp b/ihmc-pub-sub/cppsrc/test/idlelementserializetest.cpp similarity index 100% rename from cppsrc/test/idlelementserializetest.cpp rename to ihmc-pub-sub/cppsrc/test/idlelementserializetest.cpp diff --git a/fastcdr.patch b/ihmc-pub-sub/fastcdr.patch similarity index 100% rename from fastcdr.patch rename to ihmc-pub-sub/fastcdr.patch diff --git a/ihmc-pub-sub/gradle.properties b/ihmc-pub-sub/gradle.properties new file mode 100644 index 00000000..52214b9b --- /dev/null +++ b/ihmc-pub-sub/gradle.properties @@ -0,0 +1,6 @@ +kebabCasedName = ihmc-pub-sub +pascalCasedName = IHMCPubSub +extraSourceSets = ["test"] +publishMode = LOCAL +depthFromWorkspaceDirectory = 1 +excludeFromCompositeBuild = false \ No newline at end of file diff --git a/idl/ChatMessage.idl b/ihmc-pub-sub/idl/ChatMessage.idl similarity index 100% rename from idl/ChatMessage.idl rename to ihmc-pub-sub/idl/ChatMessage.idl diff --git a/ihmc-pub-sub/settings.gradle b/ihmc-pub-sub/settings.gradle new file mode 100644 index 00000000..ed310a1f --- /dev/null +++ b/ihmc-pub-sub/settings.gradle @@ -0,0 +1,17 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + mavenLocal() + } + dependencies { + classpath "us.ihmc:ihmc-build:0.12.8" + } +} + +import us.ihmc.build.IHMCSettingsConfigurator + +/** Browse source at https://github.com/ihmcrobotics/ihmc-build */ +def ihmcSettingsConfigurator = new IHMCSettingsConfigurator(settings, logger, ext) +ihmcSettingsConfigurator.checkRequiredPropertiesAreSet() +ihmcSettingsConfigurator.configureExtraSourceSets() +ihmcSettingsConfigurator.findAndIncludeCompositeBuilds() diff --git a/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessage.java b/ihmc-pub-sub/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessage.java similarity index 100% rename from src/main/generated/us/ihmc/idl/generated/Chat/ChatMessage.java rename to ihmc-pub-sub/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessage.java diff --git a/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessagePubSubType.java b/ihmc-pub-sub/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessagePubSubType.java similarity index 100% rename from src/main/generated/us/ihmc/idl/generated/Chat/ChatMessagePubSubType.java rename to ihmc-pub-sub/src/main/generated/us/ihmc/idl/generated/Chat/ChatMessagePubSubType.java diff --git a/src/main/java/us/ihmc/idl/CDR.java b/ihmc-pub-sub/src/main/java/us/ihmc/idl/CDR.java similarity index 100% rename from src/main/java/us/ihmc/idl/CDR.java rename to ihmc-pub-sub/src/main/java/us/ihmc/idl/CDR.java diff --git a/src/main/java/us/ihmc/idl/IDLSequence.java b/ihmc-pub-sub/src/main/java/us/ihmc/idl/IDLSequence.java similarity index 100% rename from src/main/java/us/ihmc/idl/IDLSequence.java rename to ihmc-pub-sub/src/main/java/us/ihmc/idl/IDLSequence.java diff --git a/src/main/java/us/ihmc/idl/IDLTools.java b/ihmc-pub-sub/src/main/java/us/ihmc/idl/IDLTools.java similarity index 100% rename from src/main/java/us/ihmc/idl/IDLTools.java rename to ihmc-pub-sub/src/main/java/us/ihmc/idl/IDLTools.java diff --git a/src/main/java/us/ihmc/idl/InterchangeSerializer.java b/ihmc-pub-sub/src/main/java/us/ihmc/idl/InterchangeSerializer.java similarity index 100% rename from src/main/java/us/ihmc/idl/InterchangeSerializer.java rename to ihmc-pub-sub/src/main/java/us/ihmc/idl/InterchangeSerializer.java diff --git a/src/main/java/us/ihmc/idl/PreallocatedList.java b/ihmc-pub-sub/src/main/java/us/ihmc/idl/PreallocatedList.java similarity index 100% rename from src/main/java/us/ihmc/idl/PreallocatedList.java rename to ihmc-pub-sub/src/main/java/us/ihmc/idl/PreallocatedList.java diff --git a/src/main/java/us/ihmc/pubsub/Domain.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/Domain.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/Domain.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/Domain.java diff --git a/src/main/java/us/ihmc/pubsub/DomainFactory.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/DomainFactory.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/DomainFactory.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/DomainFactory.java diff --git a/src/main/java/us/ihmc/pubsub/TopicDataType.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/TopicDataType.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/TopicDataType.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/TopicDataType.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/DurabilityKind.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/DurabilityKind.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/DurabilityKind.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/DurabilityKind.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/HistoryQosPolicy.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/HistoryQosPolicy.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/HistoryQosPolicy.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/HistoryQosPolicy.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/Locator.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/Locator.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/Locator.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/Locator.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/MemoryManagementPolicy.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/MemoryManagementPolicy.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/MemoryManagementPolicy.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/MemoryManagementPolicy.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/OwnerShipPolicyKind.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/OwnerShipPolicyKind.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/OwnerShipPolicyKind.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/OwnerShipPolicyKind.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/ParticipantAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ParticipantAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/ParticipantAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ParticipantAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/PublishModeKind.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/PublishModeKind.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/PublishModeKind.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/PublishModeKind.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/PublisherAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/PublisherAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/PublisherAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/PublisherAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/QosInterface.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/QosInterface.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/QosInterface.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/QosInterface.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/QosPolicy.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/QosPolicy.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/QosPolicy.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/QosPolicy.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/ReaderQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ReaderQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/ReaderQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ReaderQosHolder.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/ReliabilityKind.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ReliabilityKind.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/ReliabilityKind.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ReliabilityKind.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/ResourceLimitsQosPolicy.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ResourceLimitsQosPolicy.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/ResourceLimitsQosPolicy.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ResourceLimitsQosPolicy.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/SubscriberAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/SubscriberAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/SubscriberAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/SubscriberAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/ThroughputControllerDescriptor.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ThroughputControllerDescriptor.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/ThroughputControllerDescriptor.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/ThroughputControllerDescriptor.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/TopicAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/TopicAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/TopicAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/TopicAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/attributes/WriterQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/WriterQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/attributes/WriterQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/attributes/WriterQosHolder.java diff --git a/src/main/java/us/ihmc/pubsub/common/ChangeKind.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/ChangeKind.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/ChangeKind.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/ChangeKind.java diff --git a/src/main/java/us/ihmc/pubsub/common/DiscoveryStatus.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/DiscoveryStatus.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/DiscoveryStatus.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/DiscoveryStatus.java diff --git a/src/main/java/us/ihmc/pubsub/common/Guid.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/Guid.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/Guid.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/Guid.java diff --git a/src/main/java/us/ihmc/pubsub/common/InstanceHandle.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/InstanceHandle.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/InstanceHandle.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/InstanceHandle.java diff --git a/src/main/java/us/ihmc/pubsub/common/LogLevel.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/LogLevel.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/LogLevel.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/LogLevel.java diff --git a/src/main/java/us/ihmc/pubsub/common/MatchingInfo.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/MatchingInfo.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/MatchingInfo.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/MatchingInfo.java diff --git a/src/main/java/us/ihmc/pubsub/common/SampleIdentity.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SampleIdentity.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/SampleIdentity.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SampleIdentity.java diff --git a/src/main/java/us/ihmc/pubsub/common/SampleInfo.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SampleInfo.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/SampleInfo.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SampleInfo.java diff --git a/src/main/java/us/ihmc/pubsub/common/SequenceNumber.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SequenceNumber.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/SequenceNumber.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SequenceNumber.java diff --git a/src/main/java/us/ihmc/pubsub/common/SerializedPayload.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SerializedPayload.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/SerializedPayload.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/SerializedPayload.java diff --git a/src/main/java/us/ihmc/pubsub/common/Time.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/Time.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/common/Time.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/common/Time.java diff --git a/src/main/java/us/ihmc/pubsub/example/EndpointDiscoveryProtocolListenerExample.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/EndpointDiscoveryProtocolListenerExample.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/example/EndpointDiscoveryProtocolListenerExample.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/EndpointDiscoveryProtocolListenerExample.java diff --git a/src/main/java/us/ihmc/pubsub/example/PublisherExample.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/PublisherExample.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/example/PublisherExample.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/PublisherExample.java diff --git a/src/main/java/us/ihmc/pubsub/example/SubscriberExample.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/SubscriberExample.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/example/SubscriberExample.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/example/SubscriberExample.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomain.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomain.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomain.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomain.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainImpl.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainImpl.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainImpl.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainImpl.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessLog.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessLog.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessLog.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessLog.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipant.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipant.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipant.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipant.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantDiscoveryInfo.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantDiscoveryInfo.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantDiscoveryInfo.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessParticipantDiscoveryInfo.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisher.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisher.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisher.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisher.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisherAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisherAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisherAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessPublisherAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessQosInterface.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessQosInterface.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessQosInterface.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessQosInterface.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessReaderQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessReaderQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessReaderQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessReaderQosHolder.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriber.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriber.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriber.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriber.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriberAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriberAttributes.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriberAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessSubscriberAttributes.java diff --git a/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessWriterQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessWriterQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessWriterQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessWriterQosHolder.java diff --git a/src/main/java/us/ihmc/pubsub/participant/Participant.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/Participant.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/participant/Participant.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/Participant.java diff --git a/src/main/java/us/ihmc/pubsub/participant/ParticipantDiscoveryInfo.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/ParticipantDiscoveryInfo.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/participant/ParticipantDiscoveryInfo.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/ParticipantDiscoveryInfo.java diff --git a/src/main/java/us/ihmc/pubsub/participant/ParticipantListener.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/ParticipantListener.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/participant/ParticipantListener.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/ParticipantListener.java diff --git a/src/main/java/us/ihmc/pubsub/participant/PublisherEndpointDiscoveryListener.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/PublisherEndpointDiscoveryListener.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/participant/PublisherEndpointDiscoveryListener.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/PublisherEndpointDiscoveryListener.java diff --git a/src/main/java/us/ihmc/pubsub/participant/SubscriberEndpointDiscoveryListener.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/SubscriberEndpointDiscoveryListener.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/participant/SubscriberEndpointDiscoveryListener.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/participant/SubscriberEndpointDiscoveryListener.java diff --git a/src/main/java/us/ihmc/pubsub/publisher/Publisher.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/publisher/Publisher.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/publisher/Publisher.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/publisher/Publisher.java diff --git a/src/main/java/us/ihmc/pubsub/publisher/PublisherListener.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/publisher/PublisherListener.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/publisher/PublisherListener.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/publisher/PublisherListener.java diff --git a/src/main/java/us/ihmc/pubsub/subscriber/Subscriber.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/subscriber/Subscriber.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/subscriber/Subscriber.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/subscriber/Subscriber.java diff --git a/src/main/java/us/ihmc/pubsub/subscriber/SubscriberListener.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/subscriber/SubscriberListener.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/subscriber/SubscriberListener.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/subscriber/SubscriberListener.java diff --git a/src/main/java/us/ihmc/pubsub/types/ByteBufferPubSubType.java b/ihmc-pub-sub/src/main/java/us/ihmc/pubsub/types/ByteBufferPubSubType.java similarity index 100% rename from src/main/java/us/ihmc/pubsub/types/ByteBufferPubSubType.java rename to ihmc-pub-sub/src/main/java/us/ihmc/pubsub/types/ByteBufferPubSubType.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSAttributes.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSAttributes.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSCommonFunctions.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSCommonFunctions.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSCommonFunctions.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSCommonFunctions.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSDomain.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSDomain.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSDomain.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSDomain.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipant.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipant.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipant.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipant.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantAttributes.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantAttributes.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantDiscoveryInfo.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantDiscoveryInfo.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantDiscoveryInfo.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSParticipantDiscoveryInfo.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisher.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisher.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisher.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisher.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisherAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisherAttributes.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisherAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSPublisherAttributes.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSReaderQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSReaderQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSReaderQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSReaderQosHolder.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriber.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriber.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriber.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriber.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriberAttributes.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriberAttributes.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriberAttributes.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSSubscriberAttributes.java diff --git a/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSWriterQosHolder.java b/ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSWriterQosHolder.java similarity index 100% rename from src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSWriterQosHolder.java rename to ihmc-pub-sub/src/main/java/us/ihmc/rtps/impl/fastRTPS/FastRTPSWriterQosHolder.java diff --git a/src/main/resources/us/ihmc/rtps/impl/fastRTPS/FastRTPSWrapper.dll b/ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/FastRTPSWrapper.dll similarity index 100% rename from src/main/resources/us/ihmc/rtps/impl/fastRTPS/FastRTPSWrapper.dll rename to ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/FastRTPSWrapper.dll diff --git a/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.dylib b/ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.dylib similarity index 100% rename from src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.dylib rename to ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.dylib diff --git a/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.so b/ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.so similarity index 100% rename from src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.so rename to ihmc-pub-sub/src/main/resources/us/ihmc/rtps/impl/fastRTPS/libFastRTPSWrapper.so diff --git a/src/test/java/us/ihmc/idl/PreallocatedListTest.java b/ihmc-pub-sub/src/test/java/us/ihmc/idl/PreallocatedListTest.java similarity index 100% rename from src/test/java/us/ihmc/idl/PreallocatedListTest.java rename to ihmc-pub-sub/src/test/java/us/ihmc/idl/PreallocatedListTest.java diff --git a/src/test/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainTest.java b/ihmc-pub-sub/src/test/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainTest.java similarity index 100% rename from src/test/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainTest.java rename to ihmc-pub-sub/src/test/java/us/ihmc/pubsub/impl/intraprocess/IntraProcessDomainTest.java diff --git a/swig/FastRTPS/CMakeLists.txt b/ihmc-pub-sub/swig/FastRTPS/CMakeLists.txt similarity index 100% rename from swig/FastRTPS/CMakeLists.txt rename to ihmc-pub-sub/swig/FastRTPS/CMakeLists.txt diff --git a/swig/FastRTPS/FastRTPS.i b/ihmc-pub-sub/swig/FastRTPS/FastRTPS.i similarity index 100% rename from swig/FastRTPS/FastRTPS.i rename to ihmc-pub-sub/swig/FastRTPS/FastRTPS.i diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/BuiltinAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/BuiltinAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/BuiltinAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/BuiltinAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ChangeKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ChangeKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ChangeKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ChangeKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DISCOVERY_STATUS.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DISCOVERY_STATUS.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DISCOVERY_STATUS.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DISCOVERY_STATUS.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DeadlineQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DeadlineQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DeadlineQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DeadlineQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicyKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicyKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicyKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DestinationOrderQosPolicyKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicyKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicyKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicyKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityQosPolicyKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityServiceQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityServiceQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityServiceQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/DurabilityServiceQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/EndpointKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPS.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPS.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPS.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPS.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSConstants.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSConstants.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSConstants.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSConstants.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJAVA_wrap.h diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/FastRTPSJNI.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/GroupDataQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/GroupDataQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/GroupDataQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/GroupDataQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicyKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicyKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicyKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/HistoryQosPolicyKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LatencyBudgetQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LatencyBudgetQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LatencyBudgetQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LatencyBudgetQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LifespanQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LifespanQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LifespanQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LifespanQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicyKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicyKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicyKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LivelinessQosPolicyKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LocatorList_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LocatorList_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LocatorList_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LocatorList_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Locator_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Locator_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Locator_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Locator_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LogLevel.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LogLevel.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LogLevel.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/LogLevel.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MatchingStatus.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MatchingStatus.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MatchingStatus.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MatchingStatus.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MemoryManagementPolicy_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MemoryManagementPolicy_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MemoryManagementPolicy_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/MemoryManagementPolicy_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantImpl.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantImpl.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantImpl.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantImpl.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantListener.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantListener.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantListener.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantListener.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantPublisherEDPListener.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantPublisherEDPListener.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantPublisherEDPListener.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantPublisherEDPListener.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantSubscriberEDPListener.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantSubscriberEDPListener.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantSubscriberEDPListener.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeParticipantSubscriberEDPListener.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherImpl.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherImpl.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherImpl.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherImpl.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherListener.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherListener.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherListener.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativePublisherListener.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberImpl.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberImpl.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberImpl.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberImpl.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberListener.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberListener.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberListener.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/NativeSubscriberListener.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicyKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicyKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicyKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipQosPolicyKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipStrengthQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipStrengthQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipStrengthQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/OwnershipStrengthQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PartitionQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PartitionQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PartitionQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PartitionQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PortParameters.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PortParameters.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PortParameters.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PortParameters.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicyAccessScopeKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicyAccessScopeKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicyAccessScopeKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PresentationQosPolicyAccessScopeKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicyKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicyKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicyKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublishModeQosPolicyKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublisherAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublisherAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublisherAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/PublisherAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/QosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/QosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/QosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/QosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSParticipantAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSParticipantAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSParticipantAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSParticipantAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSWriterPublishMode.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSWriterPublishMode.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSWriterPublishMode.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RTPSWriterPublishMode.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderQos.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderQos.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderQos.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderQos.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderTimes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderTimes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderTimes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReaderTimes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicyKind.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicyKind.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicyKind.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ReliabilityQosPolicyKind.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteReaderAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteReaderAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteReaderAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteReaderAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteWriterAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteWriterAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteWriterAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/RemoteWriterAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ResourceLimitsQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ResourceLimitsQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ResourceLimitsQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ResourceLimitsQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CDRMessage_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CDRMessage_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CDRMessage_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CDRMessage_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CacheChange_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CacheChange_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CacheChange_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_CacheChange_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_PropertyPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_PropertyPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_PropertyPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_PropertyPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_unsigned_char.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_unsigned_char.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_unsigned_char.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SWIGTYPE_p_unsigned_char.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SampleInfoMarshaller.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SampleInfoMarshaller.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SampleInfoMarshaller.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SampleInfoMarshaller.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SimpleEDPAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SimpleEDPAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SimpleEDPAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SimpleEDPAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SubscriberAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SubscriberAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SubscriberAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/SubscriberAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ThroughputControllerDescriptor.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ThroughputControllerDescriptor.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ThroughputControllerDescriptor.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/ThroughputControllerDescriptor.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TimeBasedFilterQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TimeBasedFilterQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TimeBasedFilterQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TimeBasedFilterQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Time_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Time_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Time_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/Time_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicDataQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicDataQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicDataQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicDataQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicKind_t.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicKind_t.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicKind_t.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TopicKind_t.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TransportPriorityQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TransportPriorityQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TransportPriorityQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/TransportPriorityQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/UserDataQosPolicy.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/UserDataQosPolicy.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/UserDataQosPolicy.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/UserDataQosPolicy.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterAttributes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterAttributes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterAttributes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterAttributes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterQos.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterQos.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterQos.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterQos.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterTimes.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterTimes.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterTimes.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/WriterTimes.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/octetVector.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/octetVector.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/octetVector.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/octetVector.java diff --git a/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/stringVector.java b/ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/stringVector.java similarity index 100% rename from swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/stringVector.java rename to ihmc-pub-sub/swig/FastRTPS/generated/us/ihmc/rtps/impl/fastRTPS/stringVector.java diff --git a/settings.gradle b/settings.gradle index ed310a1f..e49cf783 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,8 +10,6 @@ buildscript { import us.ihmc.build.IHMCSettingsConfigurator -/** Browse source at https://github.com/ihmcrobotics/ihmc-build */ def ihmcSettingsConfigurator = new IHMCSettingsConfigurator(settings, logger, ext) -ihmcSettingsConfigurator.checkRequiredPropertiesAreSet() -ihmcSettingsConfigurator.configureExtraSourceSets() +ihmcSettingsConfigurator.configureAsGroupOfProjects() ihmcSettingsConfigurator.findAndIncludeCompositeBuilds() diff --git a/thirdparty/Fast-RTPS b/thirdparty/Fast-RTPS deleted file mode 160000 index b96e0286..00000000 --- a/thirdparty/Fast-RTPS +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b96e02861239a1ca3d1cb91a4760bba4c1df3498