Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenDDS/OpenDDS into serialized-s…
Browse files Browse the repository at this point in the history
…ize-writer
  • Loading branch information
sonndinh committed Feb 3, 2024
2 parents 13e2d6e + 932dbb8 commit 24b876d
Show file tree
Hide file tree
Showing 36 changed files with 740 additions and 642 deletions.
263 changes: 103 additions & 160 deletions .github/workflows/build_and_test.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/dds-rtps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cd OpenDDS
./configure --optimize --no-debug --static --no-inline
tools/scripts/show_build_config.pl
- uses: ammaraskar/gcc-problem-matcher@0.2.0
- uses: ammaraskar/gcc-problem-matcher@0.3.0
- name: build OpenDDS
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ishapes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cd OpenDDS
./configure --optimize --no-debug --static --tests --qt
tools/scripts/show_build_config.pl
- uses: ammaraskar/gcc-problem-matcher@0.2.0
- uses: ammaraskar/gcc-problem-matcher@0.3.0
- name: build
shell: bash
run: |
Expand Down
24 changes: 18 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ my %platforminfo =
'specify how the target', 'build should work'],
},
'linux' => {
'compilers' => ['g++', 'clang', 'clang++'],
'compilers' => ['g++', 'clang++', 'clang'],
'libpath' => 'LD_LIBRARY_PATH',
'aceplatform' => 'linux_$NONSTDCOMP', # $NONSTDCOMP = clang
},
Expand Down Expand Up @@ -185,7 +185,7 @@ my @specs = # Array of array-refs, each inner array is an option group which
['Build platform and compiler:',
'host=s', 'Host (auto detect: linux, win32, macosx)',
'compiler=s', 'Compiler (auto detect / guess by searching PATH)',
'std=s', 'C++ standard version (for compilers that use -std)',
'std=s', 'C++ standard version (compiler default)',
'target=s', 'Cross-compile target (none): see --target-help',
'target-arch=s', 'Architecture for target (none): see --target-help',
'target-compiler=s', 'Compiler for target (if req\'d): see --target-help',
Expand Down Expand Up @@ -733,14 +733,26 @@ EOF

if ($ver >= 19) {
push(@{$opts{'features'}}, 'no_cxx11=0');
print "Visual C++ has C++11 support\n" if $opts{'verbose'};
print "Visual C++ has >= C++11 support\n" if $opts{'verbose'};
}
if ($opts{'std'}) {
# Accept any of --std=17, --std=stdcpp17, --std=c++17, etc.
$opts{'std'} =~ s/^(std)?(cpp|c\+\+)//;
my $prefix = 'stdcpp';
push(@{$opts{'mpcopts'}}, "-value_template LanguageStandard=$prefix$opts{'std'}");
print "Setting Visual C++ LanguageStandard to $prefix$opts{'std'}\n" if $opts{'verbose'};
if ($opts{'std'} eq 'latest' || $opts{'std'} >= 17) {
push(@{$opts{'features'}}, 'no_cxx17=0');
print "Visual C++ has >= C++17 support\n" if $opts{'verbose'};
}
}
$ENV{'PATH'} = $savepath;
print "Detected Visual C++ version: $opts{'compiler_version'}\n"
if $opts{'verbose'};
}
elsif ($opts{'compiler'} =~ /g\+\+/) { # GCC or Clang
elsif ($opts{'compiler'} =~ /g\+\+|clang/) {
my $version_string = `$opts{'compiler'} --version`;
print "Compiler version: $version_string\n" if $opts{'verbose'};
if ($opts{'std'}) {
push(@{$opts{'macros'}}, 'CCFLAGS += -std=' . $opts{'std'});
print "Added platform_macros for -std=$opts{std}\n" if $opts{'verbose'};
Expand Down Expand Up @@ -2123,8 +2135,8 @@ sub write_opendds_mwc {
if (!defined(\$ENV{ACE_ROOT}) || !defined(\$ENV{MPC_ROOT})) {
die("The enviroment needs to be setup.");
}
exec('perl', "\$ENV{ACE_ROOT}/bin/mwc.pl", $args, \@ARGV)
or die("Failed to exec mwc: \$!");
system('perl', "\$ENV{ACE_ROOT}/bin/mwc.pl", $args, \@ARGV) == 0
or die("Failed to run mwc: \$!");
EOF
$fd->close();
print "Wrote $path\n" if $opts{'verbose'};
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/DataWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ DataWriterImpl::add_association(const ReaderAssociation& reader,
ACE_GUARD(ACE_Thread_Mutex, reader_info_guard, this->reader_info_lock_);
reader_info_.insert(std::make_pair(reader.readerId,
ReaderInfo(reader.filterClassName,
publisher_content_filter_ ? reader.filterExpression : "",
publisher_content_filter_ ? reader.filterExpression.in() : "",
reader.exprParams, participant_servant_,
reader.readerQos.durability.kind > DDS::VOLATILE_DURABILITY_QOS)));
}
Expand Down
8 changes: 5 additions & 3 deletions dds/DCPS/LinuxNetworkConfigMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ bool LinuxNetworkConfigMonitor::open_i()
if (socket_.open(addr, AF_NETLINK, NETLINK_ROUTE) != 0) {
#ifdef ACE_ANDROID
if (log_level >= LogLevel::Warning) {
ACE_ERROR((LM_WARNING, "(%P|%t) WARNING: LinuxNetworkConfigMonitor::open_i: could not open socket"
" this is expected for API30+\n"));
ACE_ERROR((LM_WARNING, "(%P|%t) WARNING: LinuxNetworkConfigMonitor::open_i: "
"could not open Netlink socket "
"(this is expected for API>=30, see Android section in the Developer's Guide)\n"));
}
#else
if (log_level >= LogLevel::Error) {
ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: LinuxNetworkConfigMonitor::open_i: could not open socket: %m\n"));
ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: LinuxNetworkConfigMonitor::open_i: "
"could not open Netlink socket: %m\n"));
}
#endif
return false;
Expand Down
11 changes: 4 additions & 7 deletions dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ DCPS::NetworkAddress
RtpsDiscoveryConfig::sedp_local_address() const
{
return TheServiceParticipant->config_store()->get(config_key("SEDP_LOCAL_ADDRESS").c_str(),
DCPS::NetworkAddress::default_IPV4,
DCPS::ConfigStoreImpl::Format_Required_Port,
TheServiceParticipant->default_address(),
DCPS::ConfigStoreImpl::Format_Optional_Port,
DCPS::ConfigStoreImpl::Kind_IPV4);
}

Expand All @@ -332,7 +332,7 @@ RtpsDiscoveryConfig::sedp_local_address(const DCPS::NetworkAddress& mi)
{
TheServiceParticipant->config_store()->set(config_key("SEDP_LOCAL_ADDRESS").c_str(),
mi,
DCPS::ConfigStoreImpl::Format_Required_Port,
DCPS::ConfigStoreImpl::Format_Optional_Port,
DCPS::ConfigStoreImpl::Kind_IPV4);
}

Expand All @@ -357,11 +357,8 @@ RtpsDiscoveryConfig::sedp_advertised_local_address(const DCPS::NetworkAddress& m
DCPS::NetworkAddress
RtpsDiscoveryConfig::spdp_local_address() const
{
const DCPS::NetworkAddress d1(TheServiceParticipant->default_address());
const DCPS::NetworkAddress d2("0.0.0.0:0");

return TheServiceParticipant->config_store()->get(config_key("SPDP_LOCAL_ADDRESS").c_str(),
d1 ? d1 : d2,
TheServiceParticipant->default_address(),
DCPS::ConfigStoreImpl::Format_Optional_Port,
DCPS::ConfigStoreImpl::Kind_IPV4);
}
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/ReplayerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ ReplayerImpl::add_association(const ReaderAssociation& reader,
{
ACE_GUARD(ACE_Recursive_Thread_Mutex, guard, this->lock_);
reader_info_.insert(std::make_pair(reader.readerId,
ReaderInfo(TheServiceParticipant->publisher_content_filter() ? reader.filterExpression : "",
ReaderInfo(TheServiceParticipant->publisher_content_filter() ? reader.filterExpression.in() : "",
reader.exprParams, participant_servant_,
reader.readerQos.durability.kind > DDS::VOLATILE_DURABILITY_QOS)));
}
Expand Down
1 change: 1 addition & 0 deletions dds/DCPS/Service_Participant.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const String OPENDDS_COMMON_DCPS_CONFIG_FILE_default = "";
const char OPENDDS_COMMON_DCPS_DEBUG_LEVEL[] = "OPENDDS_COMMON_DCPS_DEBUG_LEVEL";

const char OPENDDS_COMMON_DCPS_DEFAULT_ADDRESS[] = "OPENDDS_COMMON_DCPS_DEFAULT_ADDRESS";
// Can't use NetworkAddress::default_IPV4 due to static initialization.
const NetworkAddress OPENDDS_COMMON_DCPS_DEFAULT_ADDRESS_default = NetworkAddress("0.0.0.0:0");

const char OPENDDS_COMMON_DCPS_DEFAULT_DISCOVERY[] = "OPENDDS_COMMON_DCPS_DEFAULT_DISCOVERY";
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ThreadPool::ThreadPool(size_t count, FunPtr fun, void* arg)
#ifdef OPENDDS_NO_THREAD_JOIN
, finished_threads_(0)
#endif
, ids_(count, ACE_thread_t())
, ids_(count)
{
{
ACE_Guard<ACE_Thread_Mutex> guard(mutex_);
Expand Down
24 changes: 0 additions & 24 deletions dds/DCPS/transport/framework/TransportInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,6 @@ TransportInst::~TransportInst()
DBG_ENTRY_LVL("TransportInst","~TransportInst",6);
}

int
TransportInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect)
{
process_section(*TheServiceParticipant->config_store(),
ConfigReader_rch(),
ConfigReaderListener_rch(),
config_prefix_,
cf,
sect,
"",
false);

ACE_TString stringvalue;
if (cf.get_string_value (sect, ACE_TEXT("passive_connect_duration"), stringvalue) == 0) {
ACE_DEBUG ((LM_WARNING,
ACE_TEXT ("(%P|%t) WARNING: passive_connect_duration option ")
ACE_TEXT ("is deprecated in the transport inst, must be ")
ACE_TEXT ("defined in transport config.\n")));
}

return 0;
}

void
TransportInst::dump(DDS::DomainId_t domain) const
{
Expand Down
10 changes: 0 additions & 10 deletions dds/DCPS/transport/framework/TransportInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@

#include <ace/Synch_Traits.h>

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Configuration_Heap;
class ACE_Configuration_Section_Key;
ACE_END_VERSIONED_NAMESPACE_DECL

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL

namespace OpenDDS {
Expand Down Expand Up @@ -79,11 +74,6 @@ class OpenDDS_Dcps_Export TransportInst : public virtual RcObject {

bool is_template() const { return is_template_; }

/// Overwrite the default configurations with the configuration from the
/// given section in the ACE_Configuration_Heap object.
virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

/// Diagnostic aid.
void dump(DDS::DomainId_t domain) const;
virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t domain) const;
Expand Down
1 change: 0 additions & 1 deletion dds/DCPS/transport/framework/TransportRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ TransportRegistry::load_transport_configuration(const OPENDDS_STRING& file_name,
}

instances.push_back(inst);
inst->load(cf, inst_sect);

// store the transport info
TransportEntry entry;
Expand Down
9 changes: 0 additions & 9 deletions dds/DCPS/transport/multicast/MulticastInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ MulticastInst::MulticastInst(const std::string& name)
, async_send_(*this, &MulticastInst::async_send, &MulticastInst::async_send)
{}

int
MulticastInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect)
{
TransportInst::load(cf, sect); // delegate to parent

return 0;
}

TransportImpl_rch
MulticastInst::new_impl(DDS::DomainId_t domain)
{
Expand Down
3 changes: 0 additions & 3 deletions dds/DCPS/transport/multicast/MulticastInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ class OpenDDS_Multicast_Export MulticastInst
void async_send(bool as);
bool async_send() const;

virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

/// Diagnostic aid.
virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t) const;

Expand Down
8 changes: 0 additions & 8 deletions dds/DCPS/transport/rtps_udp/RtpsUdpInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,6 @@ RtpsUdpInst::new_impl(DDS::DomainId_t domain)
return make_rch<RtpsUdpTransport>(rchandle_from(this), domain);
}

int
RtpsUdpInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect)
{
TransportInst::load(cf, sect); // delegate to parent
return 0;
}

OPENDDS_STRING
RtpsUdpInst::dump_to_str(DDS::DomainId_t domain) const
{
Expand Down
3 changes: 0 additions & 3 deletions dds/DCPS/transport/rtps_udp/RtpsUdpInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ class OpenDDS_Rtps_Udp_Export RtpsUdpInst : public TransportInst {
void send_delay(const TimeDuration& sd);
TimeDuration send_delay() const;

virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

/// Diagnostic aid.
virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t domain) const;

Expand Down
8 changes: 0 additions & 8 deletions dds/DCPS/transport/shmem/ShmemInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ ShmemInst::new_impl(DDS::DomainId_t domain)
return make_rch<ShmemTransport>(rchandle_from(this), domain);
}

int
ShmemInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect)
{
TransportInst::load(cf, sect);
return 0;
}

OPENDDS_STRING
ShmemInst::dump_to_str(DDS::DomainId_t domain) const
{
Expand Down
3 changes: 0 additions & 3 deletions dds/DCPS/transport/shmem/ShmemInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class OpenDDS_Shmem_Export ShmemInst : public TransportInst {
public:
static const TimeDuration default_association_resend_period;

virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t domain) const;

/// Size (in bytes) of the single shared-memory pool allocated by this
Expand Down
10 changes: 1 addition & 9 deletions dds/DCPS/transport/tcp/TcpInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ OpenDDS::DCPS::TcpInst::new_impl(DDS::DomainId_t domain)
return make_rch<TcpTransport>(rchandle_from(this), domain);
}

int
OpenDDS::DCPS::TcpInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& trans_sect)
{
TransportInst::load(cf, trans_sect);
return 0;
}

OPENDDS_STRING
OpenDDS::DCPS::TcpInst::dump_to_str(DDS::DomainId_t domain) const
{
Expand All @@ -60,7 +52,7 @@ OpenDDS::DCPS::TcpInst::dump_to_str(DDS::DomainId_t domain) const
size_t
OpenDDS::DCPS::TcpInst::populate_locator(OpenDDS::DCPS::TransportLocator& local_info,
ConnectionInfoFlags,
DDS::DomainId_t domain) const
DDS::DomainId_t) const
{
const std::string local_addr = local_address();
const std::string locator_addr = get_locator_address();
Expand Down
3 changes: 0 additions & 3 deletions dds/DCPS/transport/tcp/TcpInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class OpenDDS_Tcp_Export TcpInst
static const int DEFAULT_PASSIVE_RECONNECT_DURATION = 2000;
static const int DEFAULT_ACTIVE_CONN_TIMEOUT_PERIOD = 5000;

virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

/// Diagnostic aid.
virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t domain) const;

Expand Down
8 changes: 0 additions & 8 deletions dds/DCPS/transport/udp/UdpInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ UdpInst::new_impl(DDS::DomainId_t domain)
return make_rch<UdpTransport>(rchandle_from(this), domain);
}

int
UdpInst::load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect)
{
TransportInst::load(cf, sect); // delegate to parent
return 0;
}

OPENDDS_STRING
UdpInst::dump_to_str(DDS::DomainId_t domain) const
{
Expand Down
3 changes: 0 additions & 3 deletions dds/DCPS/transport/udp/UdpInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class OpenDDS_Udp_Export UdpInst : public TransportInst {
void rcv_buffer_size(ACE_INT32 rbs);
ACE_INT32 rcv_buffer_size() const;

virtual int load(ACE_Configuration_Heap& cf,
ACE_Configuration_Section_Key& sect);

/// Diagnostic aid.
virtual OPENDDS_STRING dump_to_str(DDS::DomainId_t) const;

Expand Down
2 changes: 1 addition & 1 deletion dds/idl/langmap_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,7 @@ struct Cxx11Generator : GeneratorBase
const std::vector<AST_UnionBranch*>& branches, AST_Type* discriminator)
{
const ScopedNamespaceGuard namespaces(name, be_global->lang_header_);
const ScopedNamespaceGuard namespacesCpp(name, be_global->impl_);
const char* const nm = name->last_component()->get_string();
const std::string d_type = generator_->map_type(discriminator);
const std::string defVal = generateDefaultValue(u);
Expand Down Expand Up @@ -1818,7 +1819,6 @@ struct Cxx11Generator : GeneratorBase
gen_common_strunion_post(nm);
gen_union_pragma_post();

const ScopedNamespaceGuard namespacesCpp(name, be_global->impl_);
be_global->impl_ <<
nm << "::" << nm << "(const " << nm << "& rhs)\n"
"{\n"
Expand Down
Loading

0 comments on commit 24b876d

Please sign in to comment.