Lemma is an Electromagnetics API
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

cpp.cpp.template 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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. == cpp.accessor-implementation ==
  67. //--------------------------------------------------------------------------------------
  68. // Class: |?CLASSNAME|
  69. // Method: get_|?ATTRIBUTE|
  70. //--------------------------------------------------------------------------------------
  71. inline <CURSOR>int |CLASSNAME|::get_|ATTRIBUTE| ( ) {
  72. return |ATTRIBUTE|;
  73. } // ----- end of method |CLASSNAME|::get_|ATTRIBUTE| -----
  74. //--------------------------------------------------------------------------------------
  75. // Class: |CLASSNAME|
  76. // Method: set_|ATTRIBUTE|
  77. //--------------------------------------------------------------------------------------
  78. inline void |CLASSNAME|::set_|ATTRIBUTE| ( int value ) {
  79. |ATTRIBUTE| = value;
  80. return ;
  81. } // ----- end of method |CLASSNAME|::set_|ATTRIBUTE| -----
  82. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  83. == cpp.class-definition ==
  84. /**
  85. \brief <CURSOR>
  86. \details
  87. */
  88. class |?CLASSNAME:c| : public |?BASECLASS:c| {
  89. // ==================== LIFECYCLE =======================
  90. /** Default constructor */
  91. |CLASSNAME| ( );
  92. /** Default destructor */
  93. ~|CLASSNAME| ();
  94. // ==================== OPERATORS =======================
  95. // ==================== OPERATIONS =======================
  96. // ==================== ACCESS =======================
  97. // ==================== INQUIRY =======================
  98. protected:
  99. // ==================== DATA MEMBERS =========================
  100. private:
  101. }; // ----- end of class |CLASSNAME| -----
  102. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  103. == cpp.class-definitionLemma ==
  104. #pragma once
  105. #include "|?BASECLASS|.h"
  106. namespace Lemma {
  107. /**
  108. \brief <CURSOR>
  109. \details
  110. */
  111. class |?CLASSNAME:c| : public |BASECLASS:c| {
  112. friend std::ostream &operator<<(std::ostream &stream, const |CLASSNAME| &ob);
  113. public:
  114. // ==================== LIFECYCLE =======================
  115. /*
  116. * Factory method for generating concrete class.
  117. * @return a std::shared_ptr of type |CLASSNAME|
  118. */
  119. static std::shared_ptr< |CLASSNAME| > NewSP();
  120. /**
  121. * Uses YAML to serialize this object.
  122. * @return a YAML::Node
  123. * @see |CLASSNAME|::DeSerialize
  124. */
  125. YAML::Node Serialize() const;
  126. /**
  127. * Constructs an |CLASSNAME| object from a YAML::Node.
  128. * @see |CLASSNAME|::Serialize
  129. */
  130. static std::shared_ptr<|CLASSNAME|> DeSerialize(const YAML::Node& node);
  131. // ==================== OPERATORS =======================
  132. // ==================== OPERATIONS =======================
  133. // ==================== ACCESS =======================
  134. // ==================== INQUIRY =======================
  135. protected:
  136. // ==================== LIFECYCLE =======================
  137. /**
  138. * Default protected constructor, use NewSP methods to construct
  139. * @see |CLASSNAME|::NewSP
  140. */
  141. |CLASSNAME| (const std::string& name);
  142. /**
  143. * Protected DeDerializing constructor, use factory DeSerialize method.
  144. * @see |CLASSNAME|::DeSerialize
  145. */
  146. |CLASSNAME| (const YAML::Node& node);
  147. /** Default protected destructor, use smart pointers (std::shared_ptr) */
  148. ~|CLASSNAME| ();
  149. // ==================== DATA MEMBERS =========================
  150. private:
  151. }; // ----- end of class |CLASSNAME| -----
  152. } // ----- end of namespace Lemma ----
  153. /* vim: set tabstop=4 expandtab: */
  154. /* vim: set filetype=cpp: */
  155. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  156. == cpp.class-definitionLemmaAbstract ==
  157. /**
  158. \brief <CURSOR>
  159. \details
  160. */
  161. class |?CLASSNAME:c| : public |?BASECLASS:c| {
  162. friend std::ostream &operator<<(std::ostream &stream,
  163. const |CLASSNAME| &ob) {
  164. stream << *(|BASECLASS|*)(&ob);
  165. return stream;
  166. }
  167. public:
  168. // ==================== LIFECYCLE =======================
  169. // ==================== OPERATORS =======================
  170. // ==================== OPERATIONS =======================
  171. virtual void APIDemo()=0; // REMEMBER TO MAKE PURE VIRTUAL DUMMY
  172. // ==================== ACCESS =======================
  173. // ==================== INQUIRY =======================
  174. protected:
  175. // ==================== LIFECYCLE =======================
  176. /** Default protected constructor, abstract class this cannot be called */
  177. |CLASSNAME| (const std::string& name);
  178. /** Default protected destructor, this is an abstract class, this cannot be called */
  179. ~|CLASSNAME| ();
  180. // ==================== DATA MEMBERS =========================
  181. private:
  182. }; // ----- end of class |CLASSNAME| -----
  183. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  184. == cpp.class-implementationLemma ==
  185. #include "|?CLASSNAME|.h"
  186. namespace Lemma {
  187. // ==================== FRIEND METHODS =====================
  188. std::ostream &operator << (std::ostream &stream, const |CLASSNAME| &ob) {
  189. stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
  190. return stream;
  191. }
  192. // ==================== LIFECYCLE =======================
  193. //--------------------------------------------------------------------------------------
  194. // Class: |CLASSNAME|
  195. // Method: |CLASSNAME|
  196. // Description: constructor (protected)
  197. //--------------------------------------------------------------------------------------
  198. |CLASSNAME|::|CLASSNAME| (const std::string& name) : |?BASECLASS|(name) {
  199. } // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
  200. //--------------------------------------------------------------------------------------
  201. // Class: |CLASSNAME|
  202. // Method: |CLASSNAME|
  203. // Description: DeSerializing constructor (protected)
  204. //--------------------------------------------------------------------------------------
  205. |CLASSNAME|::|CLASSNAME| (const YAML::Node& node) : |BASECLASS|(node) {
  206. } // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
  207. //--------------------------------------------------------------------------------------
  208. // Class: |CLASSNAME|
  209. // Method: NewSP()
  210. // Description: public constructor returing a shared_ptr
  211. //--------------------------------------------------------------------------------------
  212. std::shared_ptr< |CLASSNAME| > |CLASSNAME|::NewSP() {
  213. std::shared_ptr< |CLASSNAME| > sp(new |CLASSNAME|("|CLASSNAME|"), LemmaObjectDeleter() );
  214. return sp;
  215. }
  216. //--------------------------------------------------------------------------------------
  217. // Class: |CLASSNAME|
  218. // Method: ~|CLASSNAME|
  219. // Description: destructor (protected)
  220. //--------------------------------------------------------------------------------------
  221. |CLASSNAME|::~|CLASSNAME| () {
  222. } // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) -----
  223. //--------------------------------------------------------------------------------------
  224. // Class: |CLASSNAME|
  225. // Method: Serialize
  226. //--------------------------------------------------------------------------------------
  227. YAML::Node |CLASSNAME|::Serialize ( ) const {
  228. YAML::Node node = |BASECLASS|::Serialize();
  229. node.SetTag( GetName() );
  230. // FILL IN CLASS SPECIFICS HERE
  231. return node;
  232. } // ----- end of method |CLASSNAME|::Serialize -----
  233. //--------------------------------------------------------------------------------------
  234. // Class: |CLASSNAME|
  235. // Method: DeSerialize
  236. //--------------------------------------------------------------------------------------
  237. std::shared_ptr<|CLASSNAME|> |CLASSNAME|::DeSerialize ( const YAML::Node& node ) {
  238. if (node.Tag() != "|CLASSNAME|" ) {
  239. throw DeSerializeTypeMismatch( "|CLASSNAME|", node.Tag());
  240. }
  241. std::shared_ptr< |CLASSNAME| > Object(new |CLASSNAME|(node), LemmaObjectDeleter() );
  242. return Object ;
  243. } // ----- end of method |CLASSNAME|::DeSerialize -----
  244. } // ---- end of namespace Lemma ----
  245. /* vim: set tabstop=4 expandtab: */
  246. /* vim: set filetype=cpp: */
  247. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  248. == cpp.class-implementation ==
  249. // ==================== LIFECYCLE =======================
  250. //--------------------------------------------------------------------------------------
  251. // Class: |CLASSNAME|
  252. // Method: |CLASSNAME|
  253. // Description: constructor (protected)
  254. //--------------------------------------------------------------------------------------
  255. |CLASSNAME|::|CLASSNAME| ( ) : |BASECLASS|(name) {
  256. } // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
  257. //--------------------------------------------------------------------------------------
  258. // Class: |CLASSNAME|
  259. // Method: ~|CLASSNAME|
  260. // Description: destructor
  261. //--------------------------------------------------------------------------------------
  262. |CLASSNAME|::~|CLASSNAME| () {
  263. <CURSOR>
  264. } // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) -----
  265. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  266. == cpp.class-using-new-definition ==
  267. // =====================================================================================
  268. // Class: |?CLASSNAME:c|
  269. // Description: <CURSOR>
  270. // =====================================================================================
  271. class |CLASSNAME|
  272. {
  273. public:
  274. // ==================== LIFECYCLE =======================================
  275. |CLASSNAME| (); // constructor
  276. |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor
  277. ~|CLASSNAME| (); // destructor
  278. // ==================== OPERATORS =======================================
  279. const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
  280. // ==================== OPERATIONS =======================================
  281. // ==================== ACCESS =======================================
  282. // ==================== INQUIRY =======================================
  283. // ==================== DATA MEMBERS =======================================
  284. protected:
  285. private:
  286. }; // ----- end of class |CLASSNAME| -----
  287. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  288. == cpp.class-using-new-implementation ==
  289. //--------------------------------------------------------------------------------------
  290. // Class: |?CLASSNAME|
  291. // Method: |CLASSNAME|
  292. // Description: constructor
  293. //--------------------------------------------------------------------------------------
  294. |CLASSNAME|::|CLASSNAME| ()
  295. {
  296. } // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
  297. //--------------------------------------------------------------------------------------
  298. // Class: |CLASSNAME|
  299. // Method: |CLASSNAME|
  300. // Description: copy constructor
  301. //--------------------------------------------------------------------------------------
  302. |CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other )
  303. {
  304. } // ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) -----
  305. //--------------------------------------------------------------------------------------
  306. // Class: |CLASSNAME|
  307. // Method: ~|CLASSNAME|
  308. // Description: destructor
  309. //--------------------------------------------------------------------------------------
  310. |CLASSNAME|::~|CLASSNAME| ()
  311. {
  312. } // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) -----
  313. //--------------------------------------------------------------------------------------
  314. // Class: |CLASSNAME|
  315. // Method: operator =
  316. // Description: assignment operator
  317. //--------------------------------------------------------------------------------------
  318. const |CLASSNAME|&
  319. |CLASSNAME|::operator = ( const |CLASSNAME| &other )
  320. {
  321. if ( this != &other ) {
  322. }
  323. return *this;
  324. } // ----- end of method |CLASSNAME|::operator = (assignment operator) -----
  325. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  326. == cpp.error-class ==
  327. // =====================================================================================
  328. // Class: |?CLASSNAME:c|
  329. // Description: <CURSOR>
  330. // =====================================================================================
  331. class |CLASSNAME|
  332. {
  333. public: |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg) { }
  334. virtual ~|CLASSNAME| ( ) { }
  335. virtual string what ( ) const throw ( ) { return message; }
  336. protected: string message;
  337. }; // ---------- end of class |CLASSNAME| ----------
  338. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  339. == cpp.template-method-implementation ==
  340. template < class T >
  341. void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( )
  342. {
  343. return ;
  344. } // ----- end of method |CLASSNAME|<T>::|METHODNAME| -----
  345. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  346. == cpp.template-accessor-implementation ==
  347. //--------------------------------------------------------------------------------------
  348. // Class: |?CLASSNAME|
  349. // Method: get_|?ATTRIBUTE|
  350. //--------------------------------------------------------------------------------------
  351. template < class T >
  352. inline <CURSOR>int |CLASSNAME|<T>::get_|ATTRIBUTE| ( )
  353. {
  354. return |ATTRIBUTE|;
  355. } // ----- end of method |CLASSNAME|<T>::get_|ATTRIBUTE| -----
  356. //--------------------------------------------------------------------------------------
  357. // Class: |CLASSNAME|
  358. // Method: set_|ATTRIBUTE|
  359. //--------------------------------------------------------------------------------------
  360. template < class T >
  361. inline void |CLASSNAME|<T>::set_|ATTRIBUTE| ( int value )
  362. {
  363. |ATTRIBUTE| = value;
  364. return ;
  365. } // ----- end of method |CLASSNAME|<T>::set_|ATTRIBUTE| -----
  366. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  367. == cpp.template-class-definition ==
  368. // =====================================================================================
  369. // Class: |?CLASSNAME:c|
  370. // Description: <CURSOR>
  371. // =====================================================================================
  372. template < class T >
  373. class |CLASSNAME|
  374. {
  375. public:
  376. // ==================== LIFECYCLE =======================================
  377. |CLASSNAME| (); // constructor
  378. // ==================== OPERATORS =======================================
  379. // ==================== OPERATIONS =======================================
  380. // ==================== ACCESS =======================================
  381. // ==================== INQUIRY =======================================
  382. // ==================== DATA MEMBERS =======================================
  383. protected:
  384. private:
  385. }; // ----- end of template class |CLASSNAME| -----
  386. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  387. == cpp.template-class-implementation ==
  388. //--------------------------------------------------------------------------------------
  389. // Class: |?CLASSNAME|
  390. // Method: |CLASSNAME|
  391. // Description: constructor
  392. //--------------------------------------------------------------------------------------
  393. template < class T >
  394. |CLASSNAME| <T>:: |CLASSNAME| ()
  395. {
  396. } // ----- end of constructor of template class |CLASSNAME| -----
  397. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  398. == cpp.template-class-using-new-definition ==
  399. // =====================================================================================
  400. // Class: |?CLASSNAME:c|
  401. // Description: <CURSOR>
  402. // =====================================================================================
  403. template < class T >
  404. class |CLASSNAME|
  405. {
  406. public:
  407. // ==================== LIFECYCLE =======================================
  408. |CLASSNAME| (); // constructor
  409. |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor
  410. ~|CLASSNAME| (); // destructor
  411. // ==================== OPERATORS =======================================
  412. const |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
  413. // ==================== OPERATIONS =======================================
  414. // ==================== ACCESS =======================================
  415. // ==================== INQUIRY =======================================
  416. // ==================== DATA MEMBERS =======================================
  417. protected:
  418. private:
  419. }; // ----- end of template class |CLASSNAME| -----
  420. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  421. == cpp.template-class-using-new-implementation ==
  422. //--------------------------------------------------------------------------------------
  423. // Class: |?CLASSNAME|
  424. // Method: |CLASSNAME|
  425. // Description: constructor
  426. //--------------------------------------------------------------------------------------
  427. template < class T >
  428. |CLASSNAME|<T>::|CLASSNAME| ()
  429. {
  430. } // ----- end of constructor of template class |CLASSNAME| -----
  431. //--------------------------------------------------------------------------------------
  432. // Class: |CLASSNAME|
  433. // Method: |CLASSNAME|
  434. // Description: copy constructor
  435. //--------------------------------------------------------------------------------------
  436. template < class T >
  437. |CLASSNAME|<T>::|CLASSNAME| ( const |CLASSNAME| &other )
  438. {
  439. } // ----- end of copy constructor of template class |CLASSNAME| -----
  440. //--------------------------------------------------------------------------------------
  441. // Class: |CLASSNAME|
  442. // Method: ~|CLASSNAME|
  443. // Description: destructor
  444. //--------------------------------------------------------------------------------------
  445. template < class T >
  446. |CLASSNAME|<T>::~|CLASSNAME| ()
  447. {
  448. } // ----- end of destructor of template class |CLASSNAME| -----
  449. //--------------------------------------------------------------------------------------
  450. // Class: |CLASSNAME|
  451. // Method: operator =
  452. // Description: assignment operator
  453. //--------------------------------------------------------------------------------------
  454. template < class T >
  455. const |CLASSNAME|<T>& |CLASSNAME|<T>::operator = ( const |CLASSNAME| &other )
  456. {
  457. if ( this != &other ) {
  458. }
  459. return *this;
  460. } // ----- end of assignment operator of template class |CLASSNAME| -----
  461. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  462. == cpp.template-function ==
  463. template <class T>
  464. <CURSOR>void |?TEMPALTE_FUNCTION_NAME| ( T param )
  465. {
  466. return ;
  467. } // ----- end of template function |?TEMPALTE_FUNCTION_NAME| -----
  468. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  469. == cpp.operator-in ==
  470. ostream &
  471. operator << ( ostream & os, const |?CLASSNAME| & obj )
  472. {
  473. os << obj.<CURSOR> ;
  474. return os;
  475. } // ----- end of function operator << -----
  476. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  477. == cpp.operator-out ==
  478. istream &
  479. operator >> ( istream & is, |?CLASSNAME| & obj )
  480. {
  481. is >> obj.<CURSOR> ;
  482. return is;
  483. } // ----- end of function operator >> -----
  484. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  485. == cpp.try-catch ==
  486. try {
  487. <SPLIT>}
  488. catch ( const <CURSOR> &ExceptObj ) { // handle exception:
  489. }
  490. catch (...) { // handle exception: unspezified
  491. }
  492. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  493. == cpp.catch ==
  494. catch ( <CURSOR>const &ExceptObj ) { // handle exception:
  495. <SPLIT>}
  496. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  497. == cpp.catch-points ==
  498. catch (...) { // handle exception:
  499. <SPLIT>}
  500. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  501. == cpp.extern ==
  502. extern "C" {<CURSOR>
  503. <SPLIT>}
  504. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  505. == cpp.open-input-file ==
  506. string ifs_file_name = "<CURSOR>"; // input file name
  507. ifstream ifs; // create ifstream object
  508. ifs.open ( ifs_file_name.c_str() ); // open ifstream
  509. if (!ifs) {
  510. cerr << "\nERROR : failed to open input file " << ifs_file_name << endl;
  511. exit (EXIT_FAILURE);
  512. }
  513. ifs.close (); // close ifstream
  514. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  515. == cpp.open-output-file ==
  516. string ofs_file_name = "<CURSOR>"; // input file name
  517. ofstream ofs; // create ofstream object
  518. ofs.open ( ofs_file_name.c_str() ); // open ofstream
  519. if (!ofs) {
  520. cerr << "\nERROR : failed to open output file " << ofs_file_name << endl;
  521. exit (EXIT_FAILURE);
  522. }
  523. ofs.close (); // close ofstream
  524. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  525. == cpp.namespace-std ==
  526. using namespace std;
  527. == cpp.namespace ==
  528. using namespace |?NAMESPACE|;
  529. == cpp.namespace-block ==
  530. namespace |?NAMESPACE| {
  531. <CURSOR>
  532. <SPLIT>} // ----- end of |NAMESPACE| name -----
  533. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  534. == cpp.rtti-typeid == insert ==
  535. typeid(<CURSOR><SPLIT>)
  536. $
  537. == cpp.rtti-static-cast == insert ==
  538. static_cast<>(<CURSOR><SPLIT>)
  539. $
  540. == cpp.rtti-const-cast == insert ==
  541. const_cast<>(<CURSOR><SPLIT>)
  542. $
  543. == cpp.rtti-reinterpret-cast == insert ==
  544. reinterpret_cast<>(<CURSOR><SPLIT>)
  545. $
  546. == cpp.rtti-dynamic-cast == insert ==
  547. dynamic_cast<>(<CURSOR><SPLIT>)
  548. $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  549. /* vim: set tabstop=4 expandtab: */
  550. /* vim: set filetype=cpp: */