Browse Source

updated for Lemma 0.2.0

master
T-bone 6 years ago
parent
commit
bf51a0132e

+ 1
- 1
CMakeLists.txt View File

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

+ 0
- 7
include/Coupling.h View File

43
 
43
 
44
         friend std::ostream &operator<<(std::ostream &stream, const Coupling &ob);
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
         public:
46
         public:
54
 
47
 
55
         // ====================  LIFECYCLE     =======================
48
         // ====================  LIFECYCLE     =======================

+ 0
- 2
include/DataFID.h View File

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

+ 0
- 7
include/ForwardFID.h View File

43
 
43
 
44
         friend std::ostream &operator<<(std::ostream &stream, const ForwardFID &ob);
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
         public:
46
         public:
54
 
47
 
55
         // ====================  LIFECYCLE     =======================
48
         // ====================  LIFECYCLE     =======================

+ 0
- 1
include/KernelV0.h View File

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

+ 0
- 7
include/LayeredEarthMR.h View File

37
 
37
 
38
         friend std::ostream &operator<<(std::ostream &stream, const LayeredEarthMR &ob);
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
         public:
40
         public:
48
 
41
 
49
         // ====================  LIFECYCLE     =======================
42
         // ====================  LIFECYCLE     =======================

+ 2
- 9
include/LoopInteractions.h View File

52
             return stream;
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
         public:
55
         public:
63
 
56
 
64
         // ====================  LIFECYCLE     =======================
57
         // ====================  LIFECYCLE     =======================
71
          *       in c++-17, this curiosity may be resolved.
64
          *       in c++-17, this curiosity may be resolved.
72
          * @see LoopInteractions::NewSP
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
          * DeSerializing constructor.
70
          * DeSerializing constructor.
81
          *       in c++-17, this curiosity may be resolved.
74
          *       in c++-17, this curiosity may be resolved.
82
          * @see LoopInteractions::DeSerialize
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
          * Default destructor.
80
          * Default destructor.

+ 2
- 8
include/MerlinObject.h View File

37
 
37
 
38
         friend std::ostream &operator<<(std::ostream &stream, const MerlinObject &ob);
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
         public:
40
         public:
47
 
41
 
48
         // ====================  LIFECYCLE     =======================
42
         // ====================  LIFECYCLE     =======================
55
          *       in c++-17, this curiosity may be resolved.
49
          *       in c++-17, this curiosity may be resolved.
56
          * @see MerlinObject::NewSP
50
          * @see MerlinObject::NewSP
57
          */
51
          */
58
-        explicit MerlinObject ( );
52
+        explicit MerlinObject ( const ctor_key& key );
59
 
53
 
