HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEP_ContextOptions.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: DEP_ContextOptions.h (DEP Library, C++)
7  */
8 
9 #ifndef __DEP_CONTEXTOPTIONS_H__
10 #define __DEP_CONTEXTOPTIONS_H__
11 
12 #include "DEP_API.h"
13 #include "DEP_ContextOptionsFwd.h"
14 #include <UT/UT_COW.h>
15 #include <UT/UT_ConcurrentSet.h>
16 #include <UT/UT_Options.h>
17 #include <UT/UT_StringHolder.h>
18 #include <UT/UT_StringSet.h>
19 #include <UT/UT_TBBSpinLock.h>
20 #include <UT/UT_UniquePtr.h>
21 #include <SYS/SYS_Types.h>
22 
23 typedef UT_ConcurrentSet<UT_StringHolder> DEP_ContextOptionDeps;
27 
29 {
30 public:
33 
34  int getNumOptions() const;
35  bool hasOption(const UT_StringRef &opt) const;
36  const UT_OptionEntry *getOptionEntry(
37  const UT_StringRef &opt) const;
38  bool isOptionAtDefault(
39  const UT_StringRef &opt) const;
40 
42  UT_Options::iterator end() const;
43 
44  void setOption(const UT_StringHolder &opt,
46  bool is_default = false);
47  void setOptionS(const UT_StringHolder &opt,
48  const UT_StringHolder &value,
49  bool is_default = false);
50  void setOptionF(const UT_StringHolder &opt,
51  fpreal64 value,
52  bool is_default = false);
53  void setOptionI(const UT_StringHolder &opt,
54  int64 value,
55  bool is_default = false);
56  void removeOption(const UT_StringHolder &opt);
57  void clear();
58 
59 private:
60  void setOptionIsAtDefault(
61  const UT_StringHolder &opt,
62  bool is_default);
63 
64  UT_Options myOptions;
65  UT_StringSet myOptionsAtDefaults;
66 };
67 
68 DEP_API extern const DEP_ContextOptionDeps &
74  DEP_ContextOptionDepsLock *lock = nullptr);
75 
76 #endif // __DEP_CONTEXTOPTIONS_H__
77 
UT_UniquePtr< DEP_ContextOptionDeps > DEP_ContextOptionDepsPtr
UT_TBBSpinLock::Scope DEP_ContextOptionDepsLockScope
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
Definition: format.h:251
DEP_API const DEP_ContextOptionDeps & DEPgetContextOptionDepsFromPtr(const DEP_ContextOptionDepsPtr &ptr)
UT_ConcurrentSet< UT_StringHolder > DEP_ContextOptionDeps
long long int64
Definition: SYS_Types.h:111
double fpreal64
Definition: SYS_Types.h:196
GLuint GLuint end
Definition: glew.h:1253
UT_TBBSpinLock DEP_ContextOptionDepsLock
A map of string to various well defined value types.
Definition: UT_Options.h:42
const void * ptr(const T *p)
Definition: format.h:3292
DEP_API DEP_ContextOptionDeps & DEPcreateContextOptionDepsFromPtr(DEP_ContextOptionDepsPtr &ptr, DEP_ContextOptionDepsLock *lock=nullptr)
GLsizei const GLfloat * value
Definition: glew.h:1849
#define DEP_API
Definition: DEP_API.h:10