Refactored decorator labels to static inline
This commit is contained in:
@@ -25,14 +25,6 @@
|
|||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace decorators {
|
namespace decorators {
|
||||||
|
|
||||||
const std::string note::label = "note";
|
|
||||||
const std::string skip::label = "skip";
|
|
||||||
const std::string skip_relationship::label = "skiprelationship";
|
|
||||||
const std::string style::label = "style";
|
|
||||||
const std::string aggregation::label = "aggregation";
|
|
||||||
const std::string composition::label = "composition";
|
|
||||||
const std::string association::label = "association";
|
|
||||||
|
|
||||||
std::shared_ptr<decorator> decorator::from_string(std::string_view c)
|
std::shared_ptr<decorator> decorator::from_string(std::string_view c)
|
||||||
{
|
{
|
||||||
if (c.find(note::label) == 0) {
|
if (c.find(note::label) == 0) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct note : public decorator {
|
struct note : public decorator {
|
||||||
static const std::string label;
|
static inline const std::string label{"note"};
|
||||||
|
|
||||||
std::string position{"left"};
|
std::string position{"left"};
|
||||||
std::string text;
|
std::string text;
|
||||||
@@ -54,19 +54,19 @@ struct note : public decorator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct skip : public decorator {
|
struct skip : public decorator {
|
||||||
static const std::string label;
|
static inline const std::string label{"skip"};
|
||||||
|
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct skip_relationship : public decorator {
|
struct skip_relationship : public decorator {
|
||||||
static const std::string label;
|
static inline const std::string label{"skiprelationship"};
|
||||||
|
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct style : public decorator {
|
struct style : public decorator {
|
||||||
static const std::string label;
|
static inline const std::string label{"style"};
|
||||||
|
|
||||||
std::string spec;
|
std::string spec;
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
@@ -77,19 +77,19 @@ struct relationship : public decorator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct aggregation : public relationship {
|
struct aggregation : public relationship {
|
||||||
static const std::string label;
|
static inline const std::string label{"aggregation"};
|
||||||
|
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct composition : public relationship {
|
struct composition : public relationship {
|
||||||
static const std::string label;
|
static inline const std::string label{"composition"};
|
||||||
|
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct association : public relationship {
|
struct association : public relationship {
|
||||||
static const std::string label;
|
static inline const std::string label{"association"};
|
||||||
|
|
||||||
static std::shared_ptr<decorator> from_string(std::string_view c);
|
static std::shared_ptr<decorator> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user