Ariles
configurable_flags.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2017-2018 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @brief
9 */
10 
11 #pragma once
12 
13 
14 namespace ariles
15 {
16  class ARILES_VISIBILITY_ATTRIBUTE ConfigurableFlags : public ariles::Flags<unsigned int, ConfigurableFlags>
17  {
18  public:
19  enum Flags
20  {
21  RESET = 0,
22  ALLOW_MISSING_ENTRIES = 1,
23  SLOPPY_MAPS_IF_SUPPORTED = 2,
24  COMPACT_ARRAYS_IF_SUPPORTED = 4,
25  PROPAGATE_ALLOW_MISSING_ENTRIES = 8,
26  FORCE_EXPLICIT_MATRIX_SIZE = 16,
27  SLOPPY_PAIRS_IF_SUPPORTED = 32,
28  DISABLE_ALLOW_MISSING_ENTRIES = 64, // internal use
29 
30 #ifdef ARILES_DEFAULT_CONFIGURABLE_FLAGS
31  DEFAULT = ARILES_DEFAULT_CONFIGURABLE_FLAGS
32 #else
33  DEFAULT = RESET
34 #endif
35  };
36 
37 
38  public:
40  {
41  setDefaults();
42  }
43 
44 
45  ConfigurableFlags(const unsigned int flags, const Action action_type = REPLACE)
46  {
47  initialize(flags, action_type);
48  }
49 
50 
51  void setDefaults()
52  {
53  flags_ = DEFAULT;
54  }
55  };
56 } // namespace ariles
ConfigurableFlags(const unsigned int flags, const Action action_type=REPLACE)
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
Definition: basic.h:17