Sfoglia il codice sorgente

updated for Lemma 0.2.0

master
T-bone 7 anni fa
parent
commit
bf51a0132e

+ 1
- 1
CMakeLists.txt Vedi File

@@ -1,7 +1,7 @@
1 1
 # Configure Merlin 
2 2
 set(MERLIN_VERSION_MAJOR "0")
3 3
 set(MERLIN_VERSION_MINOR "0")
4
-set(MERLIN_VERSION_PATCH "1")
4
+set(MERLIN_VERSION_PATCH "2")
5 5
 set(MERLIN_VERSION "\"${MERLIN_VERSION_MAJOR}.${MERLIN_VERSION_MINOR}.${MERLIN_VERSION_PATCH}\"")
6 6
 set(MERLIN_VERSION_NOQUOTES "${MERLIN_VERSION_MAJOR}.${MERLIN_VERSION_MINOR}.${MERLIN_VERSION_PATCH}")
7 7
 

+ 0
- 7
include/Coupling.h Vedi File

@@ -43,13 +43,6 @@ namespace Lemma {
43 43
 
44 44
         friend std::ostream &operator<<(std::ostream &stream, const Coupling &ob);
45 45
 
46
-        protected:
47
-        /*
48
-         *  This key is used to lock the constructor. It is protected so that inhereted
49
-         *  classes also have the key to contruct their base class.
50
-         */
51
-        struct ctor_key {};
52
-
53 46
         public:
54 47
 
55 48
         // ====================  LIFECYCLE     =======================

+ 0
- 2
include/DataFID.h Vedi File

@@ -43,8 +43,6 @@ namespace Lemma {
43 43
          *  This key is used to lock the constructor. It is protected so that inhereted
44 44
          *  classes also have the key to contruct their base class.
45 45
          */
46
-        struct ctor_key {};
47
-
48 46
         public:
49 47
 
50 48
         // ====================  LIFECYCLE     =======================

+ 0
- 7
include/ForwardFID.h Vedi File

@@ -43,13 +43,6 @@ namespace Lemma {
43 43
 
44 44
         friend std::ostream &operator<<(std::ostream &stream, const ForwardFID &ob);
45 45
 
46
-        protected:
47
-        /*
48
-         *  This key is used to lock the constructor. It is protected so that inhereted
49
-         *  classes also have the key to contruct their base class.
50
-         */
51
-        struct ctor_key {};
52
-
53 46
         public:
54 47
 
55 48
         // ====================  LIFECYCLE     =======================

+ 0
- 1
include/KernelV0.h Vedi File

@@ -67,7 +67,6 @@ namespace Lemma {
67 67
          *  This key is used to lock the constructor. It is protected so that inhereted
68 68
          *  classes also have the key to contruct their base class.
69 69
          */
70
-        struct ctor_key {};
71 70
 
72 71
         public:
73 72
 

+ 0
- 7
include/LayeredEarthMR.h Vedi File

@@ -37,13 +37,6 @@ namespace Lemma {
37 37
 
38 38
         friend std::ostream &operator<<(std::ostream &stream, const LayeredEarthMR &ob);
39 39
 
40
-        protected:
41
-        /*
42
-         *  This key is used to lock the constructor. It is protected so that inhereted
43
-         *  classes also have the key to contruct their base class.
44
-         */
45
-        struct ctor_key {};
46
-
47 40
         public:
48 41
 
49 42
         // ====================  LIFECYCLE     =======================

+ 2
- 9
include/LoopInteractions.h Vedi File

@@ -52,13 +52,6 @@ namespace Lemma {
52 52
             return stream;
53 53
         }
54 54
 
55
-        protected:
56
-        /*
57
-         *  This key is used to lock the constructor. It is protected so that inhereted
58
-         *  classes also have the key to contruct their base class.
59
-         */
60
-        struct ctor_key {};
61
-
62 55
         public:
63 56
 
64 57
         // ====================  LIFECYCLE     =======================
@@ -71,7 +64,7 @@ namespace Lemma {
71 64
          *       in c++-17, this curiosity may be resolved.
72 65
          * @see LoopInteractions::NewSP
73 66
          */
74
-        explicit LoopInteractions ( const ctor_key& ) : LemmaObject () { }
67
+        explicit LoopInteractions ( const ctor_key& key ) : LemmaObject (key) { }
75 68
 
76 69
         /**
77 70
          * DeSerializing constructor.
@@ -81,7 +74,7 @@ namespace Lemma {
81 74
          *       in c++-17, this curiosity may be resolved.
82 75
          * @see LoopInteractions::DeSerialize
83 76
          */
84
-        LoopInteractions ( const YAML::Node& node, const ctor_key& ) : LemmaObject(node) { }
77
+        LoopInteractions ( const YAML::Node& node, const ctor_key& key) : LemmaObject(node, key) { }
85 78
 
86 79
         /**
87 80
          * Default destructor.

+ 2
- 8
include/MerlinObject.h Vedi File

@@ -37,12 +37,6 @@ namespace Lemma {
37 37
 
38 38
         friend std::ostream &operator<<(std::ostream &stream, const MerlinObject &ob);
39 39
 
40
-        protected:
41
-        /*
42
-         *  This key is used to lock the constructor. It is protected so that inhereted
43
-         *  classes also have the key to contruct their base class.
44
-         */
45
-
46 40
         public:
47 41
 
48 42
         // ====================  LIFECYCLE     =======================
@@ -55,7 +49,7 @@ namespace Lemma {
55 49
          *       in c++-17, this curiosity may be resolved.
56 50
          * @see MerlinObject::NewSP
57 51
          */
58
-        explicit MerlinObject ( );
52
+        explicit MerlinObject ( const ctor_key& key );
59 53
 
60 54
         /**
61 55
          * DeSerializing constructor.
@@ -65,7 +59,7 @@ namespace Lemma {
65 59
          *       in c++-17, this curiosity may be resolved.
66 60
          * @see MerlinObject::DeSerialize
67 61
          */
68
-        MerlinObject ( const YAML::Node& node );
62
+        MerlinObject ( const YAML::Node& node, const ctor_key& key );
69 63
 
70 64
         /**
71 65
          * Default destructor.

+ 3
- 3
src/Coupling.cpp Vedi File

@@ -26,7 +26,7 @@ namespace Lemma {
26 26
     // ====================  FRIEND METHODS  =====================
27 27
 
28 28
     std::ostream &operator << (std::ostream &stream, const Coupling &ob) {
29
-        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
29
+        stream << ob.Serialize()  << "\n"; // End of doc ---
30 30
         return stream;
31 31
     }
32 32
 
@@ -37,7 +37,7 @@ namespace Lemma {
37 37
     //      Method:  Coupling
38 38
     // Description:  constructor (locked)
39 39
     //--------------------------------------------------------------------------------------
40
-    Coupling::Coupling (const ctor_key&) : LemmaObject( ) {
40
+    Coupling::Coupling (const ctor_key& key) : LemmaObject( key ) {
41 41
 
42 42
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
43 43
 
@@ -46,7 +46,7 @@ namespace Lemma {
46 46
     //      Method:  Coupling
47 47
     // Description:  DeSerializing constructor (locked)
48 48
     //--------------------------------------------------------------------------------------
49
-    Coupling::Coupling (const YAML::Node& node, const ctor_key&) : LemmaObject(node) {
49
+    Coupling::Coupling (const YAML::Node& node, const ctor_key& key) : LemmaObject(node, key) {
50 50
 
51 51
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
52 52
 

+ 3
- 3
src/DataFID.cpp Vedi File

@@ -25,7 +25,7 @@ namespace Lemma {
25 25
     // ====================  FRIEND METHODS  =====================
26 26
 
27 27
     std::ostream &operator << (std::ostream &stream, const DataFID &ob) {
28
-        stream <<"%YAML 1.2\n---\n" << ob.Serialize()  << "\n"; // End of doc ---
28
+        stream << ob.Serialize()  << "\n";
29 29
         return stream;
30 30
     }
31 31
 
@@ -36,7 +36,7 @@ namespace Lemma {
36 36
     //      Method:  DataFID
37 37
     // Description:  constructor (locked)
38 38
     //--------------------------------------------------------------------------------------
39
-    DataFID::DataFID (const ctor_key&) : MerlinObject( ) {
39
+    DataFID::DataFID (const ctor_key& key) : MerlinObject( key ) {
40 40
 
41 41
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
42 42
 
@@ -45,7 +45,7 @@ namespace Lemma {
45 45
     //      Method:  DataFID
46 46
     // Description:  DeSerializing constructor (locked)
47 47
     //--------------------------------------------------------------------------------------
48
-    DataFID::DataFID (const YAML::Node& node, const ctor_key&) : MerlinObject(node) {
48
+    DataFID::DataFID (const YAML::Node& node, const ctor_key& key) : MerlinObject(node, key) {
49 49
 
50 50
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
51 51
 

+ 3
- 3
src/ForwardFID.cpp Vedi File

@@ -24,7 +24,7 @@ namespace Lemma {
24 24
     // ====================  FRIEND METHODS  =====================
25 25
 
26 26
     std::ostream &operator << (std::ostream &stream, const ForwardFID &ob) {
27
-        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
27
+        stream << ob.Serialize()  << "\n";
28 28
         return stream;
29 29
     }
30 30
 
@@ -35,7 +35,7 @@ namespace Lemma {
35 35
     //      Method:  ForwardFID
36 36
     // Description:  constructor (locked)
37 37
     //--------------------------------------------------------------------------------------
38
-    ForwardFID::ForwardFID (const ctor_key&) : MerlinObject( ) {
38
+    ForwardFID::ForwardFID (const ctor_key& key) : MerlinObject( key ) {
39 39
 
40 40
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
41 41
 
@@ -44,7 +44,7 @@ namespace Lemma {
44 44
     //      Method:  ForwardFID
45 45
     // Description:  DeSerializing constructor (locked)
46 46
     //--------------------------------------------------------------------------------------
47
-    ForwardFID::ForwardFID (const YAML::Node& node, const ctor_key&) : MerlinObject(node) {
47
+    ForwardFID::ForwardFID (const YAML::Node& node, const ctor_key& key) : MerlinObject(node, key) {
48 48
 
49 49
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
50 50
 

+ 3
- 4
src/KernelV0.cpp Vedi File

@@ -26,7 +26,7 @@ namespace Lemma {
26 26
     // ====================  FRIEND METHODS  =====================
27 27
 
28 28
     std::ostream &operator << (std::ostream &stream, const KernelV0 &ob) {
29
-        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
29
+        stream << ob.Serialize()  << "\n"; // End of doc ---
30 30
         return stream;
31 31
     }
32 32
 
@@ -37,7 +37,7 @@ namespace Lemma {
37 37
     //      Method:  KernelV0
38 38
     // Description:  constructor (locked)
39 39
     //--------------------------------------------------------------------------------------
40
-    KernelV0::KernelV0 (const ctor_key&) : LemmaObject( ) {
40
+    KernelV0::KernelV0 (const ctor_key& key) : LemmaObject( key ) {
41 41
 
42 42
     }  // -----  end of method KernelV0::KernelV0  (constructor)  -----
43 43
 
@@ -46,8 +46,7 @@ namespace Lemma {
46 46
     //      Method:  KernelV0
47 47
     // Description:  DeSerializing constructor (locked)
48 48
     //--------------------------------------------------------------------------------------
49
-    KernelV0::KernelV0 (const YAML::Node& node, const ctor_key&) : LemmaObject(node) {
50
-        std::cout << "Deserializing Kernel" << std::endl;
49
+    KernelV0::KernelV0 (const YAML::Node& node, const ctor_key& key) : LemmaObject(node, key) {
51 50
         //node["PulseType"] = "FID";
52 51
         Larmor = node["Larmor"].as<Real>();
53 52
         Temperature = node["Temperature"].as<Real>();

+ 2
- 2
src/LayeredEarthMR.cpp Vedi File

@@ -35,7 +35,7 @@ namespace Lemma {
35 35
     //      Method:  LayeredEarthMR
36 36
     // Description:  constructor (locked)
37 37
     //--------------------------------------------------------------------------------------
38
-    LayeredEarthMR::LayeredEarthMR (const ctor_key&) : LayeredEarth( ) {
38
+    LayeredEarthMR::LayeredEarthMR (const ctor_key& key) : LayeredEarth( key ) {
39 39
 
40 40
     }  // -----  end of method LayeredEarthMR::LayeredEarthMR  (constructor)  -----
41 41
 
@@ -44,7 +44,7 @@ namespace Lemma {
44 44
     //      Method:  LayeredEarthMR
45 45
     // Description:  DeSerializing constructor (locked)
46 46
     //--------------------------------------------------------------------------------------
47
-    LayeredEarthMR::LayeredEarthMR (const YAML::Node& node, const ctor_key&) : LayeredEarth(node) {
47
+    LayeredEarthMR::LayeredEarthMR (const YAML::Node& node, const ctor_key& key) : LayeredEarth(node, key) {
48 48
         Interfaces = node["Interfaces"].as<VectorXr>();
49 49
         T2StarBins = node["T2StarBins"].as<VectorXr>();
50 50
         T2StarBinEdges = node["T2StarBinEdges"].as<VectorXr>();

+ 5
- 5
src/MerlinObject.cpp Vedi File

@@ -25,7 +25,7 @@ namespace Lemma {
25 25
     // ====================  FRIEND METHODS  =====================
26 26
 
27 27
     std::ostream &operator << (std::ostream &stream, const MerlinObject &ob) {
28
-        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
28
+        stream << ob.Serialize()  << "\n"; // End of doc ---
29 29
         return stream;
30 30
     }
31 31
 
@@ -36,7 +36,7 @@ namespace Lemma {
36 36
     //      Method:  MerlinObject
37 37
     // Description:  constructor (locked)
38 38
     //--------------------------------------------------------------------------------------
39
-    MerlinObject::MerlinObject ( ) : LemmaObject( ) {
39
+    MerlinObject::MerlinObject ( const ctor_key& key ) : LemmaObject( key ) {
40 40
 
41 41
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
42 42
 
@@ -45,7 +45,7 @@ namespace Lemma {
45 45
     //      Method:  MerlinObject
46 46
     // Description:  DeSerializing constructor (locked)
47 47
     //--------------------------------------------------------------------------------------
48
-    MerlinObject::MerlinObject (const YAML::Node& node ) : LemmaObject(node) {
48
+    MerlinObject::MerlinObject (const YAML::Node& node, const ctor_key& key ) : LemmaObject(node, key) {
49 49
 
50 50
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
51 51
 
@@ -55,7 +55,7 @@ namespace Lemma {
55 55
     // Description:  public constructor returing a shared_ptr
56 56
     //--------------------------------------------------------------------------------------
57 57
     std::shared_ptr< MerlinObject >  MerlinObject::NewSP() {
58
-        return std::make_shared< MerlinObject >( );
58
+        return std::make_shared< MerlinObject >( ctor_key() );
59 59
     }
60 60
 
61 61
     //--------------------------------------------------------------------------------------
@@ -87,7 +87,7 @@ namespace Lemma {
87 87
         if (node.Tag() !=  "MerlinObject" ) {
88 88
             throw  DeSerializeTypeMismatch( "MerlinObject", node.Tag());
89 89
         }
90
-        return std::make_shared< MerlinObject > ( node );
90
+        return std::make_shared< MerlinObject > ( node, ctor_key() );
91 91
     }		// -----  end of method MerlinObject::DeSerialize  -----
92 92
 
93 93
 } // ----  end of namespace Lemma  ----

Loading…
Annulla
Salva