//-------------------------------------------------------------------------- // File and Version Information: // $Id: AstFracAss.cc,v 1.2 2006/06/30 11:24:22 steinke Exp $ // // Description: // Class AstFracAssTerm // // Environment: // Software developed for the BaBar Detector at the SLAC B-Factory. // // Author List: // David Brown // // Copyright Information: // Copyright (C) 2000 Lawrence Berkeley Laboratory // // Bertram Kopf (RUB) migrated to PandaRoot //------------------------------------------------------------------------ #include "AstFracAss.h" template AstFracAss::AstFracAss(const A* aterm, const B* bterm, double weight) : AstFracElem(bterm,weight), _aelem(aterm) {;} template AstFracAss::AstFracAss(): AstFracElem(), _aelem(0) {;} template AstFracAss::AstFracAss(const AstFracAss& other) : AstFracElem(other),_aelem(other._aelem) {;} template AstFracAss& AstFracAss::operator = (const AstFracAss& other) { if(this != &other){ AstFracElem::operator = (other); _aelem = other._aelem; } return *this; } template AstFracAss::~AstFracAss() {;} template const A* AstFracAss::firstArgument() const { return _aelem; } template const B* AstFracAss::secondArgument() const { return this->element(); } // arithmetic allowed only if logically equal template AstFracAss& AstFracAss::operator += (const AstFracAss& other) { if(_aelem == other._aelem) AstFracElem::operator += (other); return *this; } template AstFracAss& AstFracAss::operator -= (const AstFracAss& other) { if(_aelem == other._aelem) AstFracElem::operator -= (other); return *this; } // ignore the weight in logical comparisons. template bool AstFracAss::operator < (const AstFracAss& other) const { return _aelem != other._aelem ? _aelem < other._aelem : AstFracElem::ltElement(other); } template bool AstFracAss::operator > (const AstFracAss& other) const { return _aelem != other._aelem ? _aelem > other._aelem : AstFracElem::gtElement(other); } template bool AstFracAss::operator == (const AstFracAss& other) const { return _aelem == other._aelem && AstFracElem::sameElement(other); } template bool AstFracAss::operator != (const AstFracAss& other) const { return !( *this == other); }