Quellcode durchsuchen

Tweak for clang and OSX

submodule
Trevor Irons vor 8 Jahren
Ursprung
Commit
833fe6e07e

+ 1
- 3
Modules/LemmaCore/include/ASCIIParser.h Datei anzeigen

@@ -138,9 +138,7 @@ class ASCIIParser : public LemmaObject {
138 138
     int GetFileLocation();
139 139
 
140 140
     /** Returns the name of the underlying class, similiar to Python's type */
141
-    virtual inline std::string GetName() const {
142
-        return CName;
143
-    }
141
+    virtual std::string GetName() const;
144 142
 
145 143
     // ====================  INQUIRY       =======================
146 144
 

+ 1
- 3
Modules/LemmaCore/include/EarthModel.h Datei anzeigen

@@ -92,9 +92,7 @@ namespace Lemma {
92 92
             Real GetMagneticFieldMagnitudeInGauss( );
93 93
 
94 94
             /** Returns the name of the underlying class, similiar to Python's type */
95
-            virtual inline std::string GetName() const {
96
-                return this->CName;
97
-            }
95
+            virtual inline std::string GetName() const;
98 96
 
99 97
         protected:
100 98
 

+ 1
- 3
Modules/LemmaCore/include/Filter.h Datei anzeigen

@@ -49,9 +49,7 @@ namespace Lemma {
49 49
             // ====================  INQUIRY       =======================
50 50
 
51 51
             /** Returns the name of the underlying class, similiar to Python's type */
52
-            virtual inline std::string GetName() const {
53
-                return this->CName;
54
-            }
52
+            virtual std::string GetName() const;
55 53
 
56 54
         protected:
57 55
 

+ 1
- 3
Modules/LemmaCore/include/Grid.h Datei anzeigen

@@ -46,9 +46,7 @@ class Grid : public LemmaObject {
46 46
         // ====================  INQUIRY       ===================================
47 47
 
48 48
         /** Returns the name of the underlying class, similiar to Python's type */
49
-        virtual inline std::string GetName() const {
50
-            return this->CName;
51
-        }
49
+        virtual std::string GetName() const;
52 50
 
53 51
     protected:
54 52
 

+ 1
- 3
Modules/LemmaCore/include/GridReader.h Datei anzeigen

@@ -53,9 +53,7 @@ namespace Lemma {
53 53
             // ====================  INQUIRY       =======================
54 54
 
55 55
             /** Returns the name of the underlying class, similiar to Python's type */
56
-            virtual inline std::string GetName() const {
57
-                return this->CName;
58
-            }
56
+            virtual std::string GetName() const = 0;
59 57
 
60 58
         protected:
61 59
 

+ 1
- 3
Modules/LemmaCore/include/Instrument.h Datei anzeigen

@@ -49,9 +49,7 @@ namespace Lemma {
49 49
 			// ====================  INQUIRY       ===========================
50 50
 
51 51
             /** Returns the name of the underlying class, similiar to Python's type */
52
-            virtual inline std::string GetName() const {
53
-                return this->CName;
54
-            }
52
+            virtual std::string GetName() const = 0;
55 53
 
56 54
 			// ====================  DATA MEMBERS  ===========================
57 55
 

+ 1
- 3
Modules/LemmaCore/include/LayeredEarth.h Datei anzeigen

@@ -94,9 +94,7 @@ namespace Lemma {
94 94
             YAML::Node Serialize() const;
95 95
 
96 96
             /** Returns the name of the underlying class, similiar to Python's type */
97
-            virtual inline std::string GetName() const {
98
-                return this->CName;
99
-            }
97
+            virtual std::string GetName() const;
100 98
 
101 99
 		protected:
102 100
 

+ 1
- 3
Modules/LemmaCore/include/LemmaObject.h Datei anzeigen

@@ -83,9 +83,7 @@ class LemmaObject {
83 83
             Was chosen over typeid due to name mangling among various compilers, and the need for consistency
84 84
             in Serialized objects.
85 85
          */
86
-        virtual inline std::string GetName() const {
87
-            return this->CName;
88
-        }
86
+        virtual std::string GetName() const;
89 87
 
90 88
     protected:
91 89
 

+ 1
- 3
Modules/LemmaCore/include/RectilinearGrid.h Datei anzeigen

@@ -180,9 +180,7 @@ namespace Lemma {
180 180
             // ====================  INQUIRY       =======================
181 181
 
182 182
             /** Returns the name of the underlying class, similiar to Python's type */
183
-            virtual inline std::string GetName() const {
184
-                return this->CName;
185
-            }
183
+            virtual inline std::string GetName() const;
186 184
 
187 185
         protected:
188 186
 

+ 1
- 3
Modules/LemmaCore/include/RectilinearGridReader.h Datei anzeigen

@@ -114,9 +114,7 @@ namespace Lemma {
114 114
             // ====================  INQUIRY       =======================
115 115
 
116 116
             /** Returns the name of the underlying class, similiar to Python's type */
117
-            virtual inline std::string GetName() const {
118
-                return this->CName;
119
-            }
117
+            virtual std::string GetName() const ;
120 118
 
121 119
         protected:
122 120
 

+ 1
- 3
Modules/LemmaCore/include/RectilinearGridVTKExporter.h Datei anzeigen

@@ -101,9 +101,7 @@ class RectilinearGridVTKExporter : public LemmaObject {
101 101
     void WriteVTKGrid( const std::string& name );
102 102
 
103 103
     /** Returns the name of the underlying class, similiar to Python's type */
104
-    virtual inline std::string GetName() const {
105
-        return this->CName;
106
-    }
104
+    virtual inline std::string GetName() const;
107 105
 
108 106
     protected:
109 107
 

+ 1
- 3
Modules/LemmaCore/include/WindowFilter.h Datei anzeigen

@@ -96,9 +96,7 @@ namespace Lemma {
96 96
             VectorXr GetFilterCoefficients( );
97 97
 
98 98
             /** Returns the name of the underlying class, similiar to Python's type */
99
-            virtual inline std::string GetName() const {
100
-                return this->CName;
101
-            }
99
+            virtual inline std::string GetName() const ;
102 100
 
103 101
         protected:
104 102
 

+ 9
- 0
Modules/LemmaCore/src/ASCIIParser.cpp Datei anzeigen

@@ -84,6 +84,15 @@ namespace Lemma {
84 84
 
85 85
     //--------------------------------------------------------------------------------------
86 86
     //       Class:  ASCIIParser
87
+    //      Method:  GetName
88
+    // Description:  Class identifier
89
+    //--------------------------------------------------------------------------------------
90
+    inline std::string ASCIIParser::GetName (  ) const {
91
+        return CName;
92
+    }		// -----  end of method ASCIIParser::GetName  -----
93
+
94
+    //--------------------------------------------------------------------------------------
95
+    //       Class:  ASCIIParser
87 96
     //      Method:  ASCIIParser
88 97
     // Description:  DeSerializing constructor (protected)
89 98
     //--------------------------------------------------------------------------------------

+ 0
- 1
Modules/LemmaCore/src/CMakeLists.txt Datei anzeigen

@@ -14,6 +14,5 @@ set (SOURCE
14 14
 	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarth.cpp			   # ABC, no key
15 15
 	${CMAKE_CURRENT_SOURCE_DIR}/Data.cpp                       # ABC, no key
16 16
 	${CMAKE_CURRENT_SOURCE_DIR}/DataReader.cpp                 # ABC, no key
17
-	${CMAKE_CURRENT_SOURCE_DIR}/Instrument.cpp                 # ABC, no key
18 17
 	PARENT_SCOPE
19 18
 )

+ 11
- 1
Modules/LemmaCore/src/EarthModel.cpp Datei anzeigen

@@ -48,7 +48,17 @@ namespace Lemma {
48 48
 	}
49 49
 
50 50
  	// ====================  ACCESS        ===================================
51
-	void EarthModel::SetMagneticFieldComponents(const Vector3r &bfield,
51
+
52
+    //--------------------------------------------------------------------------------------
53
+    //       Class:  EarthModel
54
+    //      Method:  GetName
55
+    // Description:  Class identifier
56
+    //--------------------------------------------------------------------------------------
57
+    inline std::string EarthModel::GetName (  ) const {
58
+        return CName;
59
+    }		// -----  end of method EarthModel::get_GetName  -----
60
+
61
+    void EarthModel::SetMagneticFieldComponents(const Vector3r &bfield,
52 62
 					const MAGUNITS &unit) {
53 63
 
54 64
  		this->BField = bfield;

+ 10
- 0
Modules/LemmaCore/src/Filter.cpp Datei anzeigen

@@ -52,4 +52,14 @@ namespace Lemma {
52 52
         // FILL IN CLASS SPECIFICS HERE
53 53
         return node;
54 54
     }		// -----  end of method Filter::Serialize  -----
55
+
56
+    //--------------------------------------------------------------------------------------
57
+    //       Class:  Filter
58
+    //      Method:  GetName
59
+    // Description:  Class identifier
60
+    //--------------------------------------------------------------------------------------
61
+    inline std::string Filter::GetName (  ) const {
62
+        return CName;
63
+    }		// -----  end of method Filter::get_GetName  -----
64
+
55 65
 }		// -----  end of Lemma  name  -----

+ 9
- 0
Modules/LemmaCore/src/Grid.cpp Datei anzeigen

@@ -38,4 +38,13 @@ namespace Lemma {
38 38
         return node;
39 39
     }
40 40
 
41
+    //--------------------------------------------------------------------------------------
42
+    //       Class:  Grid
43
+    //      Method:  GetName
44
+    // Description:  Class identifier
45
+    //--------------------------------------------------------------------------------------
46
+    inline std::string Grid::GetName (  ) const {
47
+        return CName;
48
+    }		// -----  end of method Grid::get_GetName  -----
49
+
41 50
 }

+ 0
- 44
Modules/LemmaCore/src/Instrument.cpp Datei anzeigen

@@ -1,44 +0,0 @@
1
-/* This file is part of Lemma, a geophysical modelling and inversion API */
2
-
3
-/* This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
-
7
-/**
8
-  @file
9
-  @author   Trevor Irons
10
-  @date     02/05/2010
11
-  @version  $Id: instrument.cpp 193 2014-11-10 23:51:41Z tirons $
12
- **/
13
-
14
-#include "Instrument.h"
15
-
16
-namespace Lemma {
17
-
18
-    std::ostream &operator << (std::ostream &stream, const Instrument &ob) {
19
-        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
-        return stream;
21
-    }
22
-
23
-	Instrument::Instrument( ) : LemmaObject() {
24
-	}
25
-
26
-    Instrument::Instrument( const YAML::Node& node ) : LemmaObject( node ) {
27
-	    // Fill in class specifics
28
-    }
29
-
30
-	Instrument::~Instrument() {
31
-	}
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
-
44
-}		// -----  end of Lemma  name  -----

+ 9
- 0
Modules/LemmaCore/src/LayeredEarth.cpp Datei anzeigen

@@ -51,6 +51,15 @@ namespace Lemma {
51 51
 
52 52
 	// ====================  ACCESS        ===================================
53 53
 
54
+    //--------------------------------------------------------------------------------------
55
+    //       Class:  LayeredEarth
56
+    //      Method:  GetName
57
+    // Description:  Class identifier
58
+    //--------------------------------------------------------------------------------------
59
+    inline std::string LayeredEarth::GetName (  ) const {
60
+        return CName;
61
+    }		// -----  end of method LayeredEarth::get_GetName  -----
62
+
54 63
 	void LayeredEarth::SetLayerThickness(const VectorXr &thick) {
55 64
 		if (thick.size() != this->NumberOfLayers - 2)
56 65
 			throw EarthModelParametersDoNotMatchNumberOfLayers( );

+ 4
- 0
Modules/LemmaCore/src/LemmaObject.cpp Datei anzeigen

@@ -40,6 +40,10 @@ namespace Lemma {
40 40
 
41 41
     // ====================  INQUIRY       ==============================
42 42
 
43
+    inline std::string LemmaObject::GetName() const {
44
+        return CName;
45
+    }
46
+
43 47
     // ====================  ACCESS        ==============================
44 48
 
45 49
     // ====================  ACCESS        ==============================

+ 8
- 0
Modules/LemmaCore/src/RectilinearGrid.cpp Datei anzeigen

@@ -81,6 +81,14 @@ namespace Lemma {
81 81
         return std::make_shared< RectilinearGrid > ( node, ctor_key() );
82 82
     }
83 83
 
84
+    //--------------------------------------------------------------------------------------
85
+    //       Class:  RectilinearGrid
86
+    //      Method:  GetName
87
+    // Description:  Class identifier
88
+    //--------------------------------------------------------------------------------------
89
+    inline std::string RectilinearGrid::GetName (  ) const {
90
+        return CName;
91
+    }		// -----  end of method RectilinearGrid::get_GetName  -----
84 92
 
85 93
     // ====================  OPERATIONS    =======================
86 94
 

+ 11
- 2
Modules/LemmaCore/src/RectilinearGridReader.cpp Datei anzeigen

@@ -73,7 +73,7 @@ namespace Lemma {
73 73
         //node["CommentString"] = CommentString;
74 74
         //node["BufferSize"] = BufferSize;
75 75
         return node;
76
-    }		// -----  end of method ASCIIParser::Serialize  -----
76
+    }		// -----  end of method GridReader::Serialize  -----
77 77
 
78 78
     //--------------------------------------------------------------------------------------
79 79
     //       Class:  RectilinearGridReader
@@ -84,7 +84,16 @@ namespace Lemma {
84 84
             throw  DeSerializeTypeMismatch( "RectilinearGridReader", node.Tag());
85 85
         }
86 86
         return std::make_shared< RectilinearGridReader >( node, ctor_key() ); //, ctor_key() );
87
-    }		// -----  end of method ASCIIParser::DeSerialize  -----
87
+    }		// -----  end of method GridReader::DeSerialize  -----
88
+
89
+    //--------------------------------------------------------------------------------------
90
+    //       Class:  RectilinearGridReader
91
+    //      Method:  GetName
92
+    // Description:  Class identifier
93
+    //--------------------------------------------------------------------------------------
94
+    inline std::string RectilinearGridReader::GetName (  ) const {
95
+        return CName;
96
+    }		// -----  end of method RectilinearGridReader::get_GetName  -----
88 97
 
89 98
     //--------------------------------------------------------------------------------------
90 99
     //       Class:  RectilinearGridReader

+ 9
- 0
Modules/LemmaCore/src/RectilinearGridVTKExporter.cpp Datei anzeigen

@@ -70,6 +70,15 @@ RectilinearGridVTKExporter::~RectilinearGridVTKExporter () {
70 70
 
71 71
 //--------------------------------------------------------------------------------------
72 72
 //       Class:  RectilinearGridVTKExporter
73
+//      Method:  GetName
74
+// Description:  Class identifier
75
+//--------------------------------------------------------------------------------------
76
+inline std::string RectilinearGridVTKExporter::GetName (  ) const {
77
+    return CName;
78
+}		// -----  end of method RectilinearGridVTKExporter::GetName  -----
79
+
80
+//--------------------------------------------------------------------------------------
81
+//       Class:  RectilinearGridVTKExporter
73 82
 //      Method:  SetGrid
74 83
 //--------------------------------------------------------------------------------------
75 84
 void RectilinearGridVTKExporter::SetGrid ( std::shared_ptr<RectilinearGrid> GridIn ) {

+ 9
- 0
Modules/LemmaCore/src/WindowFilter.cpp Datei anzeigen

@@ -97,6 +97,15 @@ namespace Lemma {
97 97
         return std::make_shared<WindowFilter>( node, ctor_key() );
98 98
     }
99 99
 
100
+    //--------------------------------------------------------------------------------------
101
+    //       Class:  WindowFilter
102
+    //      Method:  GetName
103
+    // Description:  Class identifier
104
+    //--------------------------------------------------------------------------------------
105
+    inline std::string WindowFilter::GetName (  ) const {
106
+        return CName;
107
+    }		// -----  end of method WindowFilter::GetName  -----
108
+
100 109
     // ====================  OPERATIONS    =======================
101 110
 
102 111
     void WindowFilter::SetWindowType(const WINDOWTYPE &type) {

Laden…
Abbrechen
Speichern