LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PolicyNames.h
Go to the documentation of this file.
1 
9 #ifndef NURANDOM_RANDOMUTILS_PROVIDERS_POLICYNAMES_H
10 #define NURANDOM_RANDOMUTILS_PROVIDERS_POLICYNAMES_H
11 
12 
13 // framework libraries
14 #include "cetlib_except/exception.h"
15 
16 // C/C++ standard libraries
17 #include <vector>
18 #include <string>
19 
20 
21 // Preprocessor macro to create a master list of all the policies
22 #define NURANDOM_SEED_SERVICE_POLICIES \
23  NURANDOM_SEED_SERVICE_POLICY(unDefined) \
24  NURANDOM_SEED_SERVICE_POLICY(autoIncrement) \
25  NURANDOM_SEED_SERVICE_POLICY(linearMapping) \
26  NURANDOM_SEED_SERVICE_POLICY(preDefinedOffset) \
27  NURANDOM_SEED_SERVICE_POLICY(preDefinedSeed) \
28  NURANDOM_SEED_SERVICE_POLICY(random) \
29  NURANDOM_SEED_SERVICE_POLICY(perEvent) \
30 
31 
32 
33 // -----------------------------------------------------------------------------
34 namespace rndm::details {
35 
36  // ---------------------------------------------------------------------------
38  enum class Policy: unsigned {
39  #define NURANDOM_SEED_SERVICE_POLICY(x) x,
41  #undef NURANDOM_SEED_SERVICE_POLICY
42  };
43 
44 
45  //----------------------------------------------------------------------------
47  std::vector<std::string> const& policyNames();
48 
49 
50  //----------------------------------------------------------------------------
56  std::string const& policyName(Policy policy);
57 
58 
59  // ---------------------------------------------------------------------------
70  Policy policyFromName(std::string const& name);
71 
72  // ---------------------------------------------------------------------------
73 
74 
75 } // namespace rndm::details
76 
77 
78 #endif // NURANDOM_RANDOMUTILS_PROVIDERS_POLICYNAMES_H
std::vector< std::string > const & policyNames()
Returns a list of names of policies, in the same order as Policy enum.
Definition: PolicyNames.cxx:52
Policy
Enumeration of all supported random seed policies.
Definition: PolicyNames.h:38
std::string const & policyName(Policy policy)
Returns the name of the specified policy.
Definition: PolicyNames.cxx:56
Policy policyFromName(std::string const &policyName)
Returns the policy with the specified name.
Definition: PolicyNames.cxx:67