Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions
fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr > Class Template Reference

#include <FastDelegate.h>

Inheritance diagram for fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >:

List of all members.

Public Member Functions

template<class X , class XMemFunc >
void bindconstmemfunc (const X *pthis, XMemFunc function_to_bind)
template<class X , class XMemFunc >
void bindconstmemfunc (const X *pthis, XMemFunc function_to_bind)
template<class X , class XMemFunc >
void bindmemfunc (X *pthis, XMemFunc function_to_bind)
template<class X , class XMemFunc >
void bindmemfunc (X *pthis, XMemFunc function_to_bind)
template<class DerivedClass , class ParentInvokerSig >
void bindstaticfunc (DerivedClass *pParent, ParentInvokerSig static_function_invoker, StaticFuncPtr function_to_bind)
template<class DerivedClass , class ParentInvokerSig >
void bindstaticfunc (DerivedClass *pParent, ParentInvokerSig static_function_invoker, StaticFuncPtr function_to_bind)
template<class DerivedClass >
void CopyFrom (DerivedClass *pParent, const DelegateMemento &right)
template<class DerivedClass >
void CopyFrom (DerivedClass *pParent, const DelegateMemento &right)
GenericMemFunc GetClosureMemPtr () const
GenericMemFunc GetClosureMemPtr () const
GenericClass * GetClosureThis () const
GenericClass * GetClosureThis () const
UnvoidStaticFuncPtr GetStaticFunction () const
UnvoidStaticFuncPtr GetStaticFunction () const
bool IsEqualToStaticFuncPtr (StaticFuncPtr funcptr)
bool IsEqualToStaticFuncPtr (StaticFuncPtr funcptr)

Detailed Description

template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
class fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >

Definition at line 664 of file parse/FastDelegate.h.


Member Function Documentation

template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class X , class XMemFunc >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindconstmemfunc ( const X *  pthis,
XMemFunc  function_to_bind 
) [inline]

Definition at line 684 of file parse/FastDelegate.h.

