// Fichier genere avec ./genere -t3 Derived #include "Derived.h" //-- template Derived::Derived(void) : Base(), _derivedObject(T3()) { } //-- template Derived::Derived(const Derived& aD) : Base(aD) { _copy(aD); } //-- template Derived& Derived::operator=(const Derived& aD) { if (this != &aD) { Base::operator=(aD); _destroy(); _copy(aD); } return *this; } //-- template Derived::~Derived(void) { _destroy(); } //-- template bool operator==(const Derived& aD1, const Derived& aD2) { return aD1.isEqualTo(aD2); } //-- template bool operator!=(const Derived& aD1, const Derived& aD2) { return !(aD1==aD2); } //-- template void Derived::setDerivedObject(const T3& object) { _derivedObject = object; } template const T3& Derived::getDerivedObject(void) const { return _derivedObject; } //-- template ostream& operator<<(ostream& os, const Derived& aD) { aD.display(os); return os; } //-- template void Derived::display(ostream& os) const { os << '('; Base::display(os); os << ',' << _derivedObject << ')'; } //-- template bool Derived::isEqualTo(const Derived& aD) const { if (_derivedObject != aD._derivedObject) return false; if (!(Base::isEqualTo(aD))) return false; return true; } //-- template void Derived::_copy(const Derived& aD) { _derivedObject = aD._derivedObject; } //-- template void Derived::_destroy(void) { }