Skip to content

Commit

Permalink
Use DdsDynamicData.idl in Java but hide most of it
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Feb 6, 2024
1 parent 465dcf6 commit dfb2510
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 74 deletions.
6 changes: 5 additions & 1 deletion MPC/modules/IDLBase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ sub do_cached_parse {
$self->{'default_nested'} = 1;

## Set up the macros and include paths supplied in the command flags
my %macros = ('__OPENDDS_IDL' => 1, '__OPENDDS_MPC' => 1);
my %macros = (
__OPENDDS_IDL => 1,
__OPENDDS_MPC => 1,
OPENDDS_HIDE_DYNMIC_DATA => 1,
);
my %mparams;
my @include;
if (defined $flags) {
Expand Down
15 changes: 9 additions & 6 deletions dds/DdsDynamicData.idl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
*
*
* Distributed under the OpenDDS License.
* See: http://www.opendds.org/license.html
*/
Expand All @@ -9,13 +7,15 @@
#define OPENDDS_DDS_DYNAMIC_DATA_IDL

#ifndef OPENDDS_SAFETY_PROFILE

#include <dds/DdsDcpsInfrastructure.idl>
#include <dds/DdsDcpsDomain.idl>
#include <dds/DdsDynamicDataSeq.idl>
# ifndef OPENDDS_HIDE_DYNMIC_DATA
# include <dds/DdsDcpsInfrastructure.idl>
# include <dds/DdsDcpsDomain.idl>
# include <dds/DdsDynamicDataSeq.idl>
# endif // OPENDDS_HIDE_DYNMIC_DATA

module DDS {
local interface DynamicType;
# ifndef OPENDDS_HIDE_DYNMIC_DATA
valuetype TypeDescriptor;

typedef sequence<string> IncludePathSeq;
Expand Down Expand Up @@ -158,9 +158,11 @@ module DDS {

void clear();
};
# endif // OPENDDS_HIDE_DYNMIC_DATA

local interface DynamicData;

# ifndef OPENDDS_HIDE_DYNMIC_DATA
local interface DynamicDataFactoryInterf {
// Implemented in C++
// static DynamicDataFactory get_instance();
Expand Down Expand Up @@ -401,6 +403,7 @@ module DDS {
in MemberId id,
in WstringSeq value);
}; // local interface DynamicData
# endif // OPENDDS_HIDE_DYNMIC_DATA
};

#endif // OPENDDS_SAFETY_PROFILE
Expand Down
13 changes: 2 additions & 11 deletions dds/idl/ts_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ bool ts_generator::generate_ts(AST_Type* node, UTL_ScopedName* name)
"dds/DdsDcpsTopic.idl",
"dds/DdsDcpsPublication.idl",
"dds/DdsDcpsSubscriptionExt.idl",
"dds/DdsDcpsTypeSupportExt.idl"
"dds/DdsDcpsTypeSupportExt.idl",
"dds/DdsDynamicData.idl"
};
add_includes(idl_includes, BE_GlobalData::STREAM_IDL);

Expand All @@ -187,16 +188,6 @@ bool ts_generator::generate_ts(AST_Type* node, UTL_ScopedName* name)
};
add_includes(cpp_includes, BE_GlobalData::STREAM_CPP);

// This is for Java because we can't include DynamicData.idl. In addition, MPC
// will make invalid rules in a Java build based on this forward declaration.
be_global->idl_ <<
"#if !defined OPENDDS_SAFETY_PROFILE && !defined __OPENDDS_MPC\n"
"module DDS {\n"
" local interface DynamicData;\n"
"};\n"
"#endif\n"
"\n";

