Преглед изворни кода

More cleaning up towards the port to c++-11. Documentation and consistency and better testing.

enhancement_3
Trevor Irons пре 7 година
родитељ
комит
f1ad8f2f9e

+ 4
- 3
Modules/LemmaCore/examples/CubicSplineInterpolator.cpp Прегледај датотеку

17
  * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
17
  * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
18
  */
18
  */
19
 
19
 
20
-#include "CubicSplineInterpolator.h"
21
-#include "ASCIIParser.h"
20
+#include "LemmaCore"
22
 using namespace Lemma;
21
 using namespace Lemma;
23
 
22
 
24
 int main() {
23
 int main() {
24
+    auto win = WindowFilter::NewSP();
25
+        std::cout << *win << std::endl;
25
     //auto Spline = CubicSplineInterpolator::NewSP();
26
     //auto Spline = CubicSplineInterpolator::NewSP();
26
     //auto Spline2 = CubicSplineInterpolator();
27
     //auto Spline2 = CubicSplineInterpolator();
27
-    auto Parser = ASCIIParser::NewSP();
28
+    //auto Parser = ASCIIParser::NewSP();
28
     //ASCIIParser Parser2 = ASCIIParser();
29
     //ASCIIParser Parser2 = ASCIIParser();
29
     //    Parser2.SetCommentString( "#");
30
     //    Parser2.SetCommentString( "#");
30
     //auto Parser3 = ASCIIParser(Parser2);
31
     //auto Parser3 = ASCIIParser(Parser2);

+ 20
- 6
Modules/LemmaCore/include/ASCIIParser.h Прегледај датотеку

33
 
33
 
34
     friend std::ostream &operator<<(std::ostream &stream,
34
     friend std::ostream &operator<<(std::ostream &stream,
35
             const ASCIIParser &ob);
35
             const ASCIIParser &ob);
36
-
36
+    /*
37
+     *  This key is used to lock the constructors
38
+     */
37
     struct ctor_key {};
39
     struct ctor_key {};
38
 
40
 
39
     public:
41
     public:
40
 
42
 
41
     // ====================  LIFECYCLE     =======================
43
     // ====================  LIFECYCLE     =======================
42
 
44
 
43
-    /** Default constructor */
45
+    /** Default constructor
46
+     * @note This method is locked
47
+     * @see ASCIIParser::NewSP
48
+     */
44
     explicit ASCIIParser ( const ctor_key& );
49
     explicit ASCIIParser ( const ctor_key& );
45
 
50
 
46
-    /** Constructor using YAML::Node */
51
+    /**
52
+     * DeSerializing constructor.
53
+     * @note This method is locked, and cannot be called directly.
54
+     *       The reason that the method is public is to enable the use
55
+     *       of make_shared whilst enforcing the use of shared_ptr,
56
+     *       in c++-17, this curiosity may be resolved.
57
+     * @see ASCIIParser::DeSerialize
58
+     */
47
     ASCIIParser ( const YAML::Node& node, const ctor_key& );
59
     ASCIIParser ( const YAML::Node& node, const ctor_key& );
48
 
60
 
49
-    /** Default  destructor */
61
+    /** Default  destructor
62
+     *  @note This should never be called explicitly, use NewSP
63
+     */
50
     virtual ~ASCIIParser ();
64
     virtual ~ASCIIParser ();
51
 
65
 
52
     /**
66
     /**
65
      *  Uses YAML to serialize this object.
79
      *  Uses YAML to serialize this object.
66
      *  @return a YAML::Node
80
      *  @return a YAML::Node
67
      */
81
      */
68
-    YAML::Node Serialize() const;
82
+    virtual YAML::Node Serialize() const;
69
 
83
 
70
     // ====================  OPERATORS     =======================
84
     // ====================  OPERATORS     =======================
71
 
85
 
112
      */
126
      */
113
     void SetCommentString( const std::string& key );
127
     void SetCommentString( const std::string& key );
114
 
128
 
115
-    /** Sets the buffer size. This affects the maximum number of column in a line. Defaults
129
+    /** Sets the buffer size. This affects the maximum number of columns in a line. Defaults
116
      *  is 255.
130
      *  is 255.
117
      *  @param[in] BufferSize is the size of the buffer to use
131
      *  @param[in] BufferSize is the size of the buffer to use
118
      */
132
      */

+ 2
- 2
Modules/LemmaCore/include/CubicSplineInterpolator.h Прегледај датотеку

60
 class CubicSplineInterpolator : public LemmaObject {
60
 class CubicSplineInterpolator : public LemmaObject {
61
 
61
 
62
     friend std::ostream &operator<<(std::ostream &stream,
62
     friend std::ostream &operator<<(std::ostream &stream,
63
-            const CubicSplineInterpolator &ob);
63
+            const CubicSplineInterpolator& ob);
64
 
64
 
65
     struct ctor_key {};
65
     struct ctor_key {};
66
 
66
 
87
      *  Uses YAML to serialize this object.
87
      *  Uses YAML to serialize this object.
88
      *  @return a YAML::Node
88
      *  @return a YAML::Node
89
      */
89
      */
90
-    YAML::Node Serialize() const;
90
+    virtual YAML::Node Serialize() const;
91
 
91
 
92
     /**
92
     /**
93
      *   Constructs an object from a YAML::Node.
93
      *   Constructs an object from a YAML::Node.

+ 9
- 6
Modules/LemmaCore/include/Data.h Прегледај датотеку

36
 
36
 
37
             // ====================  LIFECYCLE     =======================
37
             // ====================  LIFECYCLE     =======================
38
 
38
 
39
-            /** Copies the *structure* of this class to a new object and
40
-             * returns a pointer to this object. Memory management is
41
-             * the responsibility of the receiver!. The data values are
42
-             * not copied.
39
+            /**
40
+             * Returns a deep copy
43
              */
41
              */
44
-            virtual Data* Clone()=0;
42
+            virtual std::shared_ptr<Data> DeepCopy()=0;
45
 
43
 
46
             // ====================  OPERATORS     =======================
44
             // ====================  OPERATORS     =======================
47
 
45
 
74
             /** Default protected constructor. */
72
             /** Default protected constructor. */
75
             Data (  );
73
             Data (  );
76
 
74
 
75
+            /** Deserializing contructor */
76
+            Data ( const YAML::Node& node );
77
+
77
             /** Default protected constructor. */
78
             /** Default protected constructor. */
78
-            ~Data ();
79
+            ~Data ( );
79
 
80
 
80
             // ====================  DATA MEMBERS  =========================
81
             // ====================  DATA MEMBERS  =========================
81
 
82
 
84
             /** ASCII string representation of the class name */
85
             /** ASCII string representation of the class name */
85
             static constexpr auto CName = "Data";
86
             static constexpr auto CName = "Data";
86
 
87
 
88
+            Data ( const Data& ) = delete;
89
+
87
     }; // -----  end of class  Data  -----
90
     }; // -----  end of class  Data  -----
88
 
91
 
89
 }       // -----  end of Lemma  name  -----
92
 }       // -----  end of Lemma  name  -----

