Skip to content

Commit 001883e

Browse files
authored
Merge pull request #31 from ethz-asl/fix/virtual-dtors
Fix missing virtual destructors
2 parents 03c55f6 + 0bef296 commit 001883e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ $ git submodule add [email protected]:ethz-asl/lpp.git
100100
```cmake
101101
add_subdirectory(my_submodule_dir/lpp)
102102
add_executable(my_executable main.cpp)
103-
target_link_libraries(my_executable Log++)
103+
target_link_libraries(my_executable lpp)
104104
```
105105

106106
3. To update Log++ to the latest commit, execute the following commands:

include/log++.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ class InternalCondLog : public InternalLog {
671671
: InternalLog(severity) {
672672
should_print_ = cond;
673673
}
674+
~InternalCondLog() override = default;
674675
};
675676

676677

@@ -679,12 +680,14 @@ class LogPolicyBase {
679680
virtual void update() = 0;
680681
[[nodiscard]] virtual bool shouldLog() const = 0;
681682
virtual void onLog() {};
683+
virtual ~LogPolicyBase() = default;
682684
};
683685

684686
template<typename T>
685687
class LogPolicy : public LogPolicyBase {
686688
public:
687689
explicit LogPolicy(T max) : max_(max) {}
690+
~LogPolicy() override = default;
688691
protected:
689692
T max_{0};
690693
};
@@ -716,7 +719,7 @@ class OccasionPolicy : public CountableLogPolicy {
716719
return should_log_;
717720
}
718721

719-
virtual ~OccasionPolicy() = default;
722+
~OccasionPolicy() override = default;
720723
private:
721724
bool should_log_{false};
722725
};
@@ -738,7 +741,7 @@ class FirstNOccurrencesPolicy : public CountableLogPolicy {
738741
return !is_n_occurences_reached;
739742
}
740743

741-
virtual ~FirstNOccurrencesPolicy() = default;
744+
~FirstNOccurrencesPolicy() override = default;
742745
private:
743746
bool is_n_occurences_reached = false;
744747
};
@@ -764,7 +767,7 @@ class TimePolicy : public LogPolicy<float> {
764767
last_ = now_;
765768
}
766769

767-
virtual ~TimePolicy() = default;
770+
~TimePolicy() override = default;
768771
private:
769772
long now_{0};
770773
long last_{0};

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>lpp</name>
44
<version>0.1.0</version>
55
<description>Log++ Logging framework</description>
6-
<maintainer email="[email protected]">4c3y</maintainer>
6+
<maintainer email="[email protected]">4c3y</maintainer>
77
<license>BSD</license>
88
<buildtool_depend>catkin</buildtool_depend>
99
<depend>roscpp</depend>

0 commit comments

Comments
 (0)