Skip to content

Commit

Permalink
[sigslots] gcc now needs assignment and copy constructors defined
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Jul 26, 2020
1 parent 858ec0f commit 96f3a9c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
7 changes: 7 additions & 0 deletions ecl_core_apps/src/benchmarks/eigen3_transforms.cpp
Expand Up @@ -68,6 +68,13 @@ class Pose2D {
x(x_), y(y_), rotation(theta)
{}
Pose2D(const Pose2D& pose) : x(pose.x), y(pose.y), rotation(pose.rotation) {}

void operator=( const Pose2D& pose) {
x = pose.x;
y = pose.y;
rotation = pose.rotation;
}

Pose2D inverse() const {
double s = sin(rotation);
double c = cos(rotation);
Expand Down
19 changes: 17 additions & 2 deletions ecl_sigslots/include/ecl/sigslots/signal.hpp
Expand Up @@ -74,7 +74,7 @@ class ECL_PUBLIC Signal {
*
* @param signal : the object to be copied.
*/
Signal(const Signal& signal) {
Signal(const Signal<Data>& signal) {
*this = signal;
sigslot->incrHandles();
}
Expand All @@ -93,6 +93,13 @@ class ECL_PUBLIC Signal {
}
}

/**
* @brief Default assignment operator.
*/
void operator=( const Signal<Data>& signal) {
sigslot = signal.sigslot;
}

/**
* @brief Make a connection to the specified topic.
*
Expand Down Expand Up @@ -175,10 +182,18 @@ class ECL_PUBLIC Signal<Void> {
*
* @param signal : the object to be copied.
*/
Signal(const Signal& signal) {
Signal(const Signal<Void>& signal) {
*this = signal;
sigslot->incrHandles();
}

/**
* @brief Default assignment operator.
*/
void operator=( const Signal<Void>& signal) {
sigslot = signal.sigslot;
}

/**
* @brief Default destructor.
*
Expand Down
16 changes: 14 additions & 2 deletions ecl_sigslots/include/ecl/sigslots/slot.hpp
Expand Up @@ -116,7 +116,7 @@ class ECL_PUBLIC Slot {
*
* @param slot : the object to be copied.
*/
Slot(const Slot& slot) {
Slot(const Slot<Data>& slot) {
*this = slot;
sigslot->incrHandles();
}
Expand All @@ -134,6 +134,12 @@ class ECL_PUBLIC Slot {
delete sigslot;
}
}
/**
* @brief Default assignment operator.
*/
void operator=( const Slot<Data>& slot) {
sigslot = slot.sigslot;
}
/**
* @brief Lists the topics this slot is connected to.
*
Expand Down Expand Up @@ -239,7 +245,7 @@ class ECL_PUBLIC Slot<Void> {
*
* @param slot : the object to be copied.
*/
Slot(const Slot& slot) {
Slot(const Slot<Void>& slot) {
*this = slot;
sigslot->incrHandles();
}
Expand All @@ -256,6 +262,12 @@ class ECL_PUBLIC Slot<Void> {
delete sigslot;
}
}
/**
* @brief Default assignment operator.
*/
void operator=( const Slot<Void>& slot) {
sigslot = slot.sigslot;
}
/**
* @brief Make a connection to the specified topic.
*
Expand Down

0 comments on commit 96f3a9c

Please sign in to comment.