+ 6
- 1
Modules/LemmaCore/include/DataReader.h Прегледај датотеку

40
         // ====================  OPERATIONS    =======================
40
         // ====================  OPERATIONS    =======================
41
 
41
 
42
         // ====================  ACCESS        =======================
42
         // ====================  ACCESS        =======================
43
-        virtual Data* GetData()=0;
43
+        virtual std::shared_ptr< Data > GetData()=0;
44
 
44
 
45
         // ====================  INQUIRY       =======================
45
         // ====================  INQUIRY       =======================
46
         /** Returns the name of the underlying class, similiar to Python's type */
46
         /** Returns the name of the underlying class, similiar to Python's type */
56
         DataReader ( );
56
         DataReader ( );
57
 
57
 
58
         /// Default protected constructor.
58
         /// Default protected constructor.
59
+        DataReader ( const YAML::Node& node );
60
+
61
+        /// Default protected constructor.
59
         ~DataReader ( );
62
         ~DataReader ( );
60
 
63
 
61
         // ====================  DATA MEMBERS  =========================
64
         // ====================  DATA MEMBERS  =========================
65
         /** ASCII string representation of the class name */
68
         /** ASCII string representation of the class name */
66
         static constexpr auto CName = "DataReader";
69
         static constexpr auto CName = "DataReader";
67
 
70
 
71
+        DataReader( const DataReader& ) = delete;
72
+
68
 }; // -----  end of class  DataReader  -----
73
 }; // -----  end of class  DataReader  -----
69
 
74
 
70
 }       // -----  end of Lemma  name  -----
75
 }       // -----  end of Lemma  name  -----

+ 3
- 1
Modules/LemmaCore/include/EarthModel.h Прегледај датотеку

20
 
20
 
21
     // ===================================================================
21
     // ===================================================================
22
     //        Class:  EarthModel
22
     //        Class:  EarthModel
23
-    /// \ingroup LemmaGroup
23
+    /// \ingroup LemmaCore
24
     /// \brief abstract class for Earth models
24
     /// \brief abstract class for Earth models
25
     /// \details
25
     /// \details
26
     // ===================================================================
26
     // ===================================================================
113
 
113
 
114
         private:
114
         private:
115
 
115
 
116
+            EarthModel(const EarthModel& ) = delete;
117
+
116
             /** ASCII string representation of the class name */
118
             /** ASCII string representation of the class name */
117
             static constexpr auto CName = "EarthModel";
119
             static constexpr auto CName = "EarthModel";
118
 
120
 

+ 12
- 1
Modules/LemmaCore/include/Filter.h Прегледај датотеку

28
 
28
 
