mpqc.Core.KeyVal
Collaboration diagram for mpqc.Core.KeyVal:

Documentation

Classes/functions for managing structured sets of keyword-value associations, such as encoded in the MPQC object-oriented input format.

Classes

class  mpqc::DescribedClass
 
class  mpqc::KeyVal
 KeyVal specifies C++ primitive data (booleans, integers, reals, string) and user-defined objects obtained from JSON/XML/INFO input or by programmatic construction. More...
 

Macros

#define MPQC_CLASS_REGISTER_GUID(K, ...)
 
#define MPQC_BOOST_CLASS_EXPORT_KEY2(K, ...)
 
#define MPQC_CLASS_EXPORT_KEY2(K, ...)
 Associates a key (character string) with a class using and register the class's KeyVal constructor with DescribedClass's registry. This does not register class with Boost.Serialization, use MPQC_BOOST_CLASS_EXPORT_KEY2 for that. More...
 
#define MPQC_CLASS_EXPORT_KEY(...)    MPQC_CLASS_EXPORT_KEY2(BOOST_PP_STRINGIZE(__VA_ARGS__), __VA_ARGS__)
 Associates a key (character string) with a class and register the class's KeyVal constructor with DescribedClass's registry. This does not register class with Boost.Serialization, use MPQC_BOOST_CLASS_EXPORT_KEY2 for that. More...
 
#define MPQC_BOOST_CLASS_EXPORT_IMPLEMENT(...)
 Forces the class instantiation so that it can be deserialized with Boost.Serialization. More...
 

Macro Definition Documentation

◆ MPQC_BOOST_CLASS_EXPORT_IMPLEMENT

#define MPQC_BOOST_CLASS_EXPORT_IMPLEMENT (   ...)
Value:
namespace boost { \
namespace archive { \
namespace detail { \
namespace extra_detail { \
template <> \
struct init_guid<__VA_ARGS__> { \
static guid_initializer<__VA_ARGS__> const& g; \
}; \
guid_initializer<__VA_ARGS__> const& init_guid<__VA_ARGS__>::g = \
::boost::serialization::singleton< \
guid_initializer<__VA_ARGS__>>::get_mutable_instance() \
.export_guid(); \
} \
} \
} \
} \

Forces the class instantiation so that it can be deserialized with Boost.Serialization.

Note
this is a variadic version of BOOST_CLASS_EXPORT_IMPLEMENT, hence it can register classes with two or more template arguments.
this should be placed in a source file (read Boost.Serialization docs very carefully).

◆ MPQC_BOOST_CLASS_EXPORT_KEY2

#define MPQC_BOOST_CLASS_EXPORT_KEY2 (   K,
  ... 
)
Value:
namespace boost { \
namespace serialization { \
template <> \
struct guid_defined<__VA_ARGS__> : boost::mpl::true_ {}; \
namespace ext { \
template <> \
struct guid_impl<__VA_ARGS__> { \
static inline const char* call() { return K; } \
}; \
} \
} /* serialization */ \
} /* boost */ \

MPQC_BOOST_CLASS_EXPORT_KEY2(K,T) associates key K with type T

Note
this is a variadic version of BOOST_CLASS_EXPORT_KEY2 (see the docs for Boost.Serialization); unlike BOOST_CLASS_EXPORT_KEY2 this can register classes with two or more template arguments.
this should be placed in a header file (read Boost.Serialization docs very carefully).

◆ MPQC_CLASS_EXPORT_KEY

#define MPQC_CLASS_EXPORT_KEY (   ...)     MPQC_CLASS_EXPORT_KEY2(BOOST_PP_STRINGIZE(__VA_ARGS__), __VA_ARGS__)

Associates a key (character string) with a class and register the class's KeyVal constructor with DescribedClass's registry. This does not register class with Boost.Serialization, use MPQC_BOOST_CLASS_EXPORT_KEY2 for that.

Identical to MPQC_CLASS_EXPORT_KEY2, but uses class name for the class key. Use MPQC_BOOST_CLASS_EXPORT_KEY to skip the KeyVal ctor registration.

See also
MPQC_CLASS_EXPORT_KEY2

◆ MPQC_CLASS_EXPORT_KEY2

#define MPQC_CLASS_EXPORT_KEY2 (   K,
  ... 
)
Value:
MPQC_CLASS_REGISTER_GUID(K, __VA_ARGS__) \
namespace mpqc { \
namespace detail { \
template <> \
struct register_keyval_ctor<__VA_ARGS__> { \
static DescribedClass::registrar<__VA_ARGS__> const& r; \
}; \
DescribedClass::registrar<__VA_ARGS__> const& \
register_keyval_ctor<__VA_ARGS__>::r = \
::boost::serialization::singleton< \
DescribedClass::registrar<__VA_ARGS__>>::get_mutable_instance(); \
} \
} \

Associates a key (character string) with a class using and register the class's KeyVal constructor with DescribedClass's registry. This does not register class with Boost.Serialization, use MPQC_BOOST_CLASS_EXPORT_KEY2 for that.

Use MPQC_CLASS_EXPORT_KEY2 to skip the KeyVal constructor registration.

Note
this should be placed in a source file, and only occur once for each class.

◆ MPQC_CLASS_REGISTER_GUID

#define MPQC_CLASS_REGISTER_GUID (   K,
  ... 
)
Value:
namespace mpqc { \
namespace detail { \
template <> \
const char* guid<__VA_ARGS__>() { \
return K; \
} \
} /* detail */ \
} /* mpqc */ \

MPQC_CLASS_REGISTER_GUID(K,T) associates key K as GUID for type T

Note
this can be placed in a header or a source file.
The top-level namespace for all Massively Parallel Quantum Chemistry package.
Definition: libmpqc.cpp:1
#define MPQC_CLASS_REGISTER_GUID(K,...)
Definition: keyval.h:243
Definition: keyval.h:49