mpqc::detail::ForceLink< T, A > Class Template Reference
Collaboration diagram for mpqc::detail::ForceLink< T, A >:

Documentation

template<class T, class A = const KeyVal&>
class mpqc::detail::ForceLink< T, A >

This, together with ForceLinkBase, is used to force code for particular classes to be linked into executables.

Note
Objects of classes derived from DescribedClass can be created from KeyVal input and/or checkpoint files by using class name lookup to find that class's entry in the constructor registry. Unfortunately, linking in a library that defines such a class doesn't cause the code for the class to be linked. To force linking of class T derived from DescribedClass create an object of class ForceLink<T> in the main executable. This is most conveniently done by having every library define such objects in its linkage.h file; the main executable then includes all linkage.h files from the libraries that it needs.
Only a declaration of class T is needed to define an object of type ForceLink<T>; this is key to avoiding instantiation of class T in the executable. Nevertheless, it is necessary to define ForceLink<T>::create in the library somewhere, usually in a file called linkage.cpp ; this file usually also contains constructor registration macros.
See also
MPQC_FORCELINK_KEYVAL_CTOR

Public Member Functions

 ForceLink ()
 
virtual ~ForceLink ()
 
DescribedClasscreate (A a)
 

Constructor & Destructor Documentation

◆ ForceLink()

template<class T , class A = const KeyVal&>
mpqc::detail::ForceLink< T, A >::ForceLink ( )
inline

◆ ~ForceLink()

template<class T , class A = const KeyVal&>
virtual mpqc::detail::ForceLink< T, A >::~ForceLink ( )
inlinevirtual

Member Function Documentation

◆ create()

template<class T , class A = const KeyVal&>
DescribedClass* mpqc::detail::ForceLink< T, A >::create ( a)

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