29
     class Filter : public LemmaObject {
29
     class Filter : public LemmaObject {
30
 
30
 
31
+        friend std::ostream &operator<<(std::ostream &stream, const Filter& ob);
32
+
31
         public:
33
         public:
32
 
34
 
33
             // ====================  LIFECYCLE     =======================
35
             // ====================  LIFECYCLE     =======================
36
+            /**
37
+             *  Uses YAML to serialize this object.
38
+             *  @return a YAML::Node
39
+             */
40
+            virtual YAML::Node Serialize() const;
34
 
41
 
35
             // ====================  OPERATORS     =======================
42
             // ====================  OPERATORS     =======================
36
 
43
 
37
             // ====================  OPERATIONS    =======================
44
             // ====================  OPERATIONS    =======================
38
 
45
 
46
+
39
             // ====================  ACCESS        =======================
47
             // ====================  ACCESS        =======================
40
 
48
 
41
             // ====================  INQUIRY       =======================
49
             // ====================  INQUIRY       =======================
53
             Filter ( );
61
             Filter ( );
54
 
62
 
55
             /// Default protected constructor.
63
             /// Default protected constructor.
56
-            ~Filter ();
64
+            Filter ( const YAML::Node& node );
65
+
66
+            /// Default protected constructor.
67
+            virtual ~Filter ();
57
 
68
 
58
             // ====================  DATA MEMBERS  =========================
69
             // ====================  DATA MEMBERS  =========================
59
 
70
 

+ 2
- 2
Modules/LemmaCore/include/Grid.h Прегледај датотеку

35
 
35
 
36
         // ====================  LIFECYCLE     ===================================
36
         // ====================  LIFECYCLE     ===================================
37
 
37
 
38
-        YAML::Node Serialize() const;
38
+        virtual YAML::Node Serialize() const;
39
 
39
 
40
         // ====================  OPERATORS     ===================================
40
         // ====================  OPERATORS     ===================================
41
 
41
 
61
         Grid ( );
61
         Grid ( );
62
 
62
 
63
         /// Default protected constructor.
63
         /// Default protected constructor.
64
-        ~Grid ();
64
+        virtual ~Grid ( );
65
 
65
 
66
         // ====================  DATA MEMBERS  ===================================
66
         // ====================  DATA MEMBERS  ===================================
67
 
67
 

+ 9
- 0
Modules/LemmaCore/include/Instrument.h Прегледај датотеку

33
 
33
 
34
 			// ====================  LIFECYCLE     ===========================
34
 			// ====================  LIFECYCLE     ===========================
35
 
35
 
36
+            /**
37
+             *  Uses YAML to serialize this object.
38
+             *  @return a YAML::Node
39
+             */
40
+            YAML::Node Serialize() const;
41
+
36
 			// ====================  OPERATORS     ===========================
42
 			// ====================  OPERATORS     ===========================
37
 
43
 
38
 			// ====================  OPERATIONS    ===========================
44
 			// ====================  OPERATIONS    ===========================
53
 
59
 
54
 			// ====================  LIFECYCLE     ===========================
60
 			// ====================  LIFECYCLE     ===========================
55
 
61
 
62
+            /// Default protected constructor.
63
+			Instrument ( const YAML::Node& node );
64
+
56
 			/// Default protected constructor.
65
 			/// Default protected constructor.
57
 			Instrument ( );
66
 			Instrument ( );
58
 
67
 

+ 4
- 1
Modules/LemmaCore/include/LayeredEarth.h Прегледај датотеку

86
             /** YAML Serializing method
86
             /** YAML Serializing method
87
              */
87
              */
88
             YAML::Node Serialize() const;
88
             YAML::Node Serialize() const;
89
-            //static LayeredEarth* DeSerialize(const YAML::Node& node);
90
 
89
 
91
             /** Returns the name of the underlying class, similiar to Python's type */
90
             /** Returns the name of the underlying class, similiar to Python's type */
92
             virtual inline std::string GetName() const {
91
             virtual inline std::string GetName() const {
109
 			// ====================  DATA MEMBERS  ===========================
108
 			// ====================  DATA MEMBERS  ===========================
110
 
109
 
111
         private:
110
         private:
111
+
112
             /** ASCII string representation of the class name */
112
             /** ASCII string representation of the class name */
113
             static constexpr auto CName = "LayeredEarth";
113
             static constexpr auto CName = "LayeredEarth";
114
 
114
 
115
+            /** no copy */
116
+            LayeredEarth ( const LayeredEarth& ) = delete;
117
+
115
 			/** Number of layers in the model, including the air layer,
118
 			/** Number of layers in the model, including the air layer,
116
 			 * and counting from 0
119
 			 * and counting from 0
117
              */
120
              */

+ 17
- 18
Modules/LemmaCore/include/LemmaObject.h Прегледај датотеку

44
     friend class LemmaObjectDeleter;
44
     friend class LemmaObjectDeleter;
45
 
45
 
46
     public:
46
     public:
47
-
48
-        // ====================  LIFECYCLE     ==============================
49
-
50
         // Needed because many derived classes have Eigen vectors as members,
47
         // Needed because many derived classes have Eigen vectors as members,
51
         // causing alignment issues when vectorisation is enabled.
48
         // causing alignment issues when vectorisation is enabled.
52
         EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49
         EIGEN_MAKE_ALIGNED_OPERATOR_NEW
53
 
50
 
54
-        // ====================  OPERATORS     ==============================
55
-
56
-        // ====================  OPERATIONS    ==============================
57
-
58
-        // ====================  ACCESS        ==============================
59
-
60
-        // ====================  INQUIRY       ==============================
61
-
62
-        /** Returns the name of the underlying class; Run-time type information (RTTI). This approach
63
-            Was chosen over typeid due to name mangling among various compilers, and the need for consistency
64
-            in Serialized objects.
65
-         */
66
-        virtual inline std::string GetName() const {
67
-            return this->CName;
68
-        }
51
+        // ====================  LIFECYCLE     ==============================
69
 
52
 
70
         /**
53
         /**
71
          *  Uses YAML to serialize this object.
54
          *  Uses YAML to serialize this object.
86
             return node;
69
             return node;
87
         };
70
         };
88
 
71
 
72
+        // ====================  OPERATORS     ==============================
73
+
74
+        // ====================  OPERATIONS    ==============================
75
+
76
+        // ====================  ACCESS        ==============================
77
+
78
+        // ====================  INQUIRY       ==============================
79
+
80
+        /** Returns the name of the underlying class; Run-time type information (RTTI). This approach
81
+            Was chosen over typeid due to name mangling among various compilers, and the need for consistency
82
+            in Serialized objects.
83
+         */
84
+        virtual inline std::string GetName() const {
85
+            return this->CName;
86
+        }
87
+
89
     protected:
88
     protected:
90
 
89
 
91
         // ====================  LIFECYCLE     ==============================
90
         // ====================  LIFECYCLE     ==============================

+ 1
- 1
Modules/LemmaCore/include/RectilinearGrid.h Прегледај датотеку

50
              *  Uses YAML to serialize this object.
50
              *  Uses YAML to serialize this object.
51
              *  @return a YAML::Node
51
              *  @return a YAML::Node
52
              */
52
              */
53
-            YAML::Node Serialize() const;
53
+            virtual YAML::Node Serialize() const;
54
 
54
 
55
             /**
55
             /**
56
              *   Constructs an object from a YAML::Node.
56
              *   Constructs an object from a YAML::Node.

+ 32
- 18
Modules/LemmaCore/include/WindowFilter.h Прегледај датотеку

16
 #include "Filter.h"
16
 #include "Filter.h"
17
 
17
 
18
 namespace Lemma {
18
 namespace Lemma {
19
-    /** Types of filter window that are supported.
20
-     */
21
-    enum WINDOWTYPE { HAMMING, /*!< A hamming window */
22
-                      HANNING, /*!< A hanning window */
23
-                      RECTANGULAR /*!< Rectangular window */
24
-                    };
25
 
19
 
26
     // ===================================================================
20
     // ===================================================================
27
     //  Class:  WindowFilter
21
     //  Class:  WindowFilter
34
     // ===================================================================
28
     // ===================================================================
35
     class WindowFilter : public Filter {
29
     class WindowFilter : public Filter {
36
 
30
 
31
+        friend std::ostream &operator<<(std::ostream &stream, const WindowFilter& ob);
32
+
33
+        struct ctor_key {};
34
+
37
         public:
35
         public:
38
 
36
 
39
             // ====================  LIFECYCLE     =======================
37
             // ====================  LIFECYCLE     =======================
40
 
38
 
41
-           /**
42
-            *  Factory method for generating concrete class.
43
-            *  @return a std::shared_ptr of type WindowFilter
44
-            */
39
+            /** Default constructor, inaccessible use NewSP  */
40
+            explicit WindowFilter ( const ctor_key& );
41
+
42
+            /** DeSerializing constructor, usees factory DeSerialize  method, inaccessible use DeSerialize*/
43
+            WindowFilter ( const YAML::Node& node, const ctor_key& );
44
+
45
+            /** Default constructor. */
46
+            virtual ~WindowFilter ( );
47
+
48
+            /**
49
+             *  Uses YAML to serialize this object.
50
+             *  @return a YAML::Node
51
+             */
52
+            YAML::Node Serialize() const;
53
+
54
+            /**
55
+             *   Constructs an object from a YAML::Node.
56
+             */
57
+            static std::shared_ptr< WindowFilter > DeSerialize(const YAML::Node& node);
58
+
59
+            /**
60
+             *  Factory method for generating concrete class.
61
+             *  @return a std::shared_ptr of type WindowFilter
62
+             */
45
             static std::shared_ptr< WindowFilter > NewSP();
63
             static std::shared_ptr< WindowFilter > NewSP();
46
 
64
 
47
             // ====================  OPERATORS     =======================
65
             // ====================  OPERATORS     =======================
86
 
104
 
87
             // ====================  LIFECYCLE     =======================
105
             // ====================  LIFECYCLE     =======================
88
 
106
 
89
-            /// Default protected constructor.
90
-            WindowFilter ( );
91
-
92
-            /// Default protected constructor.
93
-            ~WindowFilter ( );
94
 
107
 
108
+        private:
95
             // ====================  DATA MEMBERS  =========================
109
             // ====================  DATA MEMBERS  =========================
96
 
110
 
97
             /// Width of the window
111
             /// Width of the window
115
             /// The type of filter to use
129
             /// The type of filter to use
116
             WINDOWTYPE  Type;
130
             WINDOWTYPE  Type;
117
 
131
 
118
-        private:
132
+            /** ASCII string representation of the class name */
133
+            static constexpr auto CName = "WindowFilter";
119
 
134
 
120
-        /** ASCII string representation of the class name */
121
-        static constexpr auto CName = "WindowFilter";
135
+            WindowFilter ( const WindowFilter& ) = delete;
122
 
136
 
123
     }; // -----  end of class  WindowFilter  -----
137
     }; // -----  end of class  WindowFilter  -----
124
 
138
 

+ 2
- 0
Modules/LemmaCore/include/helper.h Прегледај датотеку

61
     std::string enum2String(const HANKELTRANSFORMTYPE& Htype);
61
     std::string enum2String(const HANKELTRANSFORMTYPE& Htype);
62
     /// convert enums to string saves repeated code useful for YAML serializing
62
     /// convert enums to string saves repeated code useful for YAML serializing
63
     std::string enum2String(const FIELDCALCULATIONS& Htype);
63
     std::string enum2String(const FIELDCALCULATIONS& Htype);
64
+    /// convert enums to string saves repeated code useful for YAML serializing
65
+    std::string enum2String(const WINDOWTYPE& Wtype);
64
 
66
 
65
     // other way around is a template, where template argument lets us know
67
     // other way around is a template, where template argument lets us know
66
     // which specialisation to use.
68
     // which specialisation to use.

+ 8
- 0
Modules/LemmaCore/include/lemma.h Прегледај датотеку

317
         */
317
         */
318
         enum FIELDCALCULATIONS {E, H, BOTH};
318
         enum FIELDCALCULATIONS {E, H, BOTH};
319
 
319
 
320
+        /** Windowing function type
321
+         */
322
+        enum WINDOWTYPE { HAMMING, /*!< A hamming window */
323
+                          HANNING, /*!< A hanning window */
324
+                          RECTANGULAR /*!< Rectangular window */
325
+        };
326
+
327
+
320
     }
328
     }
321
 
329
 
322
 #endif // __Lemma_H
330
 #endif // __Lemma_H

+ 8
- 8
Modules/LemmaCore/src/CMakeLists.txt Прегледај датотеку

4
 	${CMAKE_CURRENT_SOURCE_DIR}/LemmaObject.cpp
4
 	${CMAKE_CURRENT_SOURCE_DIR}/LemmaObject.cpp
5
 	${CMAKE_CURRENT_SOURCE_DIR}/ASCIIParser.cpp                # fixed, key 
5
 	${CMAKE_CURRENT_SOURCE_DIR}/ASCIIParser.cpp                # fixed, key 
6
 	${CMAKE_CURRENT_SOURCE_DIR}/CubicSplineInterpolator.cpp    # fixed, key 
6
 	${CMAKE_CURRENT_SOURCE_DIR}/CubicSplineInterpolator.cpp    # fixed, key 
7
-	${CMAKE_CURRENT_SOURCE_DIR}/Data.cpp
8
-	${CMAKE_CURRENT_SOURCE_DIR}/DataReader.cpp
9
-	${CMAKE_CURRENT_SOURCE_DIR}/EarthModel.cpp
10
-	${CMAKE_CURRENT_SOURCE_DIR}/Instrument.cpp
11
-	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarth.cpp
12
-	${CMAKE_CURRENT_SOURCE_DIR}/Grid.cpp       
7
+	${CMAKE_CURRENT_SOURCE_DIR}/Grid.cpp                       # ABC, no key 
13
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGrid.cpp
8
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGrid.cpp
14
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGridReader.cpp
9
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGridReader.cpp
15
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGridVTKExporter.cpp
10
 	${CMAKE_CURRENT_SOURCE_DIR}/RectilinearGridVTKExporter.cpp
16
-	${CMAKE_CURRENT_SOURCE_DIR}/Filter.cpp
17
-	${CMAKE_CURRENT_SOURCE_DIR}/WindowFilter.cpp
11
+	${CMAKE_CURRENT_SOURCE_DIR}/Filter.cpp                     # ABC, no key
12
+	${CMAKE_CURRENT_SOURCE_DIR}/WindowFilter.cpp			   # fixed, key
13
+	${CMAKE_CURRENT_SOURCE_DIR}/EarthModel.cpp                 # ABC, no key
14
+	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarth.cpp			   # ABC, no key
15
+	${CMAKE_CURRENT_SOURCE_DIR}/Data.cpp                       # ABC, no key
16
+	${CMAKE_CURRENT_SOURCE_DIR}/DataReader.cpp                 # ABC, no key
17
+	${CMAKE_CURRENT_SOURCE_DIR}/Instrument.cpp                 # ABC, no key
18
 	PARENT_SCOPE
18
 	PARENT_SCOPE
19
 )
19
 )

