Skip to content

Commit

Permalink
Resolving peer review comments: misc formatting cleanup, direct use o…
Browse files Browse the repository at this point in the history
…f TimeDuration
  • Loading branch information
simpsont-oci committed Oct 4, 2024
1 parent 968edb3 commit 0071c2f
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/BuilderProcess.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "BuilderProcess.h"

#include "dds/DCPS/Service_Participant.h"
#include <dds/DCPS/Service_Participant.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/ConfigSectionManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ConfigSectionManager.h"

#include "dds/DCPS/Service_Participant.h"
#include <dds/DCPS/Service_Participant.h>

#include "ace/Configuration.h"

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/DataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "DataReaderListener.h"

#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/DataReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "TopicManager.h"

#include "dds/DdsDcpsSubscriptionC.h"
#include <dds/DdsDcpsSubscriptionC.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/DataWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "DataWriterListener.h"

#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/DataWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "ListenerFactory.h"
#include "TopicManager.h"

#include "dds/DdsDcpsPublicationC.h"
#include <dds/DdsDcpsPublicationC.h>

#include <map>

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/ListenerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <iostream>
#include <sstream>

#include "dds/DdsDcpsDomainC.h"
#include <dds/DdsDcpsDomainC.h>

namespace Builder {

Expand Down
4 changes: 2 additions & 2 deletions performance-tests/bench/builder/Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "ParticipantListener.h"

#include "dds/DCPS/Service_Participant.h"
#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DCPS/Service_Participant.h>
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/Participant.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "SubscriberManager.h"
#include "TopicManager.h"

#include "dds/DdsDcpsDomainC.h"
#include <dds/DdsDcpsDomainC.h>

namespace Builder {

Expand Down
4 changes: 2 additions & 2 deletions performance-tests/bench/builder/Publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "PublisherListener.h"

#include "dds/DdsDcpsDomainC.h"
#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DdsDcpsDomainC.h>
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
4 changes: 2 additions & 2 deletions performance-tests/bench/builder/Subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "SubscriberListener.h"

#include "dds/DdsDcpsDomainC.h"
#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DdsDcpsDomainC.h>
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
4 changes: 2 additions & 2 deletions performance-tests/bench/builder/Topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "TopicListener.h"
#include "TypeSupportRegistry.h"

#include "dds/DdsDcpsDomainC.h"
#include "dds/DCPS/transport/framework/TransportRegistry.h"
#include <dds/DdsDcpsDomainC.h>
#include <dds/DCPS/transport/framework/TransportRegistry.h>

namespace Builder {

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/Topic.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "dds/DdsDcpsTopicC.h"
#include <dds/DdsDcpsTopicC.h>

#include "Common.h"
#include "ListenerFactory.h"
Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/builder/TypeSupportRegistry.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Common.h"
#include "dds/DdsDcpsTopicC.h"
#include <dds/DdsDcpsTopicC.h>

#include <map>
#include <mutex>
Expand Down
3 changes: 1 addition & 2 deletions performance-tests/bench/worker/ForwardAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace {

const ACE_Time_Value ZERO(0, 0);
const size_t DEFAULT_QUEUE_SIZE(10u);

}
Expand Down Expand Up @@ -108,7 +107,7 @@ bool ForwardAction::init(const ActionConfig& config, ActionReport& report,
// hence 0 and 1 are not valid vector sizes and will not work
data_queue_.resize(queue_size > 0 ? queue_size + 1 : 2);

event_ = OpenDDS::DCPS::make_rch<MemFunEvent<ForwardAction> >(shared_from_this(), &ForwardAction::do_writes);
event_ = OpenDDS::DCPS::make_rch<MemFunEvent<ForwardAction>>(shared_from_this(), &ForwardAction::do_writes);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/worker/ForwardAction.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "dds/DCPS/EventDispatcher.h"
#include <dds/DCPS/EventDispatcher.h>

#include "Action.h"
#include "DataHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/worker/MemFunEvent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "dds/DCPS/EventDispatcher.h"
#include <dds/DCPS/EventDispatcher.h>

#include <memory>

Expand Down
10 changes: 5 additions & 5 deletions performance-tests/bench/worker/ReadAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "MemFunEvent.h"
#include "util.h"

#include "dds/DCPS/WaitSet.h"
#include <dds/DCPS/WaitSet.h>

namespace Bench {

Expand Down Expand Up @@ -48,7 +48,7 @@ bool ReadAction::init(const ActionConfig& config, ActionReport& report, Builder:
double period = 1.0 / read_frequency_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
read_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
read_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Then check period as double (seconds)
Expand All @@ -57,13 +57,13 @@ bool ReadAction::init(const ActionConfig& config, ActionReport& report, Builder:
double period = read_period_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
read_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
read_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Finally check period as TimeStamp
read_period_prop = get_property(config.params, "read_period", Builder::PVK_TIME);
if (read_period_prop) {
read_period_ = ACE_Time_Value(read_period_prop->value.time_prop().sec, static_cast<suseconds_t>(read_period_prop->value.time_prop().nsec / 1000u));
read_period_ = OpenDDS::DCPS::TimeDuration(read_period_prop->value.time_prop().sec, static_cast<suseconds_t>(read_period_prop->value.time_prop().nsec / 1000u));
}

event_ = OpenDDS::DCPS::make_rch<MemFunEvent<ReadAction> >(shared_from_this(), &ReadAction::do_read);
Expand Down Expand Up @@ -127,7 +127,7 @@ void ReadAction::do_read()
bool_guard bg(in_do_read_, cv_);
if (started_ && !stopped_) {
DDS::ConditionSeq active;
const DDS::Duration_t duration = {static_cast<CORBA::Long>(read_period_.sec()), static_cast<CORBA::ULong>(read_period_.usec() * 1000)};
const DDS::Duration_t duration = read_period_.to_dds_duration();
DDS::WaitSet_var ws_copy= ws_;
DDS::ReturnCode_t ret;

Expand Down
7 changes: 3 additions & 4 deletions performance-tests/bench/worker/ReadAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

#include "BenchTypeSupportImpl.h"

#include "dds/DCPS/GuardCondition.h"

#include "dds/DCPS/EventDispatcher.h"
#include <dds/DCPS/EventDispatcher.h>
#include <dds/DCPS/GuardCondition.h>

namespace Bench {

Expand All @@ -34,7 +33,7 @@ class ReadAction : public virtual Action, public std::enable_shared_from_this<Re
DataDataReader_var data_dr_;
DDS::WaitSet_var ws_;
WorkerDataReaderListener* dr_listener_;
ACE_Time_Value read_period_;
OpenDDS::DCPS::TimeDuration read_period_;
OpenDDS::DCPS::EventBase_rch event_;
bool in_do_read_;
};
Expand Down
8 changes: 4 additions & 4 deletions performance-tests/bench/worker/SetCftParametersAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool SetCftParametersAction::init(const ActionConfig& config, ActionReport& repo
double period = 1.0 / set_frequency_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
set_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
set_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Then check period as double (seconds)
Expand All @@ -104,13 +104,13 @@ bool SetCftParametersAction::init(const ActionConfig& config, ActionReport& repo
double period = set_period_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
set_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
set_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Finally check period as TimeStamp
set_period_prop = get_property(config.params, "set_period", Builder::PVK_TIME);
if (set_period_prop) {
set_period_ = ACE_Time_Value(set_period_prop->value.time_prop().sec, static_cast<suseconds_t>(set_period_prop->value.time_prop().nsec / 1000u));
set_period_ = OpenDDS::DCPS::TimeDuration(set_period_prop->value.time_prop().sec, static_cast<suseconds_t>(set_period_prop->value.time_prop().nsec / 1000u));
}

event_ = OpenDDS::DCPS::make_rch<MemFunEvent<SetCftParametersAction> >(shared_from_this(), &SetCftParametersAction::do_set_expression_parameters);
Expand Down Expand Up @@ -157,7 +157,7 @@ void SetCftParametersAction::do_set_expression_parameters()
}
#endif
}
last_scheduled_time_ += OpenDDS::DCPS::TimeDuration(set_period_);
last_scheduled_time_ += set_period_;
event_dispatcher_->schedule(event_, last_scheduled_time_);
}
}
Expand Down
9 changes: 5 additions & 4 deletions performance-tests/bench/worker/SetCftParametersAction.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#pragma once

#include "dds/DdsDcpsTopicC.h"

#include "Action.h"
#include "dds/DCPS/EventDispatcher.h"

#include "BenchTypeSupportImpl.h"

#include <dds/DdsDcpsTopicC.h>
#include <dds/DCPS/EventDispatcher.h>

#include <random>
#include <vector>

Expand All @@ -27,7 +28,7 @@ class SetCftParametersAction : public virtual Action, public std::enable_shared_
std::mutex mutex_;
OpenDDS::DCPS::EventDispatcher_rch event_dispatcher_;
bool started_, stopped_;
ACE_Time_Value set_period_;
OpenDDS::DCPS::TimeDuration set_period_;
size_t max_count_;
size_t param_count_;
bool random_order_;
Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/worker/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <map>
#include <vector>

#include "dds/DCPS/DCPS_Utils.h"
#include <dds/DCPS/DCPS_Utils.h>

// QosProfile

Expand Down
2 changes: 1 addition & 1 deletion performance-tests/bench/worker/WorkerDataReaderListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "DataReaderListener.h"
#include "PropertyStatBlock.h"

#include "dds/DCPS/DisjointSequence.h"
#include <dds/DCPS/DisjointSequence.h>

#include <unordered_map>
#include <condition_variable>
Expand Down
12 changes: 6 additions & 6 deletions performance-tests/bench/worker/WriteAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool WriteAction::init(const ActionConfig& config, ActionReport& report, Builder
double period = 1.0 / write_frequency_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
write_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
write_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Then check period as double (seconds)
Expand All @@ -117,13 +117,13 @@ bool WriteAction::init(const ActionConfig& config, ActionReport& report, Builder
double period = write_period_prop->value.double_prop();
int64_t sec = static_cast<int64_t>(period);
uint64_t usec = static_cast<uint64_t>((period - static_cast<double>(sec)) * 1000000u);
write_period_ = ACE_Time_Value(sec, static_cast<suseconds_t>(usec));
write_period_ = OpenDDS::DCPS::TimeDuration(sec, static_cast<suseconds_t>(usec));
}

// Finally check period as TimeStamp
write_period_prop = get_property(config.params, "write_period", Builder::PVK_TIME);
if (write_period_prop) {
write_period_ = ACE_Time_Value(write_period_prop->value.time_prop().sec, static_cast<suseconds_t>(write_period_prop->value.time_prop().nsec / 1000u));
write_period_ = OpenDDS::DCPS::TimeDuration(write_period_prop->value.time_prop().sec, static_cast<suseconds_t>(write_period_prop->value.time_prop().nsec / 1000u));
}

auto final_wait_for_ack_prop = get_property(config.params, "final_wait_for_ack", Builder::PVK_DOUBLE);
Expand Down Expand Up @@ -211,10 +211,10 @@ void WriteAction::do_write()
}

if (relative_scheduling_) {
last_scheduled_time_ = OpenDDS::DCPS::MonotonicTimePoint::now() + OpenDDS::DCPS::TimeDuration(write_period_);
} else {
last_scheduled_time_ += OpenDDS::DCPS::TimeDuration(write_period_);
last_scheduled_time_ = OpenDDS::DCPS::MonotonicTimePoint::now();
}
last_scheduled_time_ += write_period_;

event_dispatcher_->schedule(event_, last_scheduled_time_);
}
}
Expand Down
4 changes: 2 additions & 2 deletions performance-tests/bench/worker/WriteAction.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Action.h"
#include "dds/DCPS/EventDispatcher.h"
#include <dds/DCPS/EventDispatcher.h>
#include "BenchTypeSupportImpl.h"

#include <random>
Expand All @@ -26,7 +26,7 @@ class WriteAction : public virtual Action, public std::enable_shared_from_this<W
bool started_, stopped_, relative_scheduling_;
DataDataWriter_var data_dw_;
Data data_;
ACE_Time_Value write_period_;
OpenDDS::DCPS::TimeDuration write_period_;
OpenDDS::DCPS::MonotonicTimePoint last_scheduled_time_;
size_t max_count_;
size_t new_key_count_;
Expand Down

0 comments on commit 0071c2f

Please sign in to comment.