From 65f215eee257d159dc1d2747e02cc1bcb051c60f Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 31 May 2007 11:03:26 +0200 Subject: [PATCH] add a new overloaded Assign method --- src/core/callback.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/callback.h b/src/core/callback.h index efeb44be2..526c022a3 100644 --- a/src/core/callback.h +++ b/src/core/callback.h @@ -331,6 +331,16 @@ public: const Callback *goodType = static_cast *> (&other); *this = *goodType; } + void Assign (Ptr other) { + CallbackImpl *impl = dynamic_cast *> (PeekPointer (other)); + if (other == 0) + { + NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\")" + " got=" << typeid (other).name () << + ", expected=" << typeid (*impl).name ()); + } + *this = Callback (impl); + } private: virtual CallbackImpl *PeekImpl (void) const { return PeekPointer (m_impl);