Referenced by fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::bind(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::bind(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::bind(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::bind(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::bind(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::bind(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::bind(), fastdelegate::FastDelegate1< Param1, RetType >::bind(), fastdelegate::FastDelegate0< RetType >::bind(), fastdelegate::FastDelegate0< RetType >::FastDelegate0(), fastdelegate::FastDelegate1< Param1, RetType >::FastDelegate1(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::FastDelegate2(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::FastDelegate3(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::FastDelegate4(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::FastDelegate5(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::FastDelegate6(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::FastDelegate7(), and fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::FastDelegate8().

                                                                            {
        m_pthis= SimplifyMemFunc< sizeof(function_to_bind) >
            ::Convert(const_cast<X*>(pthis), function_to_bind, m_pFunction);
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
        m_pStaticFunction = 0;
#endif
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class X , class XMemFunc >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindconstmemfunc ( const X *  pthis,
XMemFunc  function_to_bind 
) [inline]

Definition at line 684 of file port/FastDelegate.h.

                                                                            {
        m_pthis= SimplifyMemFunc< sizeof(function_to_bind) >
            ::Convert(const_cast<X*>(pthis), function_to_bind, m_pFunction);
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
        m_pStaticFunction = 0;
#endif
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class X , class XMemFunc >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindmemfunc ( X *  pthis,
XMemFunc  function_to_bind 
) [inline]

Definition at line 672 of file port/FastDelegate.h.

                                                                  {
        m_pthis = SimplifyMemFunc< sizeof(function_to_bind) >
            ::Convert(pthis, function_to_bind, m_pFunction);
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
        m_pStaticFunction = 0;
#endif
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class X , class XMemFunc >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindmemfunc ( X *  pthis,
XMemFunc  function_to_bind 
) [inline]

Definition at line 672 of file parse/FastDelegate.h.

Referenced by fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::bind(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::bind(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::bind(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::bind(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::bind(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::bind(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::bind(), fastdelegate::FastDelegate1< Param1, RetType >::bind(), fastdelegate::FastDelegate0< RetType >::bind(), fastdelegate::detail::ClosurePtr< GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr >::bindstaticfunc(), fastdelegate::FastDelegate0< RetType >::FastDelegate0(), fastdelegate::FastDelegate1< Param1, RetType >::FastDelegate1(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::FastDelegate2(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::FastDelegate3(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::FastDelegate4(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::FastDelegate5(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::FastDelegate6(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::FastDelegate7(), and fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::FastDelegate8().

                                                                  {
        m_pthis = SimplifyMemFunc< sizeof(function_to_bind) >
            ::Convert(pthis, function_to_bind, m_pFunction);
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
        m_pStaticFunction = 0;
#endif
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class DerivedClass , class ParentInvokerSig >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindstaticfunc ( DerivedClass *  pParent,
ParentInvokerSig  static_function_invoker,
StaticFuncPtr  function_to_bind 
) [inline]

Definition at line 767 of file parse/FastDelegate.h.

Referenced by fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::bind(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::bind(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::bind(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::bind(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::bind(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::bind(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::bind(), fastdelegate::FastDelegate1< Param1, RetType >::bind(), and fastdelegate::FastDelegate0< RetType >::bind().

                                                {
        if (function_to_bind==0) { // cope with assignment to 0
            m_pFunction=0;
        } else { 
           // We'll be ignoring the 'this' pointer, but we need to make sure we pass
           // a valid value to bindmemfunc().
            bindmemfunc(pParent, static_function_invoker);
        }

        // WARNING! Evil hack. We store the function in the 'this' pointer!
        // Ensure that there's a compilation failure if function pointers 
        // and data pointers have different sizes.
        // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
        typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
        m_pthis = horrible_cast<GenericClass *>(function_to_bind);
        // MSVC, SunC++ and DMC accept the following (non-standard) code:
//        m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
        // BCC32, Comeau and DMC accept this method. MSVC7.1 needs __int64 instead of long
//        m_pthis = reinterpret_cast<GenericClass *>(reinterpret_cast<long>(function_to_bind));
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class DerivedClass , class ParentInvokerSig >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::bindstaticfunc ( DerivedClass *  pParent,
ParentInvokerSig  static_function_invoker,
StaticFuncPtr  function_to_bind 
) [inline]

Definition at line 767 of file port/FastDelegate.h.

                                                {
        if (function_to_bind==0) { // cope with assignment to 0
            m_pFunction=0;
        } else { 
           // We'll be ignoring the 'this' pointer, but we need to make sure we pass
           // a valid value to bindmemfunc().
            bindmemfunc(pParent, static_function_invoker);
        }

        // WARNING! Evil hack. We store the function in the 'this' pointer!
        // Ensure that there's a compilation failure if function pointers 
        // and data pointers have different sizes.
        // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
        typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
        m_pthis = horrible_cast<GenericClass *>(function_to_bind);
        // MSVC, SunC++ and DMC accept the following (non-standard) code:
//        m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
        // BCC32, Comeau and DMC accept this method. MSVC7.1 needs __int64 instead of long
//        m_pthis = reinterpret_cast<GenericClass *>(reinterpret_cast<long>(function_to_bind));
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class DerivedClass >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::CopyFrom ( DerivedClass *  pParent,
const DelegateMemento right 
) [inline]

Definition at line 759 of file parse/FastDelegate.h.

Referenced by fastdelegate::FastDelegate0< RetType >::FastDelegate0(), fastdelegate::FastDelegate1< Param1, RetType >::FastDelegate1(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::FastDelegate2(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::FastDelegate3(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::FastDelegate4(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::FastDelegate5(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::FastDelegate6(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::FastDelegate7(), fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::FastDelegate8(), fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::operator=(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::operator=(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::operator=(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::operator=(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::operator=(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::operator=(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::operator=(), fastdelegate::FastDelegate1< Param1, RetType >::operator=(), fastdelegate::FastDelegate0< RetType >::operator=(), fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::SetMemento(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::SetMemento(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::SetMemento(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::SetMemento(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::SetMemento(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::SetMemento(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::SetMemento(), fastdelegate::FastDelegate1< Param1, RetType >::SetMemento(), and fastdelegate::FastDelegate0< RetType >::SetMemento().

                                                                               {
        SetMementoFrom(right);
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
template<class DerivedClass >
void fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::CopyFrom ( DerivedClass *  pParent,
const DelegateMemento right 
) [inline]

Definition at line 759 of file port/FastDelegate.h.

                                                                               {
        SetMementoFrom(right);
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
GenericMemFunc fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetClosureMemPtr ( ) const [inline]
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
GenericMemFunc fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetClosureMemPtr ( ) const [inline]

Definition at line 702 of file port/FastDelegate.h.

{ return reinterpret_cast<GenericMemFunc>(m_pFunction); }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
GenericClass* fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetClosureThis ( ) const [inline]

Definition at line 701 of file port/FastDelegate.h.

{ return m_pthis; }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
GenericClass* fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetClosureThis ( ) const [inline]
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
UnvoidStaticFuncPtr fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetStaticFunction ( ) const [inline]

Definition at line 792 of file port/FastDelegate.h.

                                                         {
        // Ensure that there's a compilation failure if function pointers 
        // and data pointers have different sizes.
        // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
        typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
        return horrible_cast<UnvoidStaticFuncPtr>(this);
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
UnvoidStaticFuncPtr fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::GetStaticFunction ( ) const [inline]
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
bool fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::IsEqualToStaticFuncPtr ( StaticFuncPtr  funcptr) [inline]

Definition at line 802 of file parse/FastDelegate.h.

Referenced by fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::operator!=(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::operator!=(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::operator!=(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::operator!=(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::operator!=(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::operator!=(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::operator!=(), fastdelegate::FastDelegate1< Param1, RetType >::operator!=(), fastdelegate::FastDelegate0< RetType >::operator!=(), fastdelegate::FastDelegate8< Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, RetType >::operator==(), fastdelegate::FastDelegate7< Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType >::operator==(), fastdelegate::FastDelegate6< Param1, Param2, Param3, Param4, Param5, Param6, RetType >::operator==(), fastdelegate::FastDelegate5< Param1, Param2, Param3, Param4, Param5, RetType >::operator==(), fastdelegate::FastDelegate4< ThreadPoolLocalStorage *, int, AsyncBuffer *, u32, bool >::operator==(), fastdelegate::FastDelegate3< const char *, const NetAddr *, int, bool >::operator==(), fastdelegate::FastDelegate2< Param1, Param2, RetType >::operator==(), fastdelegate::FastDelegate1< Param1, RetType >::operator==(), and fastdelegate::FastDelegate0< RetType >::operator==().

                                                             {
        if (funcptr==0) return empty(); 
    // For the Evil method, if it doesn't actually contain a static function, this will return an arbitrary
    // value that is not equal to any valid function pointer.
        else return funcptr==reinterpret_cast<StaticFuncPtr>(GetStaticFunction());
    }
template<class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr>
bool fastdelegate::detail::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >::IsEqualToStaticFuncPtr ( StaticFuncPtr  funcptr) [inline]

Definition at line 802 of file port/FastDelegate.h.

                                                             {
        if (funcptr==0) return empty(); 
    // For the Evil method, if it doesn't actually contain a static function, this will return an arbitrary
    // value that is not equal to any valid function pointer.
        else return funcptr==reinterpret_cast<StaticFuncPtr>(GetStaticFunction());
    }

The documentation for this class was generated from the following files:

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net