60
         /**
54
         /**
61
          * DeSerializing constructor.
55
          * DeSerializing constructor.
65
          *       in c++-17, this curiosity may be resolved.
59
          *       in c++-17, this curiosity may be resolved.
66
          * @see MerlinObject::DeSerialize
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
          * Default destructor.
65
          * Default destructor.

+ 3
- 3
src/Coupling.cpp View File

26
     // ====================  FRIEND METHODS  =====================
26
     // ====================  FRIEND METHODS  =====================
27
 
27
 
28
     std::ostream &operator << (std::ostream &stream, const Coupling &ob) {
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
         return stream;
30
         return stream;
31
     }
31
     }
32
 
32
 
37
     //      Method:  Coupling
37
     //      Method:  Coupling
38
     // Description:  constructor (locked)
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
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
42
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
43
 
43
 
46
     //      Method:  Coupling
46
     //      Method:  Coupling
47
     // Description:  DeSerializing constructor (locked)
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
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
51
     }  // -----  end of method Coupling::Coupling  (constructor)  -----
52
 
52
 

+ 3
- 3
src/DataFID.cpp View File

25
     // ====================  FRIEND METHODS  =====================
25
     // ====================  FRIEND METHODS  =====================
26
 
26
 
27
     std::ostream &operator << (std::ostream &stream, const DataFID &ob) {
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
         return stream;
29
         return stream;
30
     }
30
     }
31
 
31
 
36
     //      Method:  DataFID
36
     //      Method:  DataFID
37
     // Description:  constructor (locked)
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
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
41
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
42
 
42
 
45
     //      Method:  DataFID
45
     //      Method:  DataFID
46
     // Description:  DeSerializing constructor (locked)
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
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
50
     }  // -----  end of method DataFID::DataFID  (constructor)  -----
51
 
51
 

+ 3
- 3
src/ForwardFID.cpp View File

24
     // ====================  FRIEND METHODS  =====================
24
     // ====================  FRIEND METHODS  =====================
25
 
25
 
26
     std::ostream &operator << (std::ostream &stream, const ForwardFID &ob) {
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
         return stream;
28
         return stream;
29
     }
29
     }
30
 
30
 
35
     //      Method:  ForwardFID
35
     //      Method:  ForwardFID
36
     // Description:  constructor (locked)
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
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
40
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
41
 
41
 
44
     //      Method:  ForwardFID
44
     //      Method:  ForwardFID
45
     // Description:  DeSerializing constructor (locked)
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
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
49
     }  // -----  end of method ForwardFID::ForwardFID  (constructor)  -----
50
 
50
 

+ 3
- 4
src/KernelV0.cpp View File

26
     // ====================  FRIEND METHODS  =====================
26
     // ====================  FRIEND METHODS  =====================
27
 
27
 
28
     std::ostream &operator << (std::ostream &stream, const KernelV0 &ob) {
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
         return stream;
30
         return stream;
31
     }
31
     }
32
 
32
 
37
     //      Method:  KernelV0
37
     //      Method:  KernelV0
38
     // Description:  constructor (locked)
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
     }  // -----  end of method KernelV0::KernelV0  (constructor)  -----
42
     }  // -----  end of method KernelV0::KernelV0  (constructor)  -----
43
 
43
 
46
     //      Method:  KernelV0
46
     //      Method:  KernelV0
47
     // Description:  DeSerializing constructor (locked)
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
         //node["PulseType"] = "FID";
50
         //node["PulseType"] = "FID";
52
         Larmor = node["Larmor"].as<Real>();
51
         Larmor = node["Larmor"].as<Real>();
53
         Temperature = node["Temperature"].as<Real>();
52
         Temperature = node["Temperature"].as<Real>();

+ 2
- 2
src/LayeredEarthMR.cpp View File

35
     //      Method:  LayeredEarthMR
35
     //      Method:  LayeredEarthMR
36
     // Description:  constructor (locked)
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
     }  // -----  end of method LayeredEarthMR::LayeredEarthMR  (constructor)  -----
40
     }  // -----  end of method LayeredEarthMR::LayeredEarthMR  (constructor)  -----
41
 
41
 
44
     //      Method:  LayeredEarthMR
44
     //      Method:  LayeredEarthMR
45
     // Description:  DeSerializing constructor (locked)
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
         Interfaces = node["Interfaces"].as<VectorXr>();
48
         Interfaces = node["Interfaces"].as<VectorXr>();
49
         T2StarBins = node["T2StarBins"].as<VectorXr>();
49
         T2StarBins = node["T2StarBins"].as<VectorXr>();
50
         T2StarBinEdges = node["T2StarBinEdges"].as<VectorXr>();
50
         T2StarBinEdges = node["T2StarBinEdges"].as<VectorXr>();

+ 5
- 5
src/MerlinObject.cpp View File

25
     // ====================  FRIEND METHODS  =====================
25
     // ====================  FRIEND METHODS  =====================
26
 
26
 
27
     std::ostream &operator << (std::ostream &stream, const MerlinObject &ob) {
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
         return stream;
29
         return stream;
30
     }
30
     }
31
 
31
 
36
     //      Method:  MerlinObject
36
     //      Method:  MerlinObject
37
     // Description:  constructor (locked)
37
     // Description:  constructor (locked)
38
     //--------------------------------------------------------------------------------------
38
     //--------------------------------------------------------------------------------------
39
-    MerlinObject::MerlinObject ( ) : LemmaObject( ) {
39
+    MerlinObject::MerlinObject ( const ctor_key& key ) : LemmaObject( key ) {
40
 
40
 
41
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
41
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
42
 
42
 
45
     //      Method:  MerlinObject
45
     //      Method:  MerlinObject
46
     // Description:  DeSerializing constructor (locked)
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
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
50
     }  // -----  end of method MerlinObject::MerlinObject  (constructor)  -----
51
 
51
 
55
     // Description:  public constructor returing a shared_ptr
55
     // Description:  public constructor returing a shared_ptr
56
     //--------------------------------------------------------------------------------------
56
     //--------------------------------------------------------------------------------------
57
     std::shared_ptr< MerlinObject >  MerlinObject::NewSP() {
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
         if (node.Tag() !=  "MerlinObject" ) {
87
         if (node.Tag() !=  "MerlinObject" ) {
88
             throw  DeSerializeTypeMismatch( "MerlinObject", node.Tag());
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
     }		// -----  end of method MerlinObject::DeSerialize  -----
91
     }		// -----  end of method MerlinObject::DeSerialize  -----
92
 
92
 
93
 } // ----  end of namespace Lemma  ----
93
 } // ----  end of namespace Lemma  ----

Loading…
Cancel
Save