+ 2
- 6
Modules/LemmaCore/src/CubicSplineInterpolator.cpp Прегледај датотеку

38
     //--------------------------------------------------------------------------------------
38
     //--------------------------------------------------------------------------------------
39
     //       Class:  CubicSplineInterpolator
39
     //       Class:  CubicSplineInterpolator
40
     //      Method:  CubicSplineInterpolator
40
     //      Method:  CubicSplineInterpolator
41
-    // Description:  constructor (protected)
41
+    // Description:  constructor (locked with ctor_key)
42
     //--------------------------------------------------------------------------------------
42
     //--------------------------------------------------------------------------------------
43
     CubicSplineInterpolator::CubicSplineInterpolator ( const ctor_key& ) : LemmaObject( ) {
43
     CubicSplineInterpolator::CubicSplineInterpolator ( const ctor_key& ) : LemmaObject( ) {
44
 
44
 
47
     //--------------------------------------------------------------------------------------
47
     //--------------------------------------------------------------------------------------
48
     //       Class:  CubicSplineInterpolator
48
     //       Class:  CubicSplineInterpolator
49
     //      Method:  CubicSplineInterpolator
49
     //      Method:  CubicSplineInterpolator
50
-    // Description:  DeSerializing constructor (protected)
50
+    // Description:  DeSerializing constructor (locked with ctor_key)
51
     //--------------------------------------------------------------------------------------
51
     //--------------------------------------------------------------------------------------
52
     CubicSplineInterpolator::CubicSplineInterpolator (const YAML::Node& node, const ctor_key& ) : LemmaObject(node) {
52
     CubicSplineInterpolator::CubicSplineInterpolator (const YAML::Node& node, const ctor_key& ) : LemmaObject(node) {
53
     }  // -----  end of method CubicSplineInterpolator::CubicSplineInterpolator  (constructor)  -----
53
     }  // -----  end of method CubicSplineInterpolator::CubicSplineInterpolator  (constructor)  -----
58
     // Description:  public constructor
58
     // Description:  public constructor
59
     //--------------------------------------------------------------------------------------
59
     //--------------------------------------------------------------------------------------
60
     std::shared_ptr<CubicSplineInterpolator> CubicSplineInterpolator::NewSP() {
60
     std::shared_ptr<CubicSplineInterpolator> CubicSplineInterpolator::NewSP() {
61
-        //std::shared_ptr<CubicSplineInterpolator> sp(new  CubicSplineInterpolator( CubicSplineInterpolator::ctor_key ), LemmaObjectDeleter() );
62
-        //return sp;
63
         return std::make_shared<CubicSplineInterpolator>( ctor_key() );
61
         return std::make_shared<CubicSplineInterpolator>( ctor_key() );
64
     }
62
     }
65
 
63
 
82
         if (node.Tag() != "CubicSplineInterpolator") {
80
         if (node.Tag() != "CubicSplineInterpolator") {
83
             throw  DeSerializeTypeMismatch( "CubicSplineInterpolator", node.Tag());
81
             throw  DeSerializeTypeMismatch( "CubicSplineInterpolator", node.Tag());
84
         }
82
         }
85
-        //std::shared_ptr<CubicSplineInterpolator> Object(new  CubicSplineInterpolator(node), LemmaObjectDeleter() );
86
-        //return Object ;
87
         return std::make_shared<CubicSplineInterpolator>( node, ctor_key() );
83
         return std::make_shared<CubicSplineInterpolator>( node, ctor_key() );
88
     }
84
     }
