add Callback::Assign
parent
658cc9cd23
commit
9e269500d2
|
@ -23,6 +23,7 @@
|
||||||
#define CALLBACK_H
|
#define CALLBACK_H
|
||||||
|
|
||||||
#include "reference-list.h"
|
#include "reference-list.h"
|
||||||
|
#include "fatal-error.h"
|
||||||
|
|
||||||
namespace ns3 {
|
namespace ns3 {
|
||||||
|
|
||||||
|
@ -292,6 +293,16 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Assign (CallbackBase const &other) {
|
||||||
|
if (!CheckType (other))
|
||||||
|
{
|
||||||
|
NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\")"
|
||||||
|
" got=" << typeid (other).name () <<
|
||||||
|
", expected=" << typeid (*this).name ());
|
||||||
|
}
|
||||||
|
const Callback<R, T1,T2,T3,T4,T5> *goodType = static_cast<const Callback<R,T1,T2,T3,T4,T5> *> (&other);
|
||||||
|
*this = *goodType;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
virtual CallbackImplBase *PeekImpl (void) const {
|
virtual CallbackImplBase *PeekImpl (void) const {
|
||||||
return m_impl.Get ();
|
return m_impl.Get ();
|
||||||
|
|
Loading…
Reference in New Issue