From f78f5d3070ba3cfdefb7ee162a535c3dc9bb09f0 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 11 Jun 2015 15:37:29 +0200 Subject: [PATCH] inherit constructors in wrappers --- acast2/src/acast.cpp | 1 + alib2data/src/alphabet/Symbol.h | 11 +---------- alib2data/src/automaton/Automaton.cpp | 1 + alib2data/src/automaton/Automaton.h | 13 ++----------- alib2data/src/container/Container.h | 11 +---------- alib2data/src/grammar/Grammar.h | 11 +---------- alib2data/src/graph/Graph.h | 11 +---------- alib2data/src/label/Label.h | 11 +---------- alib2data/src/object/Object.h | 11 +---------- alib2data/src/primitive/Primitive.h | 11 +---------- alib2data/src/regexp/RegExp.cpp | 1 + alib2data/src/regexp/RegExp.h | 15 +++------------ alib2data/src/string/String.h | 11 +---------- alib2data/src/tree/Tree.h | 11 +---------- 14 files changed, 17 insertions(+), 113 deletions(-) diff --git a/acast2/src/acast.cpp b/acast2/src/acast.cpp index 995427d271..0cd74c1ee1 100644 --- a/acast2/src/acast.cpp +++ b/acast2/src/acast.cpp @@ -12,6 +12,7 @@ #include <sax/SaxParseInterface.h> #include <sax/ParserException.h> #include <object/Object.h> +#include <string/LinearString.h> #include "cast/AutomatonCastVisitor.h" #include "cast/GrammarCastVisitor.h" diff --git a/alib2data/src/alphabet/Symbol.h b/alib2data/src/alphabet/Symbol.h index 8b06ad97ba..4f896bac5b 100644 --- a/alib2data/src/alphabet/Symbol.h +++ b/alib2data/src/alphabet/Symbol.h @@ -20,16 +20,7 @@ namespace alphabet { * Wrapper around automata. */ class Symbol : public alib::wrapper<SymbolBase> { -public: - explicit Symbol(SymbolBase* data) : alib::wrapper<SymbolBase>(data) { - } - - explicit Symbol(const SymbolBase& data) : alib::wrapper<SymbolBase>(data.clone()) { - } - - explicit Symbol(SymbolBase&& data) : alib::wrapper<SymbolBase>(std::move(data).plunder()) { - } - + using alib::wrapper<SymbolBase>::wrapper; }; /** diff --git a/alib2data/src/automaton/Automaton.cpp b/alib2data/src/automaton/Automaton.cpp index 005b22ebb7..4485dc10a0 100644 --- a/alib2data/src/automaton/Automaton.cpp +++ b/alib2data/src/automaton/Automaton.cpp @@ -6,6 +6,7 @@ */ #include "Automaton.h" +#include "common/State.h" #include "../label/NextLabel.h" #include <climits> #include "AutomatonException.h" diff --git a/alib2data/src/automaton/Automaton.h b/alib2data/src/automaton/Automaton.h index e48e3c5a55..c62bba56f3 100644 --- a/alib2data/src/automaton/Automaton.h +++ b/alib2data/src/automaton/Automaton.h @@ -11,7 +11,7 @@ #include "AutomatonBase.h" #include "../common/wrapper.hpp" -#include "common/State.h" +#include "AutomatonFeatures.h" #include <set> namespace automaton { @@ -20,16 +20,7 @@ namespace automaton { * Wrapper around automata. */ class Automaton : public alib::wrapper<AutomatonBase> { -public: - explicit Automaton(AutomatonBase* data) : alib::wrapper<AutomatonBase>(data) { - } - - explicit Automaton(const AutomatonBase& data) : alib::wrapper<AutomatonBase>(data.clone()) { - } - - explicit Automaton(AutomatonBase&& data) : alib::wrapper<AutomatonBase>(std::move(data).plunder()) { - } - + using alib::wrapper<AutomatonBase>::wrapper; }; State createUniqueState(State base, const std::set<State>& other); diff --git a/alib2data/src/container/Container.h b/alib2data/src/container/Container.h index bb93ef33f2..e2a45addf5 100644 --- a/alib2data/src/container/Container.h +++ b/alib2data/src/container/Container.h @@ -17,16 +17,7 @@ namespace container { * Wrapper around containers. */ class Container : public alib::wrapper<ContainerBase> { -public: - explicit Container(ContainerBase* data) : alib::wrapper<ContainerBase>(data) { - } - - explicit Container(const ContainerBase& data) : alib::wrapper<ContainerBase>(data.clone()) { - } - - explicit Container(ContainerBase&& data) : alib::wrapper<ContainerBase>(std::move(data).plunder()) { - } - + using alib::wrapper<ContainerBase>::wrapper; }; } /* namespace container */ diff --git a/alib2data/src/grammar/Grammar.h b/alib2data/src/grammar/Grammar.h index bfdeecc943..f91343fd26 100644 --- a/alib2data/src/grammar/Grammar.h +++ b/alib2data/src/grammar/Grammar.h @@ -17,16 +17,7 @@ namespace grammar { * Wrapper around grammars. */ class Grammar : public alib::wrapper<GrammarBase> { -public: - explicit Grammar(GrammarBase* data) : alib::wrapper<GrammarBase>(data) { - } - - explicit Grammar(const GrammarBase& data) : alib::wrapper<GrammarBase>(data.clone()) { - } - - explicit Grammar(GrammarBase&& data) : alib::wrapper<GrammarBase>(std::move(data).plunder()) { - } - + using alib::wrapper<GrammarBase>::wrapper; }; } /* namespace grammar */ diff --git a/alib2data/src/graph/Graph.h b/alib2data/src/graph/Graph.h index 16c52070cc..66f43a9d14 100644 --- a/alib2data/src/graph/Graph.h +++ b/alib2data/src/graph/Graph.h @@ -15,16 +15,7 @@ namespace graph { // Wrapper around graphs. class Graph : public alib::wrapper<GraphBase> { -public: - explicit Graph(GraphBase* data) : alib::wrapper<GraphBase>(data) { - } - - explicit Graph(const GraphBase& data) : alib::wrapper<GraphBase>(data.clone()) { - } - - explicit Graph(GraphBase&& data) : alib::wrapper<GraphBase>(std::move(data).plunder()) { - } - + using alib::wrapper<GraphBase>::wrapper; }; } // namespace graph diff --git a/alib2data/src/label/Label.h b/alib2data/src/label/Label.h index bb5b6326f0..5e670b3a63 100644 --- a/alib2data/src/label/Label.h +++ b/alib2data/src/label/Label.h @@ -17,16 +17,7 @@ namespace label { * Wrapper around automata. */ class Label : public alib::wrapper<LabelBase> { -public: - explicit Label(LabelBase* data) : alib::wrapper<LabelBase>(data) { - } - - explicit Label(const LabelBase& data) : alib::wrapper<LabelBase>(data.clone()) { - } - - explicit Label(LabelBase&& data) : alib::wrapper<LabelBase>(std::move(data).plunder()) { - } - + using alib::wrapper<LabelBase>::wrapper; }; label::Label labelFrom(int number); diff --git a/alib2data/src/object/Object.h b/alib2data/src/object/Object.h index edd75f5a34..33a5293b52 100644 --- a/alib2data/src/object/Object.h +++ b/alib2data/src/object/Object.h @@ -17,16 +17,7 @@ namespace alib { * Wrapper around object. */ class Object : public alib::wrapper<ObjectBase> { -public: - explicit Object(ObjectBase* data) : alib::wrapper<ObjectBase>(data) { - } - - explicit Object(const ObjectBase& data) : alib::wrapper<ObjectBase>(data.clone()) { - } - - explicit Object(ObjectBase&& data) : alib::wrapper<ObjectBase>(std::move(data).plunder()) { - } - + using alib::wrapper<ObjectBase>::wrapper; }; } /* namespace alib */ diff --git a/alib2data/src/primitive/Primitive.h b/alib2data/src/primitive/Primitive.h index 2a9752f987..ec980b94c3 100644 --- a/alib2data/src/primitive/Primitive.h +++ b/alib2data/src/primitive/Primitive.h @@ -17,16 +17,7 @@ namespace primitive { * Wrapper around primitive data types. */ class Primitive : public alib::wrapper<PrimitiveBase> { -public: - explicit Primitive(PrimitiveBase* data) : alib::wrapper<PrimitiveBase>(data) { - } - - explicit Primitive(const PrimitiveBase& data) : alib::wrapper<PrimitiveBase>(data.clone()) { - } - - explicit Primitive(PrimitiveBase&& data) : alib::wrapper<PrimitiveBase>(std::move(data).plunder()) { - } - + using alib::wrapper<PrimitiveBase>::wrapper; }; Primitive primitiveFrom(int number); diff --git a/alib2data/src/regexp/RegExp.cpp b/alib2data/src/regexp/RegExp.cpp index 9e14a6ea7e..93b9870825 100644 --- a/alib2data/src/regexp/RegExp.cpp +++ b/alib2data/src/regexp/RegExp.cpp @@ -7,6 +7,7 @@ #include "RegExp.h" #include "../alphabet/Symbol.h" +#include "../string/LinearString.h" #include "unbounded/UnboundedRegExpSymbol.h" #include "unbounded/UnboundedRegExpEmpty.h" #include "unbounded/UnboundedRegExpConcatenation.h" diff --git a/alib2data/src/regexp/RegExp.h b/alib2data/src/regexp/RegExp.h index 7fc0106986..bc9105261b 100644 --- a/alib2data/src/regexp/RegExp.h +++ b/alib2data/src/regexp/RegExp.h @@ -11,8 +11,8 @@ #include "../common/wrapper.hpp" #include "RegExpBase.h" -#include "../alphabet/Symbol.h" -#include "../string/LinearString.h" +#include "../alphabet/SymbolFeatures.h" +#include "../string/StringFeatures.h" #include <string> namespace regexp { @@ -21,16 +21,7 @@ namespace regexp { * Wrapper around automata. */ class RegExp : public alib::wrapper<RegExpBase> { -public: - explicit RegExp(RegExpBase* data) : alib::wrapper<RegExpBase>(data) { - } - - explicit RegExp(const RegExpBase& data) : alib::wrapper<RegExpBase>(data.clone()) { - } - - explicit RegExp(RegExpBase&& data) : alib::wrapper<RegExpBase>(std::move(data).plunder()) { - } - + using alib::wrapper<RegExpBase>::wrapper; }; regexp::RegExp regexpFrom( const std::string& string ); diff --git a/alib2data/src/string/String.h b/alib2data/src/string/String.h index 1e4fbc47e2..f5f80df9d0 100644 --- a/alib2data/src/string/String.h +++ b/alib2data/src/string/String.h @@ -17,16 +17,7 @@ namespace string { * Wrapper around strings. */ class String : public alib::wrapper<StringBase> { -public: - explicit String(StringBase* data) : alib::wrapper<StringBase>(data) { - } - - explicit String(const StringBase& data) : alib::wrapper<StringBase>(data.clone()) { - } - - explicit String(StringBase&& data) : alib::wrapper<StringBase>(std::move(data).plunder()) { - } - + using alib::wrapper<StringBase>::wrapper; }; string::String stringFrom(const alphabet::Symbol& symbol); diff --git a/alib2data/src/tree/Tree.h b/alib2data/src/tree/Tree.h index 7ccac890a1..5bc8fe6f6b 100644 --- a/alib2data/src/tree/Tree.h +++ b/alib2data/src/tree/Tree.h @@ -17,16 +17,7 @@ namespace tree { * Wrapper around tree. */ class Tree : public alib::wrapper<TreeBase> { -public: - explicit Tree(TreeBase* data) : alib::wrapper<TreeBase>(data) { - } - - explicit Tree(const TreeBase& data) : alib::wrapper<TreeBase>(data.clone()) { - } - - explicit Tree(TreeBase&& data) : alib::wrapper<TreeBase>(std::move(data).plunder()) { - } - + using alib::wrapper<TreeBase>::wrapper; }; } /* namespace tree */ -- GitLab