/* 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 05/31/2016 12:27:31 PM * @version $Id$ * @author Trevor Irons (ti) * @email tirons@egi.utah.edu * @copyright Copyright (c) 2016, University of Utah * @copyright Copyright (c) 2016, Lemma Software, LLC */ #include "DEMParticle.h" namespace Lemma { // ==================== FRIEND METHODS ===================== #ifdef HAVE_YAMLCPP std::ostream &operator << (std::ostream &stream, const DEMParticle &ob) { stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy return stream; } #else std::ostream &operator<<(std::ostream &stream, const DEMParticle& ob) { stream << *(LemmaObject*)(&ob); return stream; } #endif // ==================== LIFECYCLE ======================= //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: DEMParticle // Description: constructor (protected) //-------------------------------------------------------------------------------------- DEMParticle::DEMParticle (const std::string& name) : LemmaObject(name) { } // ----- end of method DEMParticle::DEMParticle (constructor) ----- #ifdef HAVE_YAMLCPP //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: DEMParticle // Description: DeSerializing constructor (protected) //-------------------------------------------------------------------------------------- DEMParticle::DEMParticle (const YAML::Node& node) : LemmaObject(node) { } // ----- end of method DEMParticle::DEMParticle (constructor) ----- #endif //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: New() // Description: public constructor //-------------------------------------------------------------------------------------- DEMParticle* DEMParticle::New() { DEMParticle* Obj = new DEMParticle("DEMParticle"); Obj->AttachTo(Obj); return Obj; } //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: ~DEMParticle // Description: destructor (protected) //-------------------------------------------------------------------------------------- DEMParticle::~DEMParticle () { } // ----- end of method DEMParticle::~DEMParticle (destructor) ----- //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: Delete // Description: public destructor //-------------------------------------------------------------------------------------- void DEMParticle::Delete() { this->DetachFrom(this); } //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: Release // Description: destructor (protected) //-------------------------------------------------------------------------------------- void DEMParticle::Release() { delete this; } #ifdef HAVE_YAMLCPP //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: Serialize //-------------------------------------------------------------------------------------- YAML::Node DEMParticle::Serialize ( ) const { YAML::Node node = LemmaObject::Serialize();; node.SetTag( this->Name ); // FILL IN CLASS SPECIFICS HERE return node; } // ----- end of method DEMParticle::Serialize ----- //-------------------------------------------------------------------------------------- // Class: DEMParticle // Method: DeSerialize //-------------------------------------------------------------------------------------- DEMParticle* DEMParticle::DeSerialize ( const YAML::Node& node ) { DEMParticle* Object = new DEMParticle(node); Object->AttachTo(Object); DESERIALIZECHECK( node, Object ) return Object ; } // ----- end of method DEMParticle::DeSerialize ----- #endif } // ----- end of Lemma name -----