Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <pup.h>
7 :
8 : #include "Utilities/Serialization/CharmPupable.hpp"
9 :
10 : /*!
11 : * \brief Simple struct that changes a class from being factory creatable, to
12 : * non-factory creatable.
13 : *
14 : * It does this by defining and setting a static constexpr bool
15 : * `factory_creatable = false`.
16 : *
17 : * \tparam FactoryCreatableClass Any class that is already factory creatable.
18 : */
19 : template <typename FactoryCreatableClass>
20 1 : struct NonFactoryCreatableWrapper : public FactoryCreatableClass {
21 0 : static constexpr bool factory_creatable = false;
22 : using FactoryCreatableClass::FactoryCreatableClass;
23 :
24 0 : using factory_creatable_class = FactoryCreatableClass;
25 :
26 : /// \cond
27 : explicit NonFactoryCreatableWrapper(CkMigrateMessage* /*unused*/) {}
28 : using PUP::able::register_constructor;
29 : WRAPPED_PUPable_decl_template(NonFactoryCreatableWrapper); // NOLINT
30 : /// \endcond
31 : };
32 :
33 : /// \cond
34 : // NOLINTBEGIN
35 : template <typename FactoryCreatableClass>
36 : PUP::able::PUP_ID NonFactoryCreatableWrapper<FactoryCreatableClass>::my_PUP_ID =
37 : 0;
38 : // NOLINTEND
39 : /// \endcond
|