|
@@ -0,0 +1,99 @@
|
|
1
|
+/* This file is part of Lemma, a geophysical modelling and inversion API.
|
|
2
|
+ * More information is available at http://lemmasoftware.org
|
|
3
|
+ */
|
|
4
|
+
|
|
5
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
6
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
7
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
8
|
+ */
|
|
9
|
+
|
|
10
|
+/**
|
|
11
|
+ * @file
|
|
12
|
+ * @date 06/16/2016 02:11:21 PM
|
|
13
|
+ * @version $Id$
|
|
14
|
+ * @author Trevor Irons (ti)
|
|
15
|
+ * @email tirons@egi.utah.edu
|
|
16
|
+ * @copyright Copyright (c) 2016, University of Utah
|
|
17
|
+ * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
|
|
18
|
+ */
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+#include "DEMGrain.h"
|
|
22
|
+
|
|
23
|
+namespace Lemma {
|
|
24
|
+
|
|
25
|
+ // ==================== FRIEND METHODS =====================
|
|
26
|
+
|
|
27
|
+ std::ostream &operator << (std::ostream &stream, const DEMGrain &ob) {
|
|
28
|
+ stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
|
|
29
|
+ return stream;
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ // ==================== LIFECYCLE =======================
|
|
33
|
+
|
|
34
|
+ //--------------------------------------------------------------------------------------
|
|
35
|
+ // Class: DEMGrain
|
|
36
|
+ // Method: DEMGrain
|
|
37
|
+ // Description: constructor (protected)
|
|
38
|
+ //--------------------------------------------------------------------------------------
|
|
39
|
+ DEMGrain::DEMGrain ( ) : DEMParticle( ) {
|
|
40
|
+
|
|
41
|
+ } // ----- end of method DEMGrain::DEMGrain (constructor) -----
|
|
42
|
+
|
|
43
|
+ //--------------------------------------------------------------------------------------
|
|
44
|
+ // Class: DEMGrain
|
|
45
|
+ // Method: DEMGrain
|
|
46
|
+ // Description: DeSerializing constructor (protected)
|
|
47
|
+ //--------------------------------------------------------------------------------------
|
|
48
|
+ DEMGrain::DEMGrain (const YAML::Node& node) : DEMParticle(node) {
|
|
49
|
+
|
|
50
|
+ } // ----- end of method DEMGrain::DEMGrain (constructor) -----
|
|
51
|
+
|
|
52
|
+ //--------------------------------------------------------------------------------------
|
|
53
|
+ // Class: DEMGrain
|
|
54
|
+ // Method: NewSP()
|
|
55
|
+ // Description: public constructor returing a shared_ptr
|
|
56
|
+ //--------------------------------------------------------------------------------------
|
|
57
|
+ std::shared_ptr< DEMGrain > DEMGrain::NewSP() {
|
|
58
|
+ std::shared_ptr< DEMGrain > sp(new DEMGrain( ), LemmaObjectDeleter() );
|
|
59
|
+ return sp;
|
|
60
|
+ }
|
|
61
|
+
|
|
62
|
+ //--------------------------------------------------------------------------------------
|
|
63
|
+ // Class: DEMGrain
|
|
64
|
+ // Method: ~DEMGrain
|
|
65
|
+ // Description: destructor (protected)
|
|
66
|
+ //--------------------------------------------------------------------------------------
|
|
67
|
+ DEMGrain::~DEMGrain () {
|
|
68
|
+
|
|
69
|
+ } // ----- end of method DEMGrain::~DEMGrain (destructor) -----
|
|
70
|
+
|
|
71
|
+ //--------------------------------------------------------------------------------------
|
|
72
|
+ // Class: DEMGrain
|
|
73
|
+ // Method: Serialize
|
|
74
|
+ //--------------------------------------------------------------------------------------
|
|
75
|
+ YAML::Node DEMGrain::Serialize ( ) const {
|
|
76
|
+ YAML::Node node = DEMParticle::Serialize();
|
|
77
|
+ node.SetTag( GetName() );
|
|
78
|
+ // FILL IN CLASS SPECIFICS HERE
|
|
79
|
+ return node;
|
|
80
|
+ } // ----- end of method DEMGrain::Serialize -----
|
|
81
|
+
|
|
82
|
+ //--------------------------------------------------------------------------------------
|
|
83
|
+ // Class: DEMGrain
|
|
84
|
+ // Method: DeSerialize
|
|
85
|
+ //--------------------------------------------------------------------------------------
|
|
86
|
+ std::shared_ptr<DEMGrain> DEMGrain::DeSerialize ( const YAML::Node& node ) {
|
|
87
|
+ if (node.Tag() != "DEMGrain" ) {
|
|
88
|
+ throw DeSerializeTypeMismatch( "DEMGrain", node.Tag());
|
|
89
|
+ }
|
|
90
|
+ std::shared_ptr< DEMGrain > Object(new DEMGrain(node), LemmaObjectDeleter() );
|
|
91
|
+ return Object ;
|
|
92
|
+ } // ----- end of method DEMGrain::DeSerialize -----
|
|
93
|
+
|
|
94
|
+} // ---- end of namespace Lemma ----
|
|
95
|
+
|
|
96
|
+/* vim: set tabstop=4 expandtab: */
|
|
97
|
+/* vim: set filetype=cpp: */
|
|
98
|
+
|
|
99
|
+
|