From c4db77dd18200472a4e29c72f4f372eb99dd7779 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 11 May 2012 10:45:44 +0200 Subject: [PATCH] fix: Operator Extension base class returns NULL on Clone() by default --- FDTD/extensions/operator_extension.cpp | 8 +------- FDTD/extensions/operator_extension.h | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/FDTD/extensions/operator_extension.cpp b/FDTD/extensions/operator_extension.cpp index 1f5d14b..60f09e0 100644 --- a/FDTD/extensions/operator_extension.cpp +++ b/FDTD/extensions/operator_extension.cpp @@ -34,16 +34,10 @@ Operator_Extension::Operator_Extension(Operator* op, Operator_Extension* op_ext) { UNUSED(op_ext); m_Op = op; + m_Op_Cyl = dynamic_cast(op); } void Operator_Extension::ShowStat(ostream &ostr) const { ostr << "--- " << GetExtensionName() << " ---" << endl; } - -Operator_Extension* Operator_Extension::Clone(Operator* op) -{ - if (dynamic_cast(this)==NULL) - return NULL; - return new Operator_Extension(op, this); -} diff --git a/FDTD/extensions/operator_extension.h b/FDTD/extensions/operator_extension.h index 0856377..92c518b 100644 --- a/FDTD/extensions/operator_extension.h +++ b/FDTD/extensions/operator_extension.h @@ -44,7 +44,7 @@ public: Create a clone of this extension, will return NULL if this is impossible (e.g. derived extension has no clone method and copy-constructor)... BuildExtension has to be called separatly! */ - virtual Operator_Extension* Clone(Operator* op); + virtual Operator_Extension* Clone(Operator* op) {return NULL;} virtual bool BuildExtension() {return true;}