89
 
85
 

+ 3
- 0
Modules/LemmaCore/src/Data.cpp Прегледај датотеку

23
 	Data::Data(  ) : LemmaObject( ) {
23
 	Data::Data(  ) : LemmaObject( ) {
24
 	}
24
 	}
25
 
25
 
26
+    Data::Data( const YAML::Node& node ) : LemmaObject( node ) {
27
+	}
28
+
26
 
29
 
27
 	Data::~Data() {
30
 	Data::~Data() {
28
 	}
31
 	}

+ 6
- 0
Modules/LemmaCore/src/DataReader.cpp Прегледај датотеку

21
     }
21
     }
22
 
22
 
23
 	DataReader::DataReader( ) : LemmaObject( ) {
23
 	DataReader::DataReader( ) : LemmaObject( ) {
24
+
25
+	}
26
+
27
+    DataReader::DataReader( const YAML::Node& node ) : LemmaObject( node ) {
28
+
24
 	}
29
 	}
25
 
30
 
26
 	DataReader::~DataReader() {
31
 	DataReader::~DataReader() {
32
+
27
 	}
33
 	}
28
 
34
 
29
 }		// -----  end of Lemma  name  -----
35
 }		// -----  end of Lemma  name  -----

+ 33
- 0
Modules/LemmaCore/src/Filter.cpp Прегледај датотеку

15
 
15
 
16
 namespace Lemma {
16
 namespace Lemma {
17
 
17
 
18
+    std::ostream &operator << (std::ostream &stream, const Filter &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
22
+
23
+    //--------------------------------------------------------------------------------------
24
+    //       Class:  Filter
25
+    //      Method:  Filter
26
+    // Description:  constructor (protected)
27
+    //--------------------------------------------------------------------------------------
18
     Filter::Filter( ) : LemmaObject( ) { }
28
     Filter::Filter( ) : LemmaObject( ) { }
19
 
29
 
30
+    //--------------------------------------------------------------------------------------
31
+    //       Class:  Filter
32
+    //      Method:  ~Filter
33
+    // Description:  destructor (protected)
34
+    //--------------------------------------------------------------------------------------
20
     Filter::~Filter( ) { }
35
     Filter::~Filter( ) { }
21
 
36
 
37
+    //--------------------------------------------------------------------------------------
38
+    //       Class:  Filter
39
+    //      Method:  Filter
40
+    // Description:  DeSerializing constructor (protected)
41
+    //--------------------------------------------------------------------------------------
42
+    Filter::Filter ( const YAML::Node& node ) : LemmaObject(node) {
43
+    }
44
+
45
+    //--------------------------------------------------------------------------------------
46
+    //       Class:  Filter
47
+    //      Method:  Serialize
48
+    //--------------------------------------------------------------------------------------
49
+    YAML::Node  Filter::Serialize (  ) const {
50
+        YAML::Node node = LemmaObject::Serialize();;
51
+        node.SetTag( GetName() );
52
+        // FILL IN CLASS SPECIFICS HERE
53
+        return node;
54
+    }		// -----  end of method Filter::Serialize  -----
22
 }		// -----  end of Lemma  name  -----
55
 }		// -----  end of Lemma  name  -----

+ 0
- 2
Modules/LemmaCore/src/Grid.cpp Прегледај датотеку

33
 	}
33
 	}
34
 
34
 
35
     YAML::Node Grid::Serialize() const {
35
     YAML::Node Grid::Serialize() const {
36
-
37
         YAML::Node node = LemmaObject::Serialize();
36
         YAML::Node node = LemmaObject::Serialize();
38
         node.SetTag( this->GetName() );
37
         node.SetTag( this->GetName() );
39
         return node;
38
         return node;
40
-
41
     }
39
     }
