forcelink.h File Reference
Include dependency graph for forcelink.h:

Classes

class  mpqc::detail::ForceLinkBase< A >
 
class  mpqc::detail::ForceLink< T, A >
 This, together with ForceLinkBase, is used to force code for particular classes to be linked into executables. More...
 
class  mpqc::ForceLink< Ts >
 

Namespaces

 mpqc
 The top-level namespace for all Massively Parallel Quantum Chemistry package.
 
 mpqc::detail
 

Macros

#define MPQC_FORCELINK_KEYVAL_CTOR(...)
 Streamlines the definition of ForceLink<T>::create methods. More...
 
#define MPQC_CLASS_EXPORT(...)
 
#define MPQC_CLASS_EXPORT2(K, ...)
 
#define MPQC_FORCE_LINK(TAG, ...)    mpqc::ForceLink<__VA_ARGS__> TAG \
 

Macro Definition Documentation

◆ MPQC_CLASS_EXPORT

#define MPQC_CLASS_EXPORT (   ...)
Value:
MPQC_CLASS_EXPORT_KEY(__VA_ARGS__) \
MPQC_FORCELINK_KEYVAL_CTOR(__VA_ARGS__)

For a class T derived from DescribedClass MPQC_CLASS_EXPORT(T), creates a Boost.Serialization GUID for the class, registers the KeyVal ctor of T (see MPQC_CLASS_EXPORT_KEY(T)), and allows to force linking of T into the executable by defining a ForceLink<T> object in it (see MPQC_FORCELINK_KEYVAL_CTOR(T)). Place MPQC_CLASS_EXPORT(T) to a source file in global scope.

Note
To avoid slowing down compilation by coupling the instantiation of multiple classes, use only one MPQC_CLASS_EXPORT(T) per .cpp file

◆ MPQC_CLASS_EXPORT2

#define MPQC_CLASS_EXPORT2 (   K,
  ... 
)
Value:
MPQC_CLASS_EXPORT_KEY2(K, __VA_ARGS__) \
MPQC_FORCELINK_KEYVAL_CTOR(__VA_ARGS__)

For a class T derived from DescribedClass MPQC_CLASS_EXPORT2(Key,T) creates a Boost.Serialization GUID for the class using key Key registers the KeyVal ctor of T (see MPQC_CLASS_EXPORT_KEY2(Key,T)), and allows to force linking of T into the executable by defining a ForceLink<T> object in it (see MPQC_FORCELINK_KEYVAL_CTOR(T)). Place MPQC_CLASS_EXPORT2(T) to a source file in global scope.

Note
To avoid slowing down compilation by coupling the instantiation of multiple classes, use only one MPQC_CLASS_EXPORT2(T) per .cpp file

◆ MPQC_FORCE_LINK

#define MPQC_FORCE_LINK (   TAG,
  ... 
)     mpqc::ForceLink<__VA_ARGS__> TAG \

◆ MPQC_FORCELINK_KEYVAL_CTOR

#define MPQC_FORCELINK_KEYVAL_CTOR (   ...)
Value:
namespace mpqc { \
namespace detail { \
template <> \
const KeyVal& kv) { \
return new __VA_ARGS__(kv); \
} \
} \
}

Streamlines the definition of ForceLink<T>::create methods.

For every object of ForceLink<T> type defined in linkage.h add MPQC_FORCELINK_KEYVAL_CTOR(T) to a .cpp file.

Note
Since for DescribedClass-based classes one needs to register the KeyVal ctor AND force their linking into the executable, usually this macro should not be used directly, instead use MPQC_CLASS_EXPORT2(Key,T) or MPQC_CLASS_EXPORT(T)
See also
MPQC_CLASS_EXPORT
MPQC_CLASS_EXPORT2
The top-level namespace for all Massively Parallel Quantum Chemistry package.
Definition: libmpqc.cpp:1
#define MPQC_CLASS_EXPORT_KEY(...)
Associates a key (character string) with a class and register the class's KeyVal constructor with Des...
Definition: keyval.h:308
#define MPQC_CLASS_EXPORT_KEY2(K,...)
Associates a key (character string) with a class using and register the class's KeyVal constructor wi...
Definition: keyval.h:284