Cleaned up the reflection code a bit

* Renamed 'tag' variable to 'handler'
* Removed addAlias stuff, instead check for matching names with if statements
* Added after_reading function that is called by Reader after reading a complete object. This generalizes Packaged::validate, which is now also called via this mechanism.
* Removed some backwards compatibility with <0.3.0 for templates
This commit is contained in:
Twan van Laarhoven
2020-04-26 15:33:59 +02:00
parent 4bebd48786
commit 40d78edf0f
32 changed files with 248 additions and 281 deletions
+5 -4
View File
@@ -220,8 +220,9 @@ class SymbolShape : public SymbolPart {
/// Calculate the position and size of the part using the given rotation matrix
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity);
DECLARE_REFLECTION();
DECLARE_REFLECTION_OVERRIDE();
};
void after_reading(SymbolShape&, Version);
// ----------------------------------------------------------------------------- : SymbolGroup
@@ -242,7 +243,7 @@ class SymbolGroup : public SymbolPart {
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity);
DECLARE_REFLECTION();
DECLARE_REFLECTION_OVERRIDE();
};
// ----------------------------------------------------------------------------- : SymbolSymmetry
@@ -273,7 +274,7 @@ class SymbolSymmetry : public SymbolGroup {
String expectedName() const;
virtual Bounds calculateBounds(const Vector2D& origin, const Matrix2D& m, bool is_identity);
DECLARE_REFLECTION();
DECLARE_REFLECTION_OVERRIDE();
};
// ----------------------------------------------------------------------------- : Symbol
@@ -287,7 +288,7 @@ class Symbol : public SymbolGroup {
/// Determine the aspect ratio best suited for this symbol
double aspectRatio() const;
DECLARE_REFLECTION();
DECLARE_REFLECTION_OVERRIDE();
};
/// A default symbol: a square