/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2011 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * FragmentResult.cpp * * Created on: Oct 19, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "FragmentResult.hpp" /** Private default Constructor of class FragmentResult. * * This cstor is for serialization of this class inside a vector * only. Without it, we would not need it. */ FragmentResult::FragmentResult() : JobId(JobId::NoJob), result(std::string("NoJob")), exitflag(0) {} /** Constructor of class FragmentResult. * * \param _id id of FragmntJob associated to this FragmentResult. */ FragmentResult::FragmentResult(const JobId_t _id) : JobId(_id), result(std::string("Nothing")), exitflag(0) {} /** Constructor of class FragmentResult. */ FragmentResult::FragmentResult(const JobId_t _id, const std::string _result) : JobId(_id), result(_result), exitflag(0) {} /** Copy constructor of class FragmentResult. * */ FragmentResult::FragmentResult(const FragmentResult &other) : JobId(other.getId()), result(other.result), exitflag(other.exitflag) {} /** Destructor of class FragmentResult. * */ FragmentResult::~FragmentResult() {} /** Equality operator: Equal if both JobIds are the same * * \param other instance to check against * \return true - both JobIds are the same, false - JobIds are not the same. */ bool FragmentResult::operator==(const FragmentResult &other) const { return getId() == other.getId(); } /** Assigment operator. * * \note We can't use default assigment because of const member FragmentResult::JobId. * * \param other instance to make equal to */ FragmentResult& FragmentResult::operator=(const FragmentResult &other) { /// check self-assignment if (this != &other) { setId(other.getId()); result = other.result; } return *this; }