Skip to content

Commit

Permalink
Option is abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Oct 16, 2024
1 parent afd56b4 commit c6b0a49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ struct arglist_t {
const uint32_t argtype{ARGTYPE_UNKNOWN};
const QString minvalue; /* minimum value for numeric options */
const QString maxvalue; /* maximum value for numeric options */
char* argvalptr{nullptr}; /* !!! internal helper. Not used in definitions !!! */
char* unused{nullptr}; /* TODO: delete from initialization lists */
};

enum ff_type {
Expand Down
10 changes: 7 additions & 3 deletions option.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#ifndef OPTION_H_INCLUDED_
#define OPTION_H_INCLUDED_

#include "defs.h"
#include <QByteArray> // for QByteArray
#include <QString> // for QString, operator!=


class Option
class Option /* Abstract Class */
{
public:
/* Types */
Expand Down Expand Up @@ -53,6 +53,10 @@ class Option
virtual bool isEmpty() const = 0;
virtual const QString& get() const = 0;
virtual void set(const QString& s) = 0;

/* Data Members */
// I.25: Prefer empty abstract classes as interfaces to class hierarchies
// https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i25-prefer-empty-abstract-classes-as-interfaces-to-class-hierarchies
};

class OptionCString : public Option
Expand Down

0 comments on commit c6b0a49

Please sign in to comment.