std::map<std::string, std::string> replacements;
replacements["SCOPED"] = scoped(name, EscapeContext_ForGenIdl);
// SCOPED_NOT_GLOBAL is EscapeContext_FromGenIdl, because
Expand Down
114 changes: 58 additions & 56 deletions java/dds/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,51 @@
/*.vcproj
/BitsExtJC.cpp
/BitsJC.cpp
/classes
/DDS__ConditionTAOPeer.h
/DDS__ContentFilteredTopicTAOPeer.h
/DDS__DataReaderListenerTAOPeer.h
/DDS__DataReaderTAOPeer.h
/DDS__DataWriterListenerTAOPeer.h
/DDS__DataWriterTAOPeer.h
/DDS__DomainParticipantFactoryTAOPeer.h
/DDS__DomainParticipantListenerTAOPeer.h
/DDS__DomainParticipantTAOPeer.h
/DDS__EntityTAOPeer.h
/DDS__GuardConditionInterfTAOPeer.h
/DDS__MultiTopicTAOPeer.h
/DDS__ParticipantBuiltinTopicDataDataReaderTAOPeer.h
/DDS__ParticipantBuiltinTopicDataDataWriterTAOPeer.h
/DDS__ParticipantBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__PublicationBuiltinTopicDataDataReaderTAOPeer.h
/DDS__PublicationBuiltinTopicDataDataWriterTAOPeer.h
/DDS__PublicationBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__PublisherListenerTAOPeer.h
/DDS__PublisherTAOPeer.h
/DDS__QueryConditionTAOPeer.h
/DDS__ReadConditionTAOPeer.h
/DDS__StatusConditionTAOPeer.h
/DDS__SubscriberListenerTAOPeer.h
/DDS__SubscriberTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataDataReaderTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataDataWriterTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__TopicBuiltinTopicDataDataReaderTAOPeer.h
/DDS__TopicBuiltinTopicDataDataWriterTAOPeer.h
/DDS__TopicBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__TopicDescriptionTAOPeer.h
/DDS__TopicListenerTAOPeer.h
/DDS__TopicTAOPeer.h
/DDS__TypeSupportTAOPeer.h
/DDS__WaitSetInterfTAOPeer.h
/DDS_ConditionHelper.h
/DDS_ContentFilteredTopicHelper.h
/DDS_DATAREADER_QOS_DEFAULT.h
/DDS_DATAREADER_QOS_USE_TOPIC_QOS.h
/DDS_DATAWRITER_QOS_DEFAULT.h
/DDS_DATAWRITER_QOS_USE_TOPIC_QOS.h
/DDS_DataReaderHelper.h
/DDS_DataReaderListenerHelper.h
/DDS_DATAWRITER_QOS_DEFAULT.h
/DDS_DATAWRITER_QOS_USE_TOPIC_QOS.h
/DDS_DataWriterHelper.h
/DDS_DataWriterListenerHelper.h
/DDS_DomainParticipantFactoryHelper.h
Expand All @@ -22,7 +59,6 @@
/DDS_ListenerHelper.h
/DDS_MultiTopicHelper.h
/DDS_PARTICIPANT_QOS_DEFAULT.h
/DDS_PUBLISHER_QOS_DEFAULT.h
/DDS_ParticipantBuiltinTopicDataDataReaderHelper.h
/DDS_ParticipantBuiltinTopicDataDataWriterHelper.h
/DDS_ParticipantBuiltinTopicDataTypeSupportHelper.h
Expand All @@ -31,12 +67,13 @@
/DDS_PublicationBuiltinTopicDataDataWriterHelper.h
/DDS_PublicationBuiltinTopicDataTypeSupportHelper.h
/DDS_PublicationBuiltinTopicDataTypeSupportImpl.h
/DDS_PUBLISHER_QOS_DEFAULT.h
/DDS_PublisherHelper.h
/DDS_PublisherListenerHelper.h
/DDS_QueryConditionHelper.h
/DDS_ReadConditionHelper.h
/DDS_SUBSCRIBER_QOS_DEFAULT.h
/DDS_StatusConditionHelper.h
/DDS_SUBSCRIBER_QOS_DEFAULT.h
/DDS_SubscriberHelper.h
/DDS_SubscriberListenerHelper.h
/DDS_SubscriptionBuiltinTopicDataDataReaderHelper.h
Expand All @@ -54,42 +91,6 @@
/DDS_TypeSupportHelper.h
/DDS_WaitSet.h
/DDS_WaitSetInterfHelper.h
/DDS__ConditionTAOPeer.h
/DDS__ContentFilteredTopicTAOPeer.h
/DDS__DataReaderListenerTAOPeer.h
/DDS__DataReaderTAOPeer.h
/DDS__DataWriterListenerTAOPeer.h
/DDS__DataWriterTAOPeer.h
/DDS__DomainParticipantFactoryTAOPeer.h
/DDS__DomainParticipantListenerTAOPeer.h
/DDS__DomainParticipantTAOPeer.h
/DDS__EntityTAOPeer.h
/DDS__GuardConditionInterfTAOPeer.h
/DDS__MultiTopicTAOPeer.h
/DDS__ParticipantBuiltinTopicDataDataReaderTAOPeer.h
/DDS__ParticipantBuiltinTopicDataDataWriterTAOPeer.h
/DDS__ParticipantBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__PublicationBuiltinTopicDataDataReaderTAOPeer.h
/DDS__PublicationBuiltinTopicDataDataWriterTAOPeer.h
/DDS__PublicationBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__PublisherListenerTAOPeer.h
/DDS__PublisherTAOPeer.h
/DDS__QueryConditionTAOPeer.h
/DDS__ReadConditionTAOPeer.h
/DDS__StatusConditionTAOPeer.h
/DDS__SubscriberListenerTAOPeer.h
/DDS__SubscriberTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataDataReaderTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataDataWriterTAOPeer.h
/DDS__SubscriptionBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__TopicBuiltinTopicDataDataReaderTAOPeer.h
/DDS__TopicBuiltinTopicDataDataWriterTAOPeer.h
/DDS__TopicBuiltinTopicDataTypeSupportTAOPeer.h
/DDS__TopicDescriptionTAOPeer.h
/DDS__TopicListenerTAOPeer.h
/DDS__TopicTAOPeer.h
/DDS__TypeSupportTAOPeer.h
/DDS__WaitSetInterfTAOPeer.h
/DdsDcpsConditionSeqJC.cpp
/DdsDcpsConditionSeqJC.h
/DdsDcpsCoreJC.cpp
Expand Down Expand Up @@ -118,6 +119,22 @@
/DdsDcpsTopicJC.h
/DdsDcpsTypeSupportExtJC.cpp
/DdsDcpsTypeSupportExtJC.h
/DdsDynamicDataJC.cpp
/DdsDynamicDataJC.h
/OpenDDS_DCPS__ConfigStoreTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordDataReaderTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordDataWriterTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordTypeSupportTAOPeer.h
/OpenDDS_DCPS__DataReaderExTAOPeer.h
/OpenDDS_DCPS__DataReaderListenerTAOPeer.h
/OpenDDS_DCPS__DataWriterListenerTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataReaderTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataWriterTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataTypeSupportTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.h
/OpenDDS_DCPS__TypeSupportTAOPeer.h
/OpenDDS_DCPS_CdrRepresentationFormatHelper.h
/OpenDDS_DCPS_ConfigStoreHelper.h
/OpenDDS_DCPS_ConnectionRecordDataReaderHelper.h
Expand All @@ -140,30 +157,15 @@
/OpenDDS_DCPS_RepresentationFormatHelper.h
/OpenDDS_DCPS_TheParticipantFactory.h
/OpenDDS_DCPS_TheServiceParticipant.h
/OpenDDS_DCPS_TypeSupportHelper.h
/OpenDDS_DCPS__ConfigStoreTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordDataReaderTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordDataWriterTAOPeer.h
/OpenDDS_DCPS__ConnectionRecordTypeSupportTAOPeer.h
/OpenDDS_DCPS__DataReaderExTAOPeer.h
/OpenDDS_DCPS__DataReaderListenerTAOPeer.h
/OpenDDS_DCPS__DataWriterListenerTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataReaderTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataWriterTAOPeer.h
/OpenDDS_DCPS__InternalThreadBuiltinTopicDataTypeSupportTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.h
/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.h
/OpenDDS_DCPS__TypeSupportTAOPeer.h
/OpenDDS_DCPS_transport_MulticastInst.h
/OpenDDS_DCPS_transport_RtpsUdpInst.h
/OpenDDS_DCPS_transport_TcpInst.h
/OpenDDS_DCPS_transport_TheTransportRegistry.h
/OpenDDS_DCPS_transport_TransportConfig.h
/OpenDDS_DCPS_transport_TransportInst.h
/OpenDDS_DCPS_transport_UdpInst.h
/OpenDDS_DCPS_TypeSupportHelper.h
/OpenddsDcpsExtJC.cpp
/OpenddsDcpsExtJC.h
/OpenddsDcpsExtTypeSupportJC.cpp
/OpenddsDcpsExtTypeSupportJC.h
/classes
4 changes: 4 additions & 0 deletions java/dds/dcps_java.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ project: idl2jni, javah, dcpslib, optional_jni_check, dcps_java_optional, dcps_m
$(DDS_ROOT)/dds/DdsDcpsSubscriptionExt.idl << DdsDcpsSubscriptionJC.h
}

Idl2Jni_Files {
$(DDS_ROOT)/dds/DdsDynamicData.idl
}

// The following .java files are not generated by idl2jni
Java_Files {
OpenDDS/DCPS/NetworkConfigModifier.java
Expand Down
1 change: 1 addition & 0 deletions java/idl2jni/codegen/be_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ BE_post_init(char *[], long)
idl_global->unknown_annotations_ = IDL_GlobalData::UNKNOWN_ANNOTATIONS_IGNORE;

DRV_cpp_putarg("-D__OPENDDS_IDL_HAS_ANNOTATIONS");
DRV_cpp_putarg("-DOPENDDS_HIDE_DYNMIC_DATA");

idl_global->eval(
"module OpenDDS {module internal {@annotation hidden_op_in_java {string impl;};};};\n");
Expand Down

0 comments on commit dfb2510

Please sign in to comment.