LibreOffice Module tools (master) 1
Classes | Namespaces | Macros | Functions
link.hxx File Reference
#include <sal/config.h>
#include <sal/macros.h>
#include <sal/types.h>
Include dependency graph for link.hxx:

Go to the source code of this file.

Classes

class  Link< typename Arg, typename Ret >
 
class  LinkParamNone
 

Namespaces

namespace  tools
 Note: this class is a true marvel of engineering: because the author could not decide whether it's better to have a closed or half-open interval, they just implemented both in the same class!
 
namespace  tools::detail
 

Macros

#define DECL_LINK(Member, ArgType, RetType)
 
#define DECL_STATIC_LINK(Class, Member, ArgType, RetType)
 
#define DECL_DLLPRIVATE_LINK(Member, ArgType, RetType)
 
#define DECL_DLLPRIVATE_STATIC_LINK(Class, Member, ArgType, RetType)
 
#define IMPL_LINK(Class, Member, ArgType, ArgName, RetType)
 
#define IMPL_LINK_NOARG(Class, Member, ArgType, RetType)
 
#define IMPL_STATIC_LINK(Class, Member, ArgType, ArgName, RetType)
 
#define IMPL_STATIC_LINK_NOARG(Class, Member, ArgType, RetType)
 
#define LINK(Instance, Class, Member)
 

Functions

template<typename To , typename From >
To tools::detail::castTo (From from)
 
template<typename Arg , typename Ret >
Link< Arg, Ret > tools::detail::makeLink (void *instance, Ret(*function)(void *, Arg), const char *file, int line, const char *target)
 

Macro Definition Documentation

◆ DECL_DLLPRIVATE_LINK

#define DECL_DLLPRIVATE_LINK (   Member,
  ArgType,
  RetType 
)
Value:
SAL_DLLPRIVATE static RetType LinkStub##Member(void *, ArgType); \
SAL_DLLPRIVATE RetType Member(ArgType)

Definition at line 36 of file link.hxx.

◆ DECL_DLLPRIVATE_STATIC_LINK

#define DECL_DLLPRIVATE_STATIC_LINK (   Class,
  Member,
  ArgType,
  RetType 
)
Value:
SAL_DLLPRIVATE static RetType LinkStub##Member(void *, ArgType); \
SAL_DLLPRIVATE static RetType Member(Class *, ArgType)

Definition at line 40 of file link.hxx.

◆ DECL_LINK

#define DECL_LINK (   Member,
  ArgType,
  RetType 
)
Value:
static RetType LinkStub##Member(void *, ArgType); \
RetType Member(ArgType)

Definition at line 28 of file link.hxx.

◆ DECL_STATIC_LINK

#define DECL_STATIC_LINK (   Class,
  Member,
  ArgType,
  RetType 
)
Value:
static RetType LinkStub##Member(void *, ArgType); \
static RetType Member(Class *, ArgType)

Definition at line 32 of file link.hxx.

◆ IMPL_LINK

#define IMPL_LINK (   Class,
  Member,
  ArgType,
  ArgName,
  RetType 
)
Value:
RetType Class::LinkStub##Member(void * instance, ArgType data) { \
return static_cast<Class *>(instance)->Member(data); \
} \
RetType Class::Member(ArgType ArgName)

Definition at line 44 of file link.hxx.

◆ IMPL_LINK_NOARG

#define IMPL_LINK_NOARG (   Class,
  Member,
  ArgType,
  RetType 
)
Value:
RetType Class::LinkStub##Member(void * instance, ArgType data) { \
return static_cast<Class *>(instance)->Member(data); \
} \
RetType Class::Member(SAL_UNUSED_PARAMETER ArgType)

Definition at line 50 of file link.hxx.

◆ IMPL_STATIC_LINK

#define IMPL_STATIC_LINK (   Class,
  Member,
  ArgType,
  ArgName,
  RetType 
)
Value:
RetType Class::LinkStub##Member(void * instance, ArgType data) { \
return Member(static_cast<Class *>(instance), data); \
} \
RetType Class::Member(SAL_UNUSED_PARAMETER Class *, ArgType ArgName)

Definition at line 56 of file link.hxx.

◆ IMPL_STATIC_LINK_NOARG

#define IMPL_STATIC_LINK_NOARG (   Class,
  Member,
  ArgType,
  RetType 
)
Value:
RetType Class::LinkStub##Member(void * instance, ArgType data) { \
return Member(static_cast<Class *>(instance), data); \
} \
RetType Class::Member( \
SAL_UNUSED_PARAMETER Class *, SAL_UNUSED_PARAMETER ArgType)

Definition at line 63 of file link.hxx.

◆ LINK

#define LINK (   Instance,
  Class,
  Member 
)
Value:
::tools::detail::castTo<Class *>(Instance), &Class::LinkStub##Member, __FILE__, __LINE__, SAL_STRINGIFY(Class::LinkStub##Member))
#define SAL_STRINGIFY(x)
Link< Arg, Ret > makeLink(void *instance, Ret(*function)(void *, Arg), const char *file, int line, const char *target)
Definition: link.hxx:166

Definition at line 72 of file link.hxx.