123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- /* This file is part of Lemma, a geophysical modelling and inversion API.
- * More information is available at http://lemmasoftware.org
- */
-
- /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
- /**
- * @file
- * @date 06/16/2016 02:11:21 PM
- * @version $Id$
- * @author Trevor Irons (ti)
- * @email tirons@egi.utah.edu
- * @copyright Copyright (c) 2016, University of Utah
- * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
- */
-
-
- #include "DEMGrain.h"
-
- namespace Lemma {
-
- // ==================== FRIEND METHODS =====================
-
- std::ostream &operator << (std::ostream &stream, const DEMGrain &ob) {
- stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
- return stream;
- }
-
- // ==================== LIFECYCLE =======================
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: DEMGrain
- // Description: constructor (protected)
- //--------------------------------------------------------------------------------------
- DEMGrain::DEMGrain ( ) : DEMParticle( ) {
-
- } // ----- end of method DEMGrain::DEMGrain (constructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: DEMGrain
- // Description: DeSerializing constructor (protected)
- //--------------------------------------------------------------------------------------
- DEMGrain::DEMGrain (const YAML::Node& node) : DEMParticle(node) {
-
- } // ----- end of method DEMGrain::DEMGrain (constructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: NewSP()
- // Description: public constructor returing a shared_ptr
- //--------------------------------------------------------------------------------------
- std::shared_ptr< DEMGrain > DEMGrain::NewSP() {
- std::shared_ptr< DEMGrain > sp(new DEMGrain( ), LemmaObjectDeleter() );
- return sp;
- }
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: ~DEMGrain
- // Description: destructor (protected)
- //--------------------------------------------------------------------------------------
- DEMGrain::~DEMGrain () {
-
- } // ----- end of method DEMGrain::~DEMGrain (destructor) -----
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: Serialize
- //--------------------------------------------------------------------------------------
- YAML::Node DEMGrain::Serialize ( ) const {
- YAML::Node node = DEMParticle::Serialize();
- node.SetTag( GetName() );
- // FILL IN CLASS SPECIFICS HERE
- return node;
- } // ----- end of method DEMGrain::Serialize -----
-
- //--------------------------------------------------------------------------------------
- // Class: DEMGrain
- // Method: DeSerialize
- //--------------------------------------------------------------------------------------
- std::shared_ptr<DEMGrain> DEMGrain::DeSerialize ( const YAML::Node& node ) {
- if (node.Tag() != "DEMGrain" ) {
- throw DeSerializeTypeMismatch( "DEMGrain", node.Tag());
- }
- std::shared_ptr< DEMGrain > Object(new DEMGrain(node), LemmaObjectDeleter() );
- return Object ;
- } // ----- end of method DEMGrain::DeSerialize -----
-
- } // ---- end of namespace Lemma ----
-
- /* vim: set tabstop=4 expandtab: */
- /* vim: set filetype=cpp: */
-
|