42
 
40
 
43
 }
41
 }

+ 15
- 0
Modules/LemmaCore/src/Instrument.cpp Прегледај датотеку

23
 	Instrument::Instrument( ) : LemmaObject() {
23
 	Instrument::Instrument( ) : LemmaObject() {
24
 	}
24
 	}
25
 
25
 
26
+    Instrument::Instrument( const YAML::Node& node ) : LemmaObject( node ) {
27
+	    // Fill in class specifics
28
+    }
29
+
26
 	Instrument::~Instrument() {
30
 	Instrument::~Instrument() {
27
 	}
31
 	}
28
 
32
 
33
+    //--------------------------------------------------------------------------------------
34
+    //       Class:  Instrument
35
+    //      Method:  Serialize
36
+    //--------------------------------------------------------------------------------------
37
+    YAML::Node  Instrument::Serialize (  ) const {
38
+        YAML::Node node = LemmaObject::Serialize();;
39
+        node.SetTag( GetName() );
40
+        // Fill in class specifics
41
+        return node;
42
+    }		// -----  end of method Instrument::Serialize  -----
43
+
29
 }		// -----  end of Lemma  name  -----
44
 }		// -----  end of Lemma  name  -----

+ 1
- 2
Modules/LemmaCore/src/LayeredEarth.cpp Прегледај датотеку

33
 	LayeredEarth::~LayeredEarth() {
33
 	LayeredEarth::~LayeredEarth() {
34
 	}
34
 	}
35
 
35
 
36
-    LayeredEarth::LayeredEarth(const YAML::Node& node) : EarthModel(node)
37
-    {
36
+    LayeredEarth::LayeredEarth(const YAML::Node& node) : EarthModel(node) {
38
         NumberOfLayers = node["NumberOfLayers"].as<int>();
37
         NumberOfLayers = node["NumberOfLayers"].as<int>();
39
         NumberOfInterfaces = node["NumberOfInterfaces"].as<int>();
38
         NumberOfInterfaces = node["NumberOfInterfaces"].as<int>();
40
         LayerThickness = node["LayerThickness"].as<VectorXr>();
39
         LayerThickness = node["LayerThickness"].as<VectorXr>();

+ 73
- 6
Modules/LemmaCore/src/WindowFilter.cpp Прегледај датотеку

15
 
15
 
16
 namespace Lemma {
16
 namespace Lemma {
17
 
17
 
18
-    // ====================  LIFECYCLE     =======================
18
+    // ====================  FRIEND METHODS  =====================
19
+
20
+    std::ostream &operator << (std::ostream &stream, const WindowFilter &ob) {
21
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
22
+        return stream;
23
+    }
19
 
24
 
20
-    WindowFilter::WindowFilter( ) : Filter( ),
21
-        Width(0), SamplingRate(0), Bandwidth(0), Coefficients(),
22
-        Type(RECTANGULAR) {}
25
+    // ====================  LIFECYCLE     =======================
23
 
26
 
27
+    //--------------------------------------------------------------------------------------
28
+    //       Class:  WindowFilter
29
+    //      Method:  WindowFilter
30
+    // Description:  constructor (locked with ctor_key)
31
+    //--------------------------------------------------------------------------------------
32
+    WindowFilter::WindowFilter( const ctor_key& ) : Filter( ),
33
+        Width(0), SamplingRate(0), Bandwidth(0), Coefficients(), Type(RECTANGULAR)
34
+    {
35
+    }   // -----  end of method WindowFilter::WindowFilter  (constructor)  -----
36
+
37
+    //--------------------------------------------------------------------------------------
38
+    //       Class:  WindowFilter
39
+    //      Method:  WindowFilter
40
+    // Description:  DeSerializing constructor (locked with ctor_key)
41
+    //--------------------------------------------------------------------------------------
42
+    WindowFilter::WindowFilter( const YAML::Node& node, const ctor_key& ) : Filter( node ),
43
+        Width(0), SamplingRate(0), Bandwidth(0), Coefficients(), Type(RECTANGULAR)
44
+    {
45
+        Width = node["Width"].as<int>( );
46
+        Nt = node["Nt"].as<int>( );
47
+        Nw = node["Nw"].as<int>( );
48
+        SamplingRate = node["SamplingRate"].as<Real>();
49
+        Bandwidth = node["Bandwidth"].as<Real>();
50
+        Coefficients = node["Coefficients"].as<VectorXr>();
51
+        Type = string2Enum<WINDOWTYPE>( node["WINDOWTYPE"].as<std::string>() );
52
+    } // -----  end of method WindowFilter::WindowFilter  (constructor)  -----
53
+
54
+    //--------------------------------------------------------------------------------------
55
+    //       Class:  WindowFilter
56
+    //      Method:  NewSP()
57
+    // Description:  public constructor
58
+    //--------------------------------------------------------------------------------------
24
     std::shared_ptr< WindowFilter > WindowFilter::NewSP() {
59
     std::shared_ptr< WindowFilter > WindowFilter::NewSP() {
25
-        std::shared_ptr<WindowFilter> sp(new  WindowFilter( ), LemmaObjectDeleter() );
26
-        return sp;
60
+        return std::make_shared< WindowFilter >( ctor_key() );
27
     }
61
     }
28
 
62
 
63
+    //--------------------------------------------------------------------------------------
64
+    //       Class:  WindowFilter
65
+    //      Method:  ~WindowFilter
66
+    // Description:  destructor (protected)
67
+    //--------------------------------------------------------------------------------------
29
     WindowFilter::~WindowFilter() {
68
     WindowFilter::~WindowFilter() {
30
     }
69
     }
31
 
70
 
71
+    //--------------------------------------------------------------------------------------
72
+    //       Class:  WindowFilter
73
+    //      Method:  Serialize
74
+    //--------------------------------------------------------------------------------------
75
+    YAML::Node  WindowFilter::Serialize (  ) const {
76
+        YAML::Node node = Filter::Serialize();;
77
+        node.SetTag( GetName() );
78
+        // FILL IN CLASS SPECIFICS HERE
79
+        node["Width"] = Width;
80
+        node["Nt"] = Nt;
81
+        node["Nw"] = Nw;
82
+        node["SamplingRate"] = SamplingRate;
83
+        node["Bandwidth"] = Bandwidth;
84
+        node["Coefficients"] = Coefficients;
85
+        node["WINDOWTYPE"] = enum2String(Type);
86
+        return node;
87
+    }
88
+
89
+    //--------------------------------------------------------------------------------------
90
+    //       Class:  WindowFilter
91
+    //      Method:  DeSerialize
92
+    //--------------------------------------------------------------------------------------
93
+    std::shared_ptr<WindowFilter> WindowFilter::DeSerialize ( const YAML::Node& node  ) {
94
+        if (node.Tag() != "WindowFilter") {
95
+            throw  DeSerializeTypeMismatch( "WindowFilter", node.Tag());
96
+        }
97
+        return std::make_shared<WindowFilter>( node, ctor_key() );
98
+    }
32
 
99
 
33
     // ====================  OPERATIONS    =======================
100
     // ====================  OPERATIONS    =======================
34
 
101
 

+ 24
- 0
Modules/LemmaCore/src/helper.cpp Прегледај датотеку

150
     return t;
150
     return t;
151
 }
151
 }
152
 
152
 
153
+std::string enum2String( const WINDOWTYPE& Type ) {
154
+    std::string t;
155
+    switch (Type) {
156
+        case HAMMING:
157
+            return std::string("HAMMING");
158
+        case HANNING:
159
+            return  std::string("HANNING");
160
+        case RECTANGULAR:
161
+            return std::string("RECTANGULAR");
162
+        default:
163
+            throw( std::runtime_error( "In enum2String WINDOWTYPE, type not identified" ) );
164
+    }
165
+}
166
+
153
 template<>
167
 template<>
154
 FREQUENCYUNITS string2Enum<FREQUENCYUNITS>( const std::string& str ) {
168
 FREQUENCYUNITS string2Enum<FREQUENCYUNITS>( const std::string& str ) {
155
     if       (str ==  "HZ") return   HZ;
169
     if       (str ==  "HZ") return   HZ;
197
     }
211
     }
198
 }
212
 }
