diff --git a/src/Base/BaseClass.h b/src/Base/BaseClass.h index f37feb7b76..88b5da6c3b 100644 --- a/src/Base/BaseClass.h +++ b/src/Base/BaseClass.h @@ -27,7 +27,7 @@ #include "Type.h" // Python stuff -typedef struct _object PyObject; +using PyObject = struct _object; /// define for subclassing Base::BaseClass diff --git a/src/Base/BindingManager.h b/src/Base/BindingManager.h index 361bb6e1fe..641c1656c2 100644 --- a/src/Base/BindingManager.h +++ b/src/Base/BindingManager.h @@ -27,7 +27,7 @@ #include #include -typedef struct _object PyObject; +using PyObject = struct _object; namespace Base { diff --git a/src/Base/BoundBox.h b/src/Base/BoundBox.h index 9d26961067..1683f97470 100644 --- a/src/Base/BoundBox.h +++ b/src/Base/BoundBox.h @@ -43,8 +43,8 @@ class BoundBox3 static bool isOnRayS(_Precision, _Precision, _Precision); public: - typedef _Precision num_type; - typedef float_traits traits_type; + using num_type = _Precision; + using traits_type = float_traits; /** Public attributes */ //@{ @@ -982,8 +982,8 @@ inline void BoundBox3<_Precision>::ScaleZ (_Precision f) MinZ *= f; MaxZ *= f; } -typedef BoundBox3 BoundBox3f; -typedef BoundBox3 BoundBox3d; +using BoundBox3f = BoundBox3; +using BoundBox3d = BoundBox3; } // namespace Base diff --git a/src/Base/Builder3D.h b/src/Base/Builder3D.h index 19f949ed74..4f196d1678 100644 --- a/src/Base/Builder3D.h +++ b/src/Base/Builder3D.h @@ -36,7 +36,7 @@ namespace Base { class Matrix4D; template class Vector3; -typedef Vector3 Vector3f; +using Vector3f = Vector3; /** A Builder class for 3D representations on App level * On the application level nothing is known of the visual representation of data. diff --git a/src/Base/Console.h b/src/Base/Console.h index 38d1d0de87..a864fa16fb 100644 --- a/src/Base/Console.h +++ b/src/Base/Console.h @@ -36,8 +36,8 @@ #include // Python stuff -typedef struct _object PyObject; -typedef struct PyMethodDef PyMethodDef; +using PyObject = struct _object; +using PyMethodDef = struct PyMethodDef; //FIXME: ISO C++11 requires at least one argument for the "..." in a variadic macro #if defined(__clang__) @@ -454,7 +454,7 @@ namespace Base { } // namespace Base //TODO: Get rid of this typedef -typedef unsigned int ConsoleMsgFlags; +using ConsoleMsgFlags = unsigned int; namespace Base { diff --git a/src/Base/Converter.h b/src/Base/Converter.h index 2ebfb8be26..f68aa0a229 100644 --- a/src/Base/Converter.h +++ b/src/Base/Converter.h @@ -36,8 +36,8 @@ struct vec_traits { }; template <> struct vec_traits { - typedef Vector3f vec_type; - typedef float float_type; + using vec_type = Vector3f; + using float_type = float; vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v.x, v.y, v.z); @@ -48,8 +48,8 @@ private: template <> struct vec_traits { - typedef Vector3d vec_type; - typedef double float_type; + using vec_type = Vector3d; + using float_type = double; vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v.x, v.y, v.z); @@ -60,8 +60,8 @@ private: template <> struct vec_traits { - typedef Rotation vec_type; - typedef double float_type; + using vec_type = Rotation; + using float_type = double; vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { float_type q1,q2,q3,q4; @@ -75,8 +75,8 @@ private: // type with three floats template _Vec make_vec(const std::tuple&& t) { - typedef vec_traits<_Vec> traits_type; - typedef typename traits_type::float_type float_traits_type; + using traits_type = vec_traits<_Vec>; + using float_traits_type = typename traits_type::float_type; return _Vec(float_traits_type(std::get<0>(t)), float_traits_type(std::get<1>(t)), float_traits_type(std::get<2>(t))); @@ -85,8 +85,8 @@ _Vec make_vec(const std::tuple&& t) { // type with four floats template _Vec make_vec(const std::tuple&& t) { - typedef vec_traits<_Vec> traits_type; - typedef typename traits_type::float_type float_traits_type; + using traits_type = vec_traits<_Vec>; + using float_traits_type = typename traits_type::float_type; return _Vec(float_traits_type(std::get<0>(t)), float_traits_type(std::get<1>(t)), float_traits_type(std::get<2>(t)), @@ -96,8 +96,8 @@ _Vec make_vec(const std::tuple&& template inline _Vec1 convertTo(const _Vec2& v) { - typedef vec_traits<_Vec2> traits_type; - typedef typename traits_type::float_type float_type; + using traits_type = vec_traits<_Vec2>; + using float_type = typename traits_type::float_type; traits_type t(v); auto tuple = t.get(); return make_vec<_Vec1, float_type>(std::move(tuple)); diff --git a/src/Base/Exception.h b/src/Base/Exception.h index cfb472afd6..e1427166fd 100644 --- a/src/Base/Exception.h +++ b/src/Base/Exception.h @@ -31,7 +31,7 @@ #include "FileInfo.h" -typedef struct _object PyObject; +using PyObject = struct _object; /* MACROS FOR THROWING EXCEPTIONS */ diff --git a/src/Base/ExceptionFactory.h b/src/Base/ExceptionFactory.h index c59b354246..d050b46ff3 100644 --- a/src/Base/ExceptionFactory.h +++ b/src/Base/ExceptionFactory.h @@ -29,7 +29,7 @@ #include // Python stuff -typedef struct _object PyObject; +using PyObject = struct _object; namespace Base { diff --git a/src/Base/GeometryPyCXX.h b/src/Base/GeometryPyCXX.h index 4063b24241..83fa45138b 100644 --- a/src/Base/GeometryPyCXX.h +++ b/src/Base/GeometryPyCXX.h @@ -117,7 +117,7 @@ private: namespace Py { -typedef PythonClassObject Vector2d; +using Vector2d = PythonClassObject; inline Base::Vector2d toVector2d(PyObject *py) { Base::Vector2dPy* py2d = Py::Vector2d(py).getCxxObject(); @@ -246,14 +246,14 @@ private: }; // PyCXX wrapper classes Py::Matrix, Py::Rotation, Py::Placement, ... -typedef GeometryT BoundingBox; -typedef GeometryT Matrix; -typedef GeometryT Rotation; -typedef GeometryT Placement; +using BoundingBox = GeometryT; +using Matrix = GeometryT; +using Rotation = GeometryT; +using Placement = GeometryT; } diff --git a/src/Base/Matrix.cpp b/src/Base/Matrix.cpp index 88f92ccbac..c2f16a9fd8 100644 --- a/src/Base/Matrix.cpp +++ b/src/Base/Matrix.cpp @@ -487,7 +487,7 @@ void Matrix4D::inverse () (*this) = clInvRotMat * clInvTrlMat; } -typedef double * Matrix; +using Matrix = double *; void Matrix_gauss(Matrix a, Matrix b) { diff --git a/src/Base/Matrix.h b/src/Base/Matrix.h index 3409720510..51285afb9a 100644 --- a/src/Base/Matrix.h +++ b/src/Base/Matrix.h @@ -47,7 +47,7 @@ enum class ScaleType { */ class BaseExport Matrix4D { - typedef float_traits traits_type; + using traits_type = float_traits; public: /// Default constructor diff --git a/src/Base/Observer.h b/src/Base/Observer.h index aa99d5b5cc..054106475c 100644 --- a/src/Base/Observer.h +++ b/src/Base/Observer.h @@ -100,9 +100,9 @@ class Subject { public: - typedef Observer<_MessageType> ObserverType; - typedef _MessageType MessageType; - typedef Subject<_MessageType> SubjectType; + using ObserverType = Observer<_MessageType>; + using MessageType = _MessageType; + using SubjectType = Subject<_MessageType>; /** * A constructor. diff --git a/src/Base/Parameter.h b/src/Base/Parameter.h index 481f4794ee..42cede3726 100644 --- a/src/Base/Parameter.h +++ b/src/Base/Parameter.h @@ -33,7 +33,7 @@ #define BASE__PARAMETER_H // Python stuff -typedef struct _object PyObject; +using PyObject = struct _object; #ifdef FC_OS_MACOSX #undef toupper @@ -118,7 +118,7 @@ public: /// test if a special sub group is in this group bool HasGroup(const char* Name) const; /// type of the handle - typedef Base::Reference handle; + using handle = Base::Reference; /// remove a sub group from this group void RemoveGrp(const char* Name); /// rename a sub group from this group diff --git a/src/Base/ParameterPy.cpp b/src/Base/ParameterPy.cpp index d24d493306..c5a50b5020 100644 --- a/src/Base/ParameterPy.cpp +++ b/src/Base/ParameterPy.cpp @@ -85,7 +85,7 @@ private: Py::Object inst; }; -typedef std::list ParameterGrpObserverList; +using ParameterGrpObserverList = std::list; class ParameterGrpPy : public Py::PythonExtension { diff --git a/src/Base/PersistencePyImp.cpp b/src/Base/PersistencePyImp.cpp index f9882bd393..5b7fc42312 100644 --- a/src/Base/PersistencePyImp.cpp +++ b/src/Base/PersistencePyImp.cpp @@ -135,7 +135,7 @@ PyObject* PersistencePy::restoreContent(PyObject *args) //check if it really is a buffer try { - typedef boost::iostreams::basic_array_source Device; + using Device = boost::iostreams::basic_array_source; boost::iostreams::stream stream((char*)buf.buf, buf.len); getPersistencePtr()->restoreFromStream(stream); } diff --git a/src/Base/PyObjectBase.h b/src/Base/PyObjectBase.h index 23e7f16a36..d05fc241c2 100644 --- a/src/Base/PyObjectBase.h +++ b/src/Base/PyObjectBase.h @@ -326,7 +326,7 @@ public: return StatusBits.test(NoTrack); } - typedef void* PointerType; + using PointerType = void*; private: void setAttributeOf(const char* attr, PyObject* par); diff --git a/src/Base/Quantity.h b/src/Base/Quantity.h index 4dbe9e7c3f..04df9468e3 100644 --- a/src/Base/Quantity.h +++ b/src/Base/Quantity.h @@ -49,7 +49,7 @@ struct BaseExport QuantityFormat { Scientific = 2 }; - typedef int NumberOptions; + using NumberOptions = int; NumberOptions option; NumberFormat format; int precision; diff --git a/src/Base/Reader.h b/src/Base/Reader.h index c2788c0fe9..91dd602264 100644 --- a/src/Base/Reader.h +++ b/src/Base/Reader.h @@ -266,7 +266,7 @@ protected: unsigned int CharacterCount; std::map AttrMap; - typedef std::map AttrMapType; + using AttrMapType = std::map; enum { None = 0, diff --git a/src/Base/Rotation.cpp b/src/Base/Rotation.cpp index 8212956a6c..a53e156284 100644 --- a/src/Base/Rotation.cpp +++ b/src/Base/Rotation.cpp @@ -812,7 +812,7 @@ struct EulerSequence_Parameters EulerSequence_Parameters translateEulerSequence (const Rotation::EulerSequence theSeq) { - typedef EulerSequence_Parameters Params; + using Params = EulerSequence_Parameters; const bool F = false; const bool T = true; diff --git a/src/Base/SmartPtrPy.h b/src/Base/SmartPtrPy.h index 1215cddff5..867f990145 100644 --- a/src/Base/SmartPtrPy.h +++ b/src/Base/SmartPtrPy.h @@ -27,7 +27,7 @@ #include // forward declarations -typedef struct _object PyObject; +using PyObject = struct _object; namespace Py { class Object; diff --git a/src/Base/Stream.h b/src/Base/Stream.h index e4b1ec3893..123dc4d9c9 100644 --- a/src/Base/Stream.h +++ b/src/Base/Stream.h @@ -38,7 +38,7 @@ class QByteArray; class QIODevice; class QBuffer; -typedef struct _object PyObject; +using PyObject = struct _object; namespace Base { @@ -255,11 +255,11 @@ protected: class BaseExport PyStreambuf : public std::streambuf { - typedef std::streambuf::int_type int_type; - typedef std::streambuf::pos_type pos_type; - typedef std::streambuf::off_type off_type; - typedef std::ios::seekdir seekdir; - typedef std::ios::openmode openmode; + using int_type = std::streambuf::int_type; + using pos_type = std::streambuf::pos_type; + using off_type = std::streambuf::off_type; + using seekdir = std::ios::seekdir; + using openmode = std::ios::openmode; public: enum Type { diff --git a/src/Base/Tools.h b/src/Base/Tools.h index cacdd37eaf..93291e218b 100644 --- a/src/Base/Tools.h +++ b/src/Base/Tools.h @@ -229,8 +229,8 @@ private: // ---------------------------------------------------------------------------- class ConnectionBlocker { - typedef boost::signals2::connection Connection; - typedef boost::signals2::shared_connection_block ConnectionBlock; + using Connection = boost::signals2::connection; + using ConnectionBlock = boost::signals2::shared_connection_block; ConnectionBlock blocker; public: diff --git a/src/Base/Type.h b/src/Base/Type.h index 9c73669a12..60c9f990ec 100644 --- a/src/Base/Type.h +++ b/src/Base/Type.h @@ -92,7 +92,7 @@ public: static void *createInstanceByName(const char* TypeName, bool bLoadModule=false); static void importModule(const char* TypeName); - typedef void * (*instantiationMethod)(); + using instantiationMethod = void * (*)(); static Type fromName(const char *name); static Type fromKey(unsigned int key); diff --git a/src/Base/TypePy.xml b/src/Base/TypePy.xml index f62728105b..e8fba162e3 100644 --- a/src/Base/TypePy.xml +++ b/src/Base/TypePy.xml @@ -12,7 +12,7 @@ Delete="true"> namespace Base { - typedef Type BaseType; + using BaseType = Type; } diff --git a/src/Base/UnitsApi.h b/src/Base/UnitsApi.h index 4bef37c86a..8a76117007 100644 --- a/src/Base/UnitsApi.h +++ b/src/Base/UnitsApi.h @@ -29,11 +29,11 @@ #include "UnitsSchema.h" #include "Quantity.h" -typedef struct _object PyObject; -typedef struct PyMethodDef PyMethodDef; +using PyObject = struct _object; +using PyMethodDef = struct PyMethodDef; namespace Base { -typedef std::unique_ptr UnitsSchemaPtr; +using UnitsSchemaPtr = std::unique_ptr; /** * The UnitsApi diff --git a/src/Base/Vector3D.h b/src/Base/Vector3D.h index 43e9ab8a7b..e2f37a6f64 100644 --- a/src/Base/Vector3D.h +++ b/src/Base/Vector3D.h @@ -59,7 +59,7 @@ struct float_traits { }; template <> struct float_traits { - typedef float float_type; + using float_type = float; static inline float_type pi() { return F_PI; } static inline float_type epsilon() { return FLT_EPSILON; } static inline float_type maximum() { return FLT_MAX; } @@ -67,7 +67,7 @@ struct float_traits { template <> struct float_traits { - typedef double float_type; + using float_type = double; static inline float_type pi() { return D_PI; } static inline float_type epsilon() { return DBL_EPSILON; } static inline float_type maximum() { return DBL_MAX; } @@ -78,8 +78,8 @@ template class Vector3 { public: - typedef _Precision num_type; - typedef float_traits traits_type; + using num_type = _Precision; + using traits_type = float_traits; static inline num_type epsilon() { return traits_type::epsilon(); } /** @name Public data members */ @@ -248,8 +248,8 @@ inline Vector3<_Pr1> toVector(const Vector3<_Pr2>& v) return Vector3<_Pr1>(static_cast<_Pr1>(v.x),static_cast<_Pr1>(v.y),static_cast<_Pr1>(v.z)); } -typedef Vector3 Vector3f; -typedef Vector3 Vector3d; +using Vector3f = Vector3; +using Vector3d = Vector3; } // namespace Base diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index b0c1aab253..150d521c7f 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -90,7 +90,7 @@ public: int finalization(); - - typedef @self.export.TwinPointer@* PointerType ; + using PointerType = @self.export.TwinPointer@*; virtual PyObject *_repr(); // the representation std::string representation() const;