Skip to content

Commit

Permalink
refactor: make Signal to be type alisa of std::string
Browse files Browse the repository at this point in the history
std::string is not designed to be inherited form.
The destructor of std::string isn't virtual.

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
  • Loading branch information
ComixHe committed Feb 11, 2025
1 parent dcef24b commit 95322a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion include/ocppi/cli/CommonCLI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct DeleteOption;
struct ExecOption;
struct KillOption;
struct ListOption;
class Signal;
struct StartOption;
struct StateOption;
struct GlobalOption;
Expand Down
8 changes: 2 additions & 6 deletions include/ocppi/runtime/Signal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

#include <string>

namespace ocppi::runtime
{

class Signal : public std::string {
using std::string::string;
};
namespace ocppi::runtime {

using Signal = std::string;
}
3 changes: 1 addition & 2 deletions include/ocppi/runtime/SpecRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ocppi/runtime/DeleteOption.hpp"
#include "ocppi/runtime/FeaturesOption.hpp"
#include "ocppi/runtime/KillOption.hpp"
#include "ocppi/runtime/Signal.hpp"
#include "ocppi/runtime/StartOption.hpp"
#include "ocppi/runtime/StateOption.hpp"
#include "ocppi/runtime/features/types/Features.hpp"
Expand All @@ -24,8 +25,6 @@ namespace state::types
struct State;
}

class Signal;

class SpecRuntime {
public:
SpecRuntime() = default;
Expand Down

0 comments on commit 95322a7

Please sign in to comment.