199
 
213
 
214
+template<>
215
+WINDOWTYPE string2Enum<WINDOWTYPE>( const std::string& str ) {
216
+    if      (str == "HAMMING")      return HAMMING;
217
+    if      (str == "HANNING")      return HANNING;
218
+    if      (str == "RECTANGULAR")  return RECTANGULAR;
219
+    else {
220
+        throw std::runtime_error("string not recognized as WindowType");
221
+    }
222
+}
223
+
200
 }		// -----  end of Lemma  name  -----
224
 }		// -----  end of Lemma  name  -----
201
 
225
 

+ 16
- 13
Modules/LemmaCore/testing/SerializeCheck.h Прегледај датотеку

26
 {
26
 {
27
     public:
27
     public:
28
 
28
 
29
-//     void testASCIIParser( void )
30
-//     {
31
-//         auto Obj = ASCIIParser::NewSP();
32
-//         YAML::Node node = Obj->Serialize();
33
-//         auto Obj2 = ASCIIParser::DeSerialize(node);
34
-//         TS_ASSERT_EQUALS( Obj->GetName(), Obj2->GetName() );
35
-//     }
36
-
29
+    void testASCIIParser( void )
30
+    {
31
+        auto Obj = ASCIIParser::NewSP();
32
+        YAML::Node node = Obj->Serialize();
33
+        auto Obj2 = ASCIIParser::DeSerialize(node);
34
+        TS_ASSERT_EQUALS( Obj->GetName(), Obj2->GetName() );
35
+    }
37
 
36
 
38
     void testCubicSplineInterpolator(void)
37
     void testCubicSplineInterpolator(void)
39
     {
38
     {
51
         TS_ASSERT_EQUALS( Obj->GetName(), Obj2->GetName() );
50
         TS_ASSERT_EQUALS( Obj->GetName(), Obj2->GetName() );
52
     }
51
     }
53
 
52
 
53
+    void testWindowFilter( void )
54
+    {
55
+        auto Obj = WindowFilter::NewSP();
56
+        YAML::Node node = Obj->Serialize();
57
+        auto Obj2 = WindowFilter::DeSerialize(node);
58
+        TS_ASSERT_EQUALS( Obj->GetName(), Obj2->GetName() );
59
+    }
60
+
54
 // /*
61
 // /*
55
 //     void testRectilinearGridReader( void )
62
 //     void testRectilinearGridReader( void )
56
 //     {
63
 //     {
64
 //         TS_ASSERT_EQUALS( Obj->GetName(), std::string("RectilinearGridVTKExporter") );
71
 //         TS_ASSERT_EQUALS( Obj->GetName(), std::string("RectilinearGridVTKExporter") );
65
 //     }
72
 //     }
66
 //
73
 //
67
-//     void testWindowFilter( void )
68
-//     {
69
-//         auto Obj = WindowFilter::NewSP();
70
-//         TS_ASSERT_EQUALS( Obj->GetName(), std::string("WindowFilter") );
71
-//     }
74
+
72
 // */
75
 // */
73
 
76
 
74
 };
77
 };

+ 23
- 20
vim/c.vim Прегледај датотеку

1
-"===================================================================================
2
-"
3
-"         FILE:  c.vim
4
-"  DESCRIPTION:  syntax file
5
-"                enable syntax based folding
6
-"                part of the c-support plugin
7
-"
8
-"       AUTHOR:  Trevor Irons
9
-"        EMAIL:  tirons@mines.edu
10
-"      COMPANY:  FH Südwestfalen, Iserlohn
11
-"      VERSION:  1.0
12
-"      CREATED:  11.03.2006
13
-"     REVISION:  ---
14
-"===================================================================================
15
-"
16
-" fold C blocks
17
-"
18
-syn region cBlock start="{" end="}" transparent fold
19
-set foldmethod=syntax
20
-set foldlevel=999
1
+"highlight cComment ctermfg=Green guifg=Green
2
+highlight cType ctermfg=Green guifg=Green
3
+syn keyword cType Real Complex VectorXr VectorXcr Vector3r Vector3Xr VectorXi Vector3cr Vector3Xcr MatrixXr MatrixXi MatrixXcr shared_ptr make_shared
21
 
4
 
