Skip to content

Commit 9f6fc4f

Browse files
authored
refactor: make Signal to be type alias of std::string (#80)
std::string is not designed to be inherited form. The destructor of std::string isn't virtual. Signed-off-by: ComixHe <[email protected]>
1 parent dcef24b commit 9f6fc4f

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

include/ocppi/cli/CommonCLI.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct DeleteOption;
3131
struct ExecOption;
3232
struct KillOption;
3333
struct ListOption;
34-
class Signal;
3534
struct StartOption;
3635
struct StateOption;
3736
struct GlobalOption;

include/ocppi/runtime/Signal.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
#include <string>
44

5-
namespace ocppi::runtime
6-
{
7-
8-
class Signal : public std::string {
9-
using std::string::string;
10-
};
5+
namespace ocppi::runtime {
116

7+
using Signal = std::string;
128
}

include/ocppi/runtime/SpecRuntime.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "ocppi/runtime/DeleteOption.hpp"
1111
#include "ocppi/runtime/FeaturesOption.hpp"
1212
#include "ocppi/runtime/KillOption.hpp"
13+
#include "ocppi/runtime/Signal.hpp"
1314
#include "ocppi/runtime/StartOption.hpp"
1415
#include "ocppi/runtime/StateOption.hpp"
1516
#include "ocppi/runtime/features/types/Features.hpp"
@@ -24,8 +25,6 @@ namespace state::types
2425
struct State;
2526
}
2627

27-
class Signal;
28-
2928
class SpecRuntime {
3029
public:
3130
SpecRuntime() = default;

0 commit comments

Comments
 (0)