Sfoglia il codice sorgente

Cleaning up yaml parts of Lemma.

enhancement_3
Trevor Irons 8 anni fa
parent
commit
6f0e4f605d

+ 0
- 4
LemmaCore/include/EarthModel.h Vedi File

@@ -32,12 +32,10 @@ namespace Lemma {
32 32
         public:
33 33
 
34 34
             // ====================  LIFECYCLE     =======================
35
-            #ifdef HAVE_YAMLCPP
36 35
             /** YAML Serializing method
37 36
              */
38 37
             YAML::Node Serialize() const;
39 38
             //static LayeredEarth* DeSerialize(const YAML::Node& node);
40
-            #endif
41 39
 
42 40
             // ====================  OPERATORS     =======================
43 41
 
@@ -99,10 +97,8 @@ namespace Lemma {
99 97
             /// Default protected constructor.
100 98
             EarthModel (const std::string& name);
101 99
 
102
-            #ifdef HAVE_YAMLCPP
103 100
             /** Deserialize constructor */
104 101
             EarthModel (const YAML::Node& node);
105
-            #endif
106 102
 
107 103
             /// Default protected constructor.
108 104
             ~EarthModel ();

+ 2
- 3
LemmaCore/include/GridReader.h Vedi File

@@ -30,9 +30,8 @@ namespace Lemma {
30 30
      */
31 31
     class GridReader : public LemmaObject {
32 32
 
33
-        friend std::ostream &operator<<(std::ostream &stream,
34
-                const GridReader &ob) {
35
-            stream << *(LemmaObject*)(&ob);
33
+        friend std::ostream &operator << (std::ostream &stream, const GridReader &ob) {
34
+            stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
36 35
             return stream;
37 36
         }
38 37
 

+ 0
- 4
LemmaCore/include/LayeredEarth.h Vedi File

@@ -80,12 +80,10 @@ namespace Lemma {
80 80
              */
81 81
 			Real GetLayerDepth(const int & lay);
82 82
 
83
-            #ifdef HAVE_YAMLCPP
84 83
             /** YAML Serializing method
85 84
              */
86 85
             YAML::Node Serialize() const;
87 86
             //static LayeredEarth* DeSerialize(const YAML::Node& node);
88
-            #endif
89 87
 
90 88
 		protected:
91 89
 
@@ -94,10 +92,8 @@ namespace Lemma {
94 92
 			/** Default protected constructor. */
95 93
 			LayeredEarth (const std::string& name);
96 94
 
97
-            #ifdef HAVE_YAMLCPP
98 95
             /** Default protected constructor. */
99 96
 			LayeredEarth (const YAML::Node& node);
100
-            #endif
101 97
 
102 98
 			/** Default protected constructor. */
103 99
 			~LayeredEarth ();

+ 11
- 20
LemmaCore/include/LemmaObject.h Vedi File

@@ -15,10 +15,7 @@
15 15
 
16 16
 #include "helper.h"
17 17
 #include "lemma.h"
18
-
19
-#ifdef HAVE_YAMLCPP
20 18
 #include "yaml-cpp/yaml.h"
21
-#endif
22 19
 
23 20
 #include <chrono>
24 21
 #include <memory>
@@ -37,13 +34,10 @@ namespace Lemma {
37 34
   */
38 35
 class LemmaObject {
39 36
 
40
-    /** Recursively prints information about this object
37
+    /**
38
+     *  Streams class information as YAML::Node
41 39
      */
42
-    friend std::ostream &operator<<(std::ostream &stream, const LemmaObject &ob);
43
-
44
-    #ifdef HAVE_YAMLCPP
45 40
     friend YAML::Emitter& operator << (YAML::Emitter& out, const LemmaObject &ob) ;
46
-    #endif
47 41
 
48 42
     friend class LemmaObjectDeleter;
49 43
 
@@ -66,7 +60,6 @@ class LemmaObject {
66 60
         /** Returns the name of the class, similiar to Python's type */
67 61
         std::string GetName() const;
68 62
 
69
-        #ifdef HAVE_YAMLCPP
70 63
         /**
71 64
          *  Uses YAML to serialize this object.
72 65
          *  @return a YAML::Node
@@ -80,12 +73,10 @@ class LemmaObject {
80 73
          */
81 74
         virtual YAML::Node Serialize() const {
82 75
             YAML::Node node = YAML::Node();
83
-
84 76
             std::time_t now = std::chrono::system_clock::to_time_t( std::chrono::system_clock::now() );
85 77
             node["Serialized"] = std::ctime(&now);
86 78
             return node;
87 79
         };
88
-        #endif
89 80
 
90 81
     protected:
91 82
 
@@ -96,10 +87,8 @@ class LemmaObject {
96 87
          */
97 88
         LemmaObject (const std::string &name);
98 89
 
99
-        #ifdef HAVE_YAMLCPP
100 90
         /** Protected DeDerializing constructor, use factory DeSerialize  method*/
101 91
         LemmaObject (const YAML::Node& node);
102
-        #endif
103 92
 
104 93
         /** Protected default destructor. This is an abstract class and
105 94
          *  cannot be instantiated.
@@ -110,6 +99,8 @@ class LemmaObject {
110 99
 
111 100
         // ====================  DATA MEMBERS  ==============================
112 101
 
102
+        static const std::string  CName;
103
+
113 104
         /** Stores an ASCII string representation of the class name */
114 105
         std::string Name;
115 106
 
@@ -121,12 +112,12 @@ class LemmaObjectDeleter
121 112
         void operator()(LemmaObject* p) { delete p; }
122 113
 };
123 114
 
124
-    /////////////////////////////////////////////////////////////////
125
-    // BOILERPLATE MACROS
126
-    #define DESERIALIZECHECK( node, Object ) { \
127
-        if (node.Tag() != Object->GetName()) {  \
128
-            throw  DeSerializeTypeMismatch(Object, node.Tag()) ; \
129
-        } } \
115
+//     /////////////////////////////////////////////////////////////////
116
+//     // BOILERPLATE MACROS
117
+//     #define DESERIALIZECHECK( node, Object ) { \
118
+//         if (node.Tag() != Object->GetName()) {  \
119
+//             throw  DeSerializeTypeMismatch(Object, node.Tag()) ; \
120
+//         } } \
130 121
 
131 122
     /////////////////////////////////////////////////////////////////
132 123
     // Error Classes
@@ -136,7 +127,7 @@ class LemmaObjectDeleter
136 127
      */
137 128
     class DeSerializeTypeMismatch : public std::runtime_error {
138 129
         public:
139
-            DeSerializeTypeMismatch(LemmaObject *ptr, const std::string& got);
130
+            DeSerializeTypeMismatch(const std::string& expected, const std::string& got);
140 131
 
141 132
     };
142 133
 

+ 0
- 6
LemmaCore/include/helper.h Vedi File

@@ -23,10 +23,7 @@
23 23
 #define  HELPER_INC
24 24
 
25 25
 #include "lemma.h"
26
-
27
-#ifdef HAVE_YAMLCPP
28 26
 #include "yaml-cpp/yaml.h"
29
-#endif
30 27
 
31 28
 namespace Lemma {
32 29
 
@@ -102,8 +99,6 @@ namespace Lemma {
102 99
 
103 100
 } // end namespace Lemma
104 101
 
105
-#ifdef HAVE_YAMLCPP
106
-
107 102
 ///////////////////////////////////////////////////////
108 103
 // YAML Serializing helper functions. Can we move this into helper.h
109 104
 namespace YAML {
@@ -271,7 +266,6 @@ struct convert<Lemma::Vector3r> {
271 266
 };
272 267
 
273 268
 }
274
-#endif //HAVE_YAMLCPP
275 269
 
276 270
 #endif   // ----- #ifndef HELPER_INC  -----
277 271
 

+ 2
- 4
LemmaCore/src/ASCIIParser.cpp Vedi File

@@ -24,10 +24,8 @@ namespace Lemma {
24 24
 
25 25
     // ====================  FRIEND METHODS  =====================
26 26
 
27
-    std::ostream &operator<<(std::ostream &stream, const ASCIIParser &ob) {
28
-
29
-        stream << *(LemmaObject*)(&ob);
30
-
27
+    std::ostream &operator << (std::ostream &stream, const ASCIIParser &ob) {
28
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
31 29
         return stream;
32 30
     }
33 31
 

+ 2
- 4
LemmaCore/src/CubicSplineInterpolator.cpp Vedi File

@@ -29,10 +29,8 @@ namespace Lemma {
29 29
 
30 30
     // ====================  FRIEND METHODS  =====================
31 31
 
32
-    std::ostream &operator<<(std::ostream &stream, const CubicSplineInterpolator &ob) {
33
-
34
-        stream << *(LemmaObject*)(&ob);
35
-
32
+    std::ostream &operator << (std::ostream &stream, const CubicSplineInterpolator &ob) {
33
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
36 34
         return stream;
37 35
     }
38 36
 

+ 4
- 5
LemmaCore/src/Data.cpp Vedi File

@@ -15,11 +15,10 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-			const Data &ob) {
20
-		stream << *(LemmaObject*)(&ob);
21
-		return stream;
22
-	}
18
+    std::ostream &operator << (std::ostream &stream, const Data &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
23 22
 
24 23
 	Data::Data(const std::string &name) : LemmaObject(name) {
25 24
 	}

+ 4
- 5
LemmaCore/src/DataReader.cpp Vedi File

@@ -15,11 +15,10 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-		const DataReader &ob) {
20
-		stream << *(LemmaObject*)(&ob);
21
-		return stream;
22
-	}
18
+    std::ostream &operator << (std::ostream &stream, const DataReader &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
23 22
 
24 23
 	DataReader::DataReader(const std::string &name) :
25 24
 			LemmaObject(name) {

+ 4
- 8
LemmaCore/src/EarthModel.cpp Vedi File

@@ -15,12 +15,10 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-				const EarthModel &ob) {
20
-
21
-		stream << *(LemmaObject*)(&ob);
22
-		return stream;
23
-	}
18
+    std::ostream &operator << (std::ostream &stream, const EarthModel &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
24 22
 
25 23
 	// ====================  LIFECYCLE     =======================
26 24
 
@@ -28,7 +26,6 @@ namespace Lemma {
28 26
 			LemmaObject(name), BField(0,0,0), BFieldUnit(0,0,0), BInc(0), BDec(0), BMag(0) {
29 27
 	}
30 28
 
31
-    #ifdef HAVE_YAMLCPP
32 29
     EarthModel::EarthModel(const YAML::Node& node) : LemmaObject(node) {
33 30
         BInc = node["BInc"].as<double>();
34 31
         BDec = node["BDec"].as<double>();
@@ -46,7 +43,6 @@ namespace Lemma {
46 43
         node["BMag"] = BMag;
47 44
         return node;
48 45
     }
49
-    #endif
50 46
 
51 47
 	EarthModel::~EarthModel() {
52 48
 	}

+ 4
- 5
LemmaCore/src/Grid.cpp Vedi File

@@ -15,12 +15,11 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-				const Grid &ob) {
18
+    std::ostream &operator << (std::ostream &stream, const Grid &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
20 22
 
21
-		stream << *(LemmaObject*)(&ob);
22
-		return stream;
23
-	}
24 23
 
25 24
 	Grid::Grid  ( const std::string& name ) : LemmaObject(name) {
26 25
 	}

+ 4
- 6
LemmaCore/src/Instrument.cpp Vedi File

@@ -15,12 +15,10 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-				const Instrument &ob) {
20
-
21
-		stream << *(LemmaObject*)(&ob);
22
-		return stream;
23
-	}
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
+    }
24 22
 
25 23
 	Instrument::Instrument(const std::string &name) :
26 24
 			LemmaObject(name) {

+ 8
- 4
LemmaCore/src/LayeredEarth.cpp Vedi File

@@ -16,14 +16,21 @@
16 16
 namespace Lemma {
17 17
 
18 18
 	// ====================    FRIENDS     ======================
19
+
20
+    /*
19 21
 	std::ostream &operator<<(std::ostream &stream,
20 22
 				const LayeredEarth &ob) {
21 23
 		stream << *(EarthModel*)(&ob);
22 24
   		//stream << "Class Name : "<< ob.Name  << "\n";
23 25
   		stream << "Number of Layers "<< ob.NumberOfLayers  << "\n";
24
-
25 26
   		return stream;
26 27
 	}
28
+    */
29
+
30
+    std::ostream &operator << (std::ostream &stream, const LayeredEarth &ob) {
31
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
32
+        return stream;
33
+    }
27 34
 
28 35
 	// ====================  LIFECYCLE     ===================================
29 36
 
@@ -37,7 +44,6 @@ namespace Lemma {
37 44
 	LayeredEarth::~LayeredEarth() {
38 45
 	}
39 46
 
40
-    #ifdef HAVE_YAMLCPP
41 47
     LayeredEarth::LayeredEarth(const YAML::Node& node) : EarthModel(node)
42 48
     {
43 49
         NumberOfLayers = node["NumberOfLayers"].as<int>();
@@ -47,14 +53,12 @@ namespace Lemma {
47 53
 
48 54
     YAML::Node LayeredEarth::Serialize() const {
49 55
         YAML::Node node = EarthModel::Serialize();
50
-
51 56
         node["NumberOfLayers"] = NumberOfLayers;
52 57
         node["NumberOfInterfaces"] = NumberOfInterfaces;
53 58
         node["LayerThickness"] = LayerThickness;
54 59
         node.SetTag( this->GetName() );
55 60
         return node;
56 61
     }
57
-    #endif
58 62
 
59 63
 	// ====================  OPERATIONS    ===================================
60 64
 

+ 3
- 11
LemmaCore/src/LemmaObject.cpp Vedi File

@@ -15,19 +15,13 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-    std::ostream &operator<<(std::ostream &stream,
19
-                const LemmaObject &ob) {
20
-      stream << "Class name= " << ob.Name  << "\n";
21
-      return stream;
22
-    }
18
+    //LemmaObject::CName = std::string("LemmaObject");
23 19
 
24
-    #ifdef HAVE_YAMLCPP
25 20
     YAML::Emitter& operator << (YAML::Emitter& out, const LemmaObject& ob) {
26 21
         out << YAML::BeginMap;
27 22
         out << YAML::Key <<"Class Name"    << YAML::Value << ob.GetName();
28 23
         return out;
29 24
     }
30
-    #endif
31 25
 
32 26
     // ====================  LIFECYCLE     ==============================
33 27
 
@@ -35,10 +29,8 @@ namespace Lemma {
35 29
     LemmaObject::LemmaObject(const std::string& name) : Name(name) {
36 30
     }
37 31
 
38
-    #ifdef HAVE_YAMLCPP
39 32
     LemmaObject::LemmaObject(const YAML::Node &node) : Name(node.Tag()) {
40 33
     }
41
-    #endif
42 34
 
43 35
     // Destructor
44 36
     LemmaObject::~LemmaObject() {
@@ -61,9 +53,9 @@ namespace Lemma {
61 53
     //////////////////////////////////////////////////////////////////////
62 54
     //////////////////////////////////////////////////////////////////////
63 55
 
64
-    DeSerializeTypeMismatch::DeSerializeTypeMismatch(LemmaObject *ptr, const std::string& got) :
56
+    DeSerializeTypeMismatch::DeSerializeTypeMismatch(const std::string& expected, const std::string& got) :
65 57
         runtime_error("DESERIALIZE TYPE MISMATCH") {
66
-            std::cerr << "Expected " << ptr->GetName() << " got " << got << std::endl;
58
+            std::cerr << "Expected " << expected << " got " << got << std::endl;
67 59
         }
68 60
 
69 61
     RequestToReturnNullPointer::

+ 6
- 2
LemmaCore/src/RectilinearGrid.cpp Vedi File

@@ -15,12 +15,15 @@
15 15
 
16 16
 namespace Lemma {
17 17
 
18
+    std::ostream &operator << (std::ostream &stream, const RectilinearGrid &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
20
+        return stream;
21
+    }
18 22
 
23
+    /*
19 24
 	std::ostream &operator<<(std::ostream &stream, const
20 25
 	    RectilinearGrid &ob) {
21
-
22 26
 		stream << *(LemmaObject*)(&ob);
23
-
24 27
         stream << "\tnx=" << ob.nx << "\tny=" << ob.ny << "\tnz=" << ob.nz << std::endl;
25 28
         stream << "\tox=" << ob.ox << "\toy=" << ob.oy << "\toz=" << ob.oz << std::endl;
26 29
         stream << "\tdx=" << ob.dx.transpose() << std::endl;
@@ -28,6 +31,7 @@ namespace Lemma {
28 31
         stream << "\tdz=" << ob.dz.transpose() << std::endl;
29 32
 		return stream;
30 33
 	}
34
+    */
31 35
 
32 36
     // ====================  LIFECYCLE     =======================
33 37
 

+ 2
- 4
LemmaCore/src/RectilinearGridReader.cpp Vedi File

@@ -21,10 +21,8 @@ namespace Lemma {
21 21
 
22 22
     // ====================  FRIEND METHODS  =====================
23 23
 
24
-    std::ostream &operator<<(std::ostream &stream, const RectilinearGridReader &ob) {
25
-
26
-        stream << *(GridReader*)(&ob);
27
-
24
+    std::ostream &operator << (std::ostream &stream, const RectilinearGridReader &ob) {
25
+        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
28 26
         return stream;
29 27
     }
30 28
 

+ 3
- 2
LemmaCore/src/RectilinearGridVTKExporter.cpp Vedi File

@@ -25,11 +25,12 @@ namespace Lemma {
25 25
 
26 26
 // ====================  FRIEND METHODS  =====================
27 27
 
28
-std::ostream &operator<<(std::ostream &stream, const RectilinearGridVTKExporter &ob) {
29
-    stream << *(LemmaObject*)(&ob);
28
+std::ostream &operator << (std::ostream &stream, const RectilinearGridVTKExporter &ob) {
29
+    stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
30 30
     return stream;
31 31
 }
32 32
 
33
+
33 34
 // ====================  LIFECYCLE     =======================
34 35
 
35 36
 //--------------------------------------------------------------------------------------

+ 21
- 0
vim/c.vim Vedi File

@@ -0,0 +1,21 @@
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
21
+

+ 675
- 0
vim/cpp.cpp.template Vedi File

@@ -0,0 +1,675 @@
1
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
+$
3
+== cpp.cin ==
4
+cin	>> <CURSOR>;
5
+$
6
+== cpp.cout-variabe ==
7
+cout	<< <CURSOR> << endl;
8
+$
9
+== cpp.cout-string ==
10
+cout	<< "<CURSOR>\n";
11
+$
12
+== cpp.cout-operator == insert ==
13
+<< "<CURSOR>"
14
+$
15
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
+== cpp.output-manipulator-boolalpha       == insert ==
17
+<< boolalpha <CURSOR>
18
+== cpp.output-manipulator-dec             == insert ==
19
+<< dec <CURSOR>
20
+== cpp.output-manipulator-endl            == insert ==
21
+<< endl <CURSOR>
22
+== cpp.output-manipulator-fixed           == insert ==
23
+<< fixed <CURSOR>
24
+== cpp.output-manipulator-flush           == insert ==
25
+<< flush <CURSOR>
26
+== cpp.output-manipulator-hex             == insert ==
27
+<< hex <CURSOR>
28
+== cpp.output-manipulator-internal        == insert ==
29
+<< internal <CURSOR>
30
+== cpp.output-manipulator-left            == insert ==
31
+<< left <CURSOR>
32
+== cpp.output-manipulator-oct             == insert ==
33
+<< oct <CURSOR>
34
+== cpp.output-manipulator-right           == insert ==
35
+<< right <CURSOR>
36
+== cpp.output-manipulator-scientific      == insert ==
37
+<< scientific <CURSOR>
38
+== cpp.output-manipulator-setbase         == insert ==
39
+<< setbase(10<CURSOR>)
40
+== cpp.output-manipulator-setfill         == insert ==
41
+<< setfill(<CURSOR>)
42
+== cpp.output-manipulator-setiosflag      == insert ==
43
+<< setiosflags(<CURSOR>)
44
+== cpp.output-manipulator-setprecision    == insert ==
45
+<< setprecision(6<CURSOR>)
46
+== cpp.output-manipulator-setw            == insert ==
47
+<< setw(0<CURSOR>)
48
+== cpp.output-manipulator-showbase        == insert ==
49
+<< showbase <CURSOR>
50
+== cpp.output-manipulator-showpoint       == insert ==
51
+<< showpoint <CURSOR>
52
+== cpp.output-manipulator-showpos         == insert ==
53
+<< showpos <CURSOR>
54
+== cpp.output-manipulator-uppercase       == insert ==
55
+<< uppercase <CURSOR>
56
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
+== cpp.method-implementation ==
58
+//--------------------------------------------------------------------------------------
59
+//       Class:  |?CLASSNAME|
60
+//      Method:  |?METHODNAME|
61
+//--------------------------------------------------------------------------------------
62
+<CURSOR>void |CLASSNAME|::|METHODNAME| (  ) {
63
+    return ;
64
+}		// -----  end of method |CLASSNAME|::|METHODNAME|  -----
65
+
66
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
+== cpp.accessor-implementation ==
68
+//--------------------------------------------------------------------------------------
69
+//       Class:  |?CLASSNAME|
70
+//      Method:  get_|?ATTRIBUTE|
71
+//--------------------------------------------------------------------------------------
72
+inline <CURSOR>int |CLASSNAME|::get_|ATTRIBUTE| (  ) {
73
+	return |ATTRIBUTE|;
74
+}		// -----  end of method |CLASSNAME|::get_|ATTRIBUTE|  -----
75
+
76
+//--------------------------------------------------------------------------------------
77
+//       Class:  |CLASSNAME|
78
+//      Method:  set_|ATTRIBUTE|
79
+//--------------------------------------------------------------------------------------
80
+inline void |CLASSNAME|::set_|ATTRIBUTE| ( int value ) {
81
+	|ATTRIBUTE|	= value;
82
+	return ;
83
+}		// -----  end of method |CLASSNAME|::set_|ATTRIBUTE|  -----
84
+
85
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86
+== cpp.class-definition ==
87
+/**
88
+   \brief  <CURSOR>
89
+   \details
90
+ */
91
+class |?CLASSNAME:c| : public |?BASECLASS:c| {
92
+
93
+// ====================  LIFECYCLE     =======================
94
+
95
+/** Default constructor */
96
+|CLASSNAME| ( );
97
+
98
+/** Default destructor */
99
+~|CLASSNAME| ();
100
+
101
+// ====================  OPERATORS     =======================
102
+
103
+// ====================  OPERATIONS    =======================
104
+
105
+// ====================  ACCESS        =======================
106
+
107
+// ====================  INQUIRY       =======================
108
+
109
+protected:
110
+
111
+// ====================  DATA MEMBERS  =========================
112
+
113
+private:
114
+
115
+}; // -----  end of class  |CLASSNAME|  -----
116
+
117
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118
+== cpp.class-definitionLemma ==
119
+#pragma once
120
+#include "|?BASECLASS|.h"
121
+
122
+namespace Lemma {
123
+
124
+/**
125
+   \brief  <CURSOR>
126
+   \details
127
+ */
128
+class |?CLASSNAME:c| : public |BASECLASS:c| {
129
+
130
+	friend std::ostream &operator<<(std::ostream &stream, const |CLASSNAME| &ob);
131
+
132
+	public:
133
+
134
+	    // ====================  LIFECYCLE     =======================
135
+
136
+        /*
137
+         *  Factory method for generating concrete class.
138
+         *  @return a std::shared_ptr of type |CLASSNAME|
139
+         */
140
+	    static std::shared_ptr< |CLASSNAME| > NewSP();
141
+
142
+        /**
143
+         *  Uses YAML to serialize this object.
144
+         *  @return a YAML::Node
145
+         *   @see |CLASSNAME|::DeSerialize
146
+         */
147
+        YAML::Node Serialize() const;
148
+
149
+        /**
150
+         *   Constructs an |CLASSNAME| object from a YAML::Node.
151
+         *   @see |CLASSNAME|::Serialize
152
+         */
153
+        static std::shared_ptr<|CLASSNAME|> DeSerialize(const YAML::Node& node);
154
+
155
+        // ====================  OPERATORS     =======================
156
+
157
+        // ====================  OPERATIONS    =======================
158
+
159
+        // ====================  ACCESS        =======================
160
+
161
+        // ====================  INQUIRY       =======================
162
+
163
+
164
+
165
+    protected:
166
+
167
+        // ====================  LIFECYCLE     =======================
168
+
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  =========================
185
+
186
+    private:
187
+
188
+}; // -----  end of class  |CLASSNAME|  -----
189
+}  // -----  end of namespace Lemma ----
190
+
191
+/* vim: set tabstop=4 expandtab: */
192
+/* vim: set filetype=cpp: */
193
+
194
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195
+== cpp.class-definitionLemmaAbstract ==
196
+/**
197
+   \brief  <CURSOR>
198
+   \details
199
+ */
200
+class |?CLASSNAME:c| : public |?BASECLASS:c| {
201
+
202
+    friend std::ostream &operator<<(std::ostream &stream,
203
+            const |CLASSNAME| &ob) {
204
+        stream << *(|BASECLASS|*)(&ob);
205
+        return stream;
206
+    }
207
+
208
+    public:
209
+
210
+// ====================  LIFECYCLE     =======================
211
+
212
+// ====================  OPERATORS     =======================
213
+
214
+// ====================  OPERATIONS    =======================
215
+virtual void APIDemo()=0; // REMEMBER TO MAKE PURE VIRTUAL DUMMY
216
+
217
+// ====================  ACCESS        =======================
218
+
219
+// ====================  INQUIRY       =======================
220
+
221
+protected:
222
+
223
+// ====================  LIFECYCLE     =======================
224
+
225
+/** Default protected constructor, abstract class this cannot be called */
226
+|CLASSNAME| (const std::string& name);
227
+
228
+/** Default protected destructor, this is an abstract class, this cannot be called */
229
+~|CLASSNAME| ();
230
+
231
+// ====================  DATA MEMBERS  =========================
232
+
233
+private:
234
+
235
+}; // -----  end of class  |CLASSNAME|  -----
236
+
237
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238
+== cpp.class-implementationLemma ==
239
+#include "|?CLASSNAME|.h"
240
+
241
+namespace Lemma {
242
+
243
+// ====================  FRIEND METHODS  =====================
244
+
245
+std::ostream &operator << (std::ostream &stream, const |CLASSNAME| &ob) {
246
+    stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
247
+    return stream;
248
+}
249
+
250
+// ====================  LIFECYCLE     =======================
251
+
252
+//--------------------------------------------------------------------------------------
253
+//       Class:  |CLASSNAME|
254
+//      Method:  |CLASSNAME|
255
+// Description:  constructor (protected)
256
+//--------------------------------------------------------------------------------------
257
+|CLASSNAME|::|CLASSNAME| (const std::string& name) : |?BASECLASS|(name) {
258
+
259
+}  // -----  end of method |CLASSNAME|::|CLASSNAME|  (constructor)  -----
260
+
261
+//--------------------------------------------------------------------------------------
262
+//       Class:  |CLASSNAME|
263
+//      Method:  |CLASSNAME|
264
+// Description:  DeSerializing constructor (protected)
265
+//--------------------------------------------------------------------------------------
266
+|CLASSNAME|::|CLASSNAME| (const YAML::Node& node) : |BASECLASS|(node) {
267
+
268
+}  // -----  end of method |CLASSNAME|::|CLASSNAME|  (constructor)  -----
269
+
270
+//--------------------------------------------------------------------------------------
271
+//       Class:  |CLASSNAME|
272
+//      Method:  NewSP()
273
+// Description:  public constructor returing a shared_ptr
274
+//--------------------------------------------------------------------------------------
275
+std::shared_ptr< |CLASSNAME| >  |CLASSNAME|::NewSP() {
276
+    std::shared_ptr< |CLASSNAME| > sp(new  |CLASSNAME|("|CLASSNAME|"), LemmaObjectDeleter() );
277
+    return sp;
278
+}
279
+
280
+//--------------------------------------------------------------------------------------
281
+//       Class:  |CLASSNAME|
282
+//      Method:  ~|CLASSNAME|
283
+// Description:  destructor (protected)
284
+//--------------------------------------------------------------------------------------
285
+|CLASSNAME|::~|CLASSNAME| () {
286
+
287
+}  // -----  end of method |CLASSNAME|::~|CLASSNAME|  (destructor)  -----
288
+
289
+//--------------------------------------------------------------------------------------
290
+//       Class:  |CLASSNAME|
291
+//      Method:  Serialize
292
+//--------------------------------------------------------------------------------------
293
+YAML::Node  |CLASSNAME|::Serialize (  ) const {
294
+    YAML::Node node = |BASECLASS|::Serialize();
295
+    node.SetTag( GetName() );
296
+    // FILL IN CLASS SPECIFICS HERE
297
+    return node;
298
+}		// -----  end of method |CLASSNAME|::Serialize  -----
299
+
300
+//--------------------------------------------------------------------------------------
301
+//       Class:  |CLASSNAME|
302
+//      Method:  DeSerialize
303
+//--------------------------------------------------------------------------------------
304
+std::shared_ptr<|CLASSNAME|> |CLASSNAME|::DeSerialize ( const YAML::Node& node  ) {
305
+    if (node.Tag() !=  "|CLASSNAME|" ) {
306
+        throw  DeSerializeTypeMismatch( "|CLASSNAME|", node.Tag());
307
+    }
308
+    std::shared_ptr< |CLASSNAME| > Object(new |CLASSNAME|(node), LemmaObjectDeleter() );
309
+    return Object ;
310
+}		// -----  end of method |CLASSNAME|::DeSerialize  -----
311
+
312
+} // ----  end of namespace Lemma  ----
313
+
314
+/* vim: set tabstop=4 expandtab: */
315
+/* vim: set filetype=cpp: */
316
+
317
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318
+== cpp.class-implementation ==
319
+
320
+// ====================  LIFECYCLE     =======================
321
+
322
+//--------------------------------------------------------------------------------------
323
+//       Class:  |CLASSNAME|
324
+//      Method:  |CLASSNAME|
325
+// Description:  constructor (protected)
326
+//--------------------------------------------------------------------------------------
327
+|CLASSNAME|::|CLASSNAME| ( ) : |BASECLASS|(name) {
328
+
329
+}  // -----  end of method |CLASSNAME|::|CLASSNAME|  (constructor)  -----
330
+
331
+//--------------------------------------------------------------------------------------
332
+//       Class:  |CLASSNAME|
333
+//      Method:  ~|CLASSNAME|
334
+// Description:  destructor
335
+//--------------------------------------------------------------------------------------
336
+|CLASSNAME|::~|CLASSNAME| () {
337
+<CURSOR>
338
+}  // -----  end of method |CLASSNAME|::~|CLASSNAME|  (destructor)  -----
339
+
340
+
341
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
342
+== cpp.class-using-new-definition ==
343
+// =====================================================================================
344
+//        Class:  |?CLASSNAME:c|
345
+//  Description:  <CURSOR>
346
+// =====================================================================================
347
+class |CLASSNAME|
348
+{
349
+  public:
350
+
351
+    // ====================  LIFECYCLE     =======================================
352
+    |CLASSNAME| ();                             // constructor
353
+    |CLASSNAME| ( const |CLASSNAME| &other );   // copy constructor
354
+    ~|CLASSNAME| ();                            // destructor
355
+
356
+    // ====================  OPERATORS     =======================================
357
+    const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
358
+
359
+    // ====================  OPERATIONS    =======================================
360
+
361
+    // ====================  ACCESS        =======================================
362
+
363
+    // ====================  INQUIRY       =======================================
364
+
365
+    // ====================  DATA MEMBERS  =======================================
366
+  protected:
367
+
368
+  private:
369
+
370
+}; // -----  end of class  |CLASSNAME|  -----
371
+
372
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373
+== cpp.class-using-new-implementation ==
374
+//--------------------------------------------------------------------------------------
375
+//       Class:  |?CLASSNAME|
376
+//      Method:  |CLASSNAME|
377
+// Description:  constructor
378
+//--------------------------------------------------------------------------------------
379
+|CLASSNAME|::|CLASSNAME| ()
380
+{
381
+}  // -----  end of method |CLASSNAME|::|CLASSNAME|  (constructor)  -----
382
+
383
+//--------------------------------------------------------------------------------------
384
+//       Class:  |CLASSNAME|
385
+//      Method:  |CLASSNAME|
386
+// Description:  copy constructor
387
+//--------------------------------------------------------------------------------------
388
+|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other )
389
+{
390
+}  // -----  end of method |CLASSNAME|::|CLASSNAME|  (copy constructor)  -----
391
+
392
+//--------------------------------------------------------------------------------------
393
+//       Class:  |CLASSNAME|
394
+//      Method:  ~|CLASSNAME|
395
+// Description:  destructor
396
+//--------------------------------------------------------------------------------------
397
+|CLASSNAME|::~|CLASSNAME| ()
398
+{
399
+}  // -----  end of method |CLASSNAME|::~|CLASSNAME|  (destructor)  -----
400
+
401
+//--------------------------------------------------------------------------------------
402
+//       Class:  |CLASSNAME|
403
+//      Method:  operator =
404
+// Description:  assignment operator
405
+//--------------------------------------------------------------------------------------
406
+const |CLASSNAME|&
407
+|CLASSNAME|::operator = ( const |CLASSNAME| &other )
408
+{
409
+  if ( this != &other ) {
410
+  }
411
+  return *this;
412
+}  // -----  end of method |CLASSNAME|::operator =  (assignment operator)  -----
413
+
414
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
415
+== cpp.error-class ==
416
+// =====================================================================================
417
+//        Class:  |?CLASSNAME:c|
418
+//  Description:  <CURSOR>
419
+// =====================================================================================
420
+class |CLASSNAME|
421
+{
422
+  public:     |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg)  { }
423
+              virtual ~|CLASSNAME| ( )  { }
424
+              virtual string what ( ) const throw ( )  { return message; }
425
+  protected:  string  message;
426
+}; // ----------  end of class  |CLASSNAME|  ----------
427
+
428
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429
+== cpp.template-method-implementation ==
430
+template < class T >
431
+void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| (  )
432
+{
433
+	return ;
434
+}		// -----  end of method |CLASSNAME|<T>::|METHODNAME|  -----
435
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
436
+== cpp.template-accessor-implementation ==
437
+//--------------------------------------------------------------------------------------
438
+//       Class:  |?CLASSNAME|
439
+//      Method:  get_|?ATTRIBUTE|
440
+//--------------------------------------------------------------------------------------
441
+template < class T >
442
+inline  <CURSOR>int |CLASSNAME|<T>::get_|ATTRIBUTE| (  )
443
+{
444
+	return |ATTRIBUTE|;
445
+}		// -----  end of method |CLASSNAME|<T>::get_|ATTRIBUTE|  -----
446
+
447
+//--------------------------------------------------------------------------------------
448
+//       Class:  |CLASSNAME|
449
+//      Method:  set_|ATTRIBUTE|
450
+//--------------------------------------------------------------------------------------
451
+template < class T >
452
+inline  void |CLASSNAME|<T>::set_|ATTRIBUTE| ( int value )
453
+{
454
+	|ATTRIBUTE|	= value;
455
+	return ;
456
+}		// -----  end of method |CLASSNAME|<T>::set_|ATTRIBUTE|  -----
457
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
458
+== cpp.template-class-definition ==
459
+// =====================================================================================
460
+//        Class:  |?CLASSNAME:c|
461
+//  Description:  <CURSOR>
462
+// =====================================================================================
463
+
464
+template < class T >
465
+class |CLASSNAME|
466
+{
467
+  public:
468
+
469
+    // ====================  LIFECYCLE     =======================================
470
+    |CLASSNAME| ();                             // constructor
471
+
472
+    // ====================  OPERATORS     =======================================
473
+
474
+    // ====================  OPERATIONS    =======================================
475
+
476
+    // ====================  ACCESS        =======================================
477
+
478
+    // ====================  INQUIRY       =======================================
479
+
480
+    // ====================  DATA MEMBERS  =======================================
481
+  protected:
482
+
483
+  private:
484
+
485
+}; // -----  end of template class  |CLASSNAME|  -----
486
+
487
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488
+== cpp.template-class-implementation ==
489
+//--------------------------------------------------------------------------------------
490
+//       Class:  |?CLASSNAME|
491
+//      Method:  |CLASSNAME|
492
+// Description:  constructor
493
+//--------------------------------------------------------------------------------------
494
+template < class T >
495
+|CLASSNAME| <T>:: |CLASSNAME| ()
496
+{
497
+}  // -----  end of constructor of template class |CLASSNAME|  -----
498
+
499
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
500
+== cpp.template-class-using-new-definition ==
501
+// =====================================================================================
502
+//        Class:  |?CLASSNAME:c|
503
+//  Description:  <CURSOR>
504
+// =====================================================================================
505
+
506
+template < class T >
507
+class |CLASSNAME|
508
+{
509
+  public:
510
+
511
+    // ====================  LIFECYCLE     =======================================
512
+    |CLASSNAME| ();                           // constructor
513
+    |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor
514
+    ~|CLASSNAME| ();                          // destructor
515
+
516
+    // ====================  OPERATORS     =======================================
517
+
518
+    const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
519
+
520
+    // ====================  OPERATIONS    =======================================
521
+
522
+    // ====================  ACCESS        =======================================
523
+
524
+    // ====================  INQUIRY       =======================================
525
+
526
+    // ====================  DATA MEMBERS  =======================================
527
+  protected:
528
+
529
+  private:
530
+
531
+}; // -----  end of template class  |CLASSNAME|  -----
532
+
533
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
534
+== cpp.template-class-using-new-implementation ==
535
+//--------------------------------------------------------------------------------------
536
+//       Class:  |?CLASSNAME|
537
+//      Method:  |CLASSNAME|
538
+// Description:  constructor
539
+//--------------------------------------------------------------------------------------
540
+template < class T >
541
+|CLASSNAME|<T>::|CLASSNAME| ()
542
+{
543
+}  // -----  end of constructor of template class |CLASSNAME|  -----
544
+
545
+//--------------------------------------------------------------------------------------
546
+//       Class:  |CLASSNAME|
547
+//      Method:  |CLASSNAME|
548
+// Description:  copy constructor
549
+//--------------------------------------------------------------------------------------
550
+template < class T >
551
+|CLASSNAME|<T>::|CLASSNAME| ( const |CLASSNAME| &other )
552
+{
553
+}  // -----  end of copy constructor of template class |CLASSNAME|  -----
554
+
555
+//--------------------------------------------------------------------------------------
556
+//       Class:  |CLASSNAME|
557
+//      Method:  ~|CLASSNAME|
558
+// Description:  destructor
559
+//--------------------------------------------------------------------------------------
560
+template < class T >
561
+|CLASSNAME|<T>::~|CLASSNAME| ()
562
+{
563
+}  // -----  end of destructor of template class |CLASSNAME|  -----
564
+
565
+//--------------------------------------------------------------------------------------
566
+//       Class:  |CLASSNAME|
567
+//      Method:  operator =
568
+// Description:  assignment operator
569
+//--------------------------------------------------------------------------------------
570
+template < class T >
571
+const |CLASSNAME|<T>& |CLASSNAME|<T>::operator = ( const |CLASSNAME| &other )
572
+{
573
+  if ( this != &other ) {
574
+  }
575
+  return *this;
576
+}  // -----  end of assignment operator of template class |CLASSNAME|  -----
577
+
578
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
579
+== cpp.template-function ==
580
+template <class T>
581
+<CURSOR>void |?TEMPALTE_FUNCTION_NAME| ( T param )
582
+{
583
+	return ;
584
+}		// -----  end of template function |?TEMPALTE_FUNCTION_NAME|  -----
585
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586
+== cpp.operator-in ==
587
+ostream &
588
+operator << ( ostream & os, const |?CLASSNAME| & obj )
589
+{
590
+	os << obj.<CURSOR> ;
591
+	return os;
592
+}		// -----  end of function operator <<  -----
593
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
594
+== cpp.operator-out ==
595
+istream &
596
+operator >> ( istream & is, |?CLASSNAME| & obj )
597
+{
598
+	is >> obj.<CURSOR> ;
599
+	return is;
600
+}		// -----  end of function operator >>  -----
601
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
602
+== cpp.try-catch ==
603
+try {
604
+<SPLIT>}
605
+catch ( const <CURSOR> &ExceptObj ) {		// handle exception:
606
+}
607
+catch (...) {		// handle exception: unspezified
608
+}
609
+
610
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
611
+== cpp.catch ==
612
+catch ( <CURSOR>const &ExceptObj ) {		// handle exception:
613
+<SPLIT>}
614
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
615
+== cpp.catch-points ==
616
+catch (...) {		// handle exception:
617
+<SPLIT>}
618
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
619
+== cpp.extern ==
620
+extern "C" {<CURSOR>
621
+<SPLIT>}
622
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
623
+== cpp.open-input-file ==
624
+string    ifs_file_name = "<CURSOR>";                 // input  file name
625
+ifstream  ifs;                                // create ifstream object
626
+
627
+ifs.open ( ifs_file_name.c_str() );           // open ifstream
628
+if (!ifs) {
629
+	cerr << "\nERROR : failed to open input  file " << ifs_file_name << endl;
630
+	exit (EXIT_FAILURE);
631
+}
632
+
633
+
634
+ifs.close ();                                 // close ifstream
635
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
636
+== cpp.open-output-file ==
637
+string    ofs_file_name = "<CURSOR>";                 // input  file name
638
+ofstream  ofs;                                // create ofstream object
639
+
640
+ofs.open ( ofs_file_name.c_str() );           // open ofstream
641
+if (!ofs) {
642
+	cerr << "\nERROR : failed to open output file " << ofs_file_name << endl;
643
+	exit (EXIT_FAILURE);
644
+}
645
+
646
+
647
+ofs.close ();                                 // close ofstream
648
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
649
+== cpp.namespace-std ==
650
+using namespace std;
651
+== cpp.namespace ==
652
+using namespace |?NAMESPACE|;
653
+== cpp.namespace-block ==
654
+namespace |?NAMESPACE| {
655
+<CURSOR>
656
+<SPLIT>}		// -----  end of |NAMESPACE|  name  -----
657
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
658
+== cpp.rtti-typeid == insert ==
659
+typeid(<CURSOR><SPLIT>)
660
+$
661
+== cpp.rtti-static-cast == insert ==
662
+static_cast<>(<CURSOR><SPLIT>)
663
+$
664
+== cpp.rtti-const-cast == insert ==
665
+const_cast<>(<CURSOR><SPLIT>)
666
+$
667
+== cpp.rtti-reinterpret-cast == insert ==
668
+reinterpret_cast<>(<CURSOR><SPLIT>)
669
+$
670
+== cpp.rtti-dynamic-cast == insert ==
671
+dynamic_cast<>(<CURSOR><SPLIT>)
672
+$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
673
+
674
+/* vim: set tabstop=4 expandtab: */
675
+/* vim: set filetype=cpp: */

Loading…
Annulla
Salva