5
+highlight constType ctermfg=Red guifg=Red
6
+syn keyword constType  PI EPSILON0 MU0 QPI  
7
+
8
+highlight eType ctermfg=Magenta guifg=Magenta
9
+syn keyword eType  MAGUNITS  TEMPUNITS  TIMEUNITS FREQUENCYUNITS FEMCOILORIENTATION ORIENTATION FIELDTYPE FIELDCOMPONENT SPATIALCOORDINANT HANKELTRANSFORMTYPE FIELDCALCULATIONS WINDOWTYPE 
10
+
11
+highlight eeType ctermfg=Cyan guifg=Cyan
12
+syn keyword eeType  TESLA NANOTESLA GAUSS CELCIUS KELVIN SEC MILLISEC MICROSEC NANOSEC PICOSEC HZ KHZ MHZ GHZ COAXIAL COPLANAR HFIELDREAL HFIELDIMAG EFIELDREAL EFIELDIMAG XCOMPONENT YCOMPONENT ZCOMPONENT XCOORD YCOORD ZCOORD X Y Z NX  NY  NZ ANDERSON801 CHAVE FHTKEY201 FHTKEY101 FHTKEY51 QWEKEY E H BOTH HAMMING HANNING RECTANGULAR
13
+
14
+" Namespaces
15
+highlight nspace ctermfg=Red guifg=Red
16
+syn keyword nspace Lemma YAML Eigen 
17
+
18
+" Lemma types
19
+highlight leType ctermfg=Yellow guifg=Yellow
20
+syn keyword leType HankelTransform KernelEm1D KernelEM1DManager DipoleSource EarthModel LayeredEarth LayeredEarthEM TEMSurvey TEMSurveyLine TEMSurveyLineRecord TEMInductiveReceiver PolygonalWireAntenna TEMTransmitter TEMReceiver Instrument InstrumentTem LemmaObject ReceiverPoints DCIPElectrode TEMSurveyData TEMSurveyLineData TEMSurveyLineRecordData  ASCIIParser CubicSplineInterpolator RectilinearGrid RectilinearGridReader RectilinearGridVTKExporter Filter WindowFilter DEMParticle DEMGrain Data DataReader
21
+
22
+" Deprecated Lemma Types
23
+highlight dleType ctermfg=Blue guifg=Blue 
24
+syn keyword dleType  ReferenceCountedObject 

+ 44
- 24
vim/cpp.cpp.template Прегледај датотеку

129
 
129
 
130
 	friend std::ostream &operator<<(std::ostream &stream, const |CLASSNAME| &ob);
130
 	friend std::ostream &operator<<(std::ostream &stream, const |CLASSNAME| &ob);
131
 
131
 
132
+    /*
133
+     *  This key is used to lock the constructor.
134
+     */
135
+    struct ctor_key {};
136
+
132
 	public:
137
 	public:
133
 
138
 
134
 	    // ====================  LIFECYCLE     =======================
139
 	    // ====================  LIFECYCLE     =======================
135
 
140
 
136
-        /*
137
-         *  Factory method for generating concrete class.
138
-         *  @return a std::shared_ptr of type |CLASSNAME|
141
+        /**
142
+         * Default constructor.
143
+         * @note This method is locked, and cannot be called directly.
144
+         *       The reason that the method is public is to enable the use
145
+         *       of make_shared whilst enforcing the use of shared_ptr,
146
+         *       in c++-17, this curiosity may be resolved.
147
+         * @see |CLASSNAME|::NewSP
139
          */
148
          */
140
-	    static std::shared_ptr< |CLASSNAME| > NewSP();
149
+        explicit |CLASSNAME| ( const ctor_key& );
150
+
151
+        /**
152
+         * DeSerializing constructor.
153
+         * @note This method is locked, and cannot be called directly.
154
+         *       The reason that the method is public is to enable the use
155
+         *       of make_shared whilst enforcing the use of shared_ptr,
156
+         *       in c++-17, this curiosity may be resolved.
157
+         * @see |CLASSNAME|::DeSerialize
158
+         */
159
+        |CLASSNAME| (const YAML::Node& node);
160
+
161
+        /**
162
+         * Default destructor.
163
+         * @note This method should never be called due to the mandated
164
+         *       use of smart pointers. It is necessary to keep the method
165
+         *       public in order to allow for the use of the more efficeint
166
+         *       make_shared constructor.
167
+         */
168
+        virtual ~|CLASSNAME| ();
141
 
169
 
142
         /**
170
         /**
143
          *  Uses YAML to serialize this object.
171
          *  Uses YAML to serialize this object.
144
          *  @return a YAML::Node
172
          *  @return a YAML::Node
145
-         *   @see |CLASSNAME|::DeSerialize
173
+         *  @see |CLASSNAME|::DeSerialize
174
+         */
175
+        virtual YAML::Node Serialize() const;
176
+
177
+        /*
178
+         *  Factory method for generating concrete class.
179
+         *  @return a std::shared_ptr of type |CLASSNAME|
146
          */
180
          */
147
-        YAML::Node Serialize() const;
181
+	    static std::shared_ptr< |CLASSNAME| > NewSP();
148
 
182
 
149
         /**
183
         /**
150
          *   Constructs an |CLASSNAME| object from a YAML::Node.
184
          *   Constructs an |CLASSNAME| object from a YAML::Node.
160
 
194
 
161
         // ====================  INQUIRY       =======================
195
         // ====================  INQUIRY       =======================
162
 
196
 
163
-
164
-
165
     protected:
197
     protected:
166
 
198
 
167
         // ====================  LIFECYCLE     =======================
199
         // ====================  LIFECYCLE     =======================
168
 
200
 
169
-        /**
170
-         * Default protected constructor, use NewSP methods to construct
171
-         * @see |CLASSNAME|::NewSP
172
-         */
173
-        |CLASSNAME| (const std::string& name);
174
-
175
-        /**
176
-         * Protected DeDerializing constructor, use factory DeSerialize  method.
177
-         * @see |CLASSNAME|::DeSerialize
178
-         */
179
-        |CLASSNAME| (const YAML::Node& node);
180
-
181
-        /** Default protected destructor, use smart pointers (std::shared_ptr) */
182
-        ~|CLASSNAME| ();
183
-
184
-	// ====================  DATA MEMBERS  =========================
201
+    	// ====================  DATA MEMBERS  =========================
185
 
202
 
186
     private:
203
     private:
187
 
204
 
205
+        /** ASCII string representation of the class name */
206
+        static constexpr auto CName = "|CLASSNAME|";
207
+
188
 }; // -----  end of class  |CLASSNAME|  -----
208
 }; // -----  end of class  |CLASSNAME|  -----
189
 }  // -----  end of namespace Lemma ----
209
 }  // -----  end of namespace Lemma ----
190
 
210
 

Loading…
Откажи
Сачувај