Skip to content

Commit

Permalink
Rule of zero: If you can avoid defining default operations, do
Browse files Browse the repository at this point in the history
  • Loading branch information
Timple committed Feb 15, 2024
1 parent 091f29f commit 7110ca0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
15 changes: 0 additions & 15 deletions rclcpp/include/rclcpp/time.hpp
Expand Up @@ -53,10 +53,6 @@ class Time
RCLCPP_PUBLIC
explicit Time(int64_t nanoseconds = 0, rcl_clock_type_t clock_type = RCL_SYSTEM_TIME);

/// Copy constructor
RCLCPP_PUBLIC
Time(const Time & rhs);

/// Time constructor
/**
* \param time_msg builtin_interfaces time message to copy
Expand All @@ -75,21 +71,10 @@ class Time
RCLCPP_PUBLIC
explicit Time(const rcl_time_point_t & time_point);

/// Time destructor
RCLCPP_PUBLIC
virtual ~Time();

/// Return a builtin_interfaces::msg::Time object based
RCLCPP_PUBLIC
operator builtin_interfaces::msg::Time() const;

/**
* \throws std::runtime_error if seconds are negative
*/
RCLCPP_PUBLIC
Time &
operator=(const Time & rhs);

/**
* Assign Time from a builtin_interfaces::msg::Time instance.
* The clock_type will be reset to RCL_ROS_TIME.
Expand Down
9 changes: 0 additions & 9 deletions rclcpp/src/rclcpp/time.cpp
Expand Up @@ -63,8 +63,6 @@ Time::Time(int64_t nanoseconds, rcl_clock_type_t clock_type)
rcl_time_.nanoseconds = nanoseconds;
}

Time::Time(const Time & rhs) = default;

Time::Time(
const builtin_interfaces::msg::Time & time_msg,
rcl_clock_type_t clock_type)
Expand All @@ -84,18 +82,11 @@ Time::Time(const rcl_time_point_t & time_point)
// noop
}

Time::~Time()
{
}

Time::operator builtin_interfaces::msg::Time() const
{
return convert_rcl_time_to_sec_nanos(rcl_time_.nanoseconds);
}

Time &
Time::operator=(const Time & rhs) = default;

Time &
Time::operator=(const builtin_interfaces::msg::Time & time_msg)
{
Expand Down

0 comments on commit 7110ca0

Please sign in to comment.