HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_Results.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: STY_Results.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_Results__
12 #define __STY_Results__
13 
14 #include "STY_API.h"
15 #include "STY_Style.h"
16 #include "STY_Types.h"
17 #include <UT/UT_StringMap.h>
18 
19 /// A combination of a single property value and the style entry that
20 /// set the value.
22 {
23 public:
25  { }
27  const STY_StyleHandle &source)
28  : myValue(value),
29  mySource(source)
30  { }
31  void clear()
32  {
33  myValue.reset();
34  mySource.reset();
35  }
36  bool isClear() const
37  {
38  return !myValue && !mySource;
39  }
40 
41  /// NOTE: These are only needed to avoid a compile error in
42  /// UT_ArrayMap<UT_StringHolder,STY_Result>::operator==()
43  /// @{
44  bool operator==(const STY_Result &that) const
45  {
46  return (myValue == that.myValue) && (mySource == that.mySource);
47  }
48  bool operator!=(const STY_Result &that) const
49  {
50  return !(*this == that);
51  }
52  /// @}
53 
56 };
57 
58 namespace UT {
59 template<>
61 {
63  static void clear(STY_Result &v)
64  { v.clear(); }
66  static bool isClear(STY_Result &v)
67  { return v.isClear(); }
69  static void clearConstruct(STY_Result *p)
70  { new((void *)p) STY_Result(); }
71 
72  static const bool clearNeedsDestruction = false;
73 };
74 }
75 
76 /// A map of property names to result values.
78  public UT_ArrayStringMap<STY_Result>
79 {
80 public:
81  void merge(const STY_ResultMap &src);
82  void merge(const STY_ConstantMap &src);
83  uint hash() const;
84 
86 };
87 
88 namespace UT {
89 template<>
91  public DefaultClearer<STY_ResultMap::Base>
92 {};
93 }
94 
95 /// This is the data type returned when evaluating style sheet results.
96 /// The top level string map is the category name (one of the STY_OVERRIDE_*
97 /// constants). Each STY_ResultMap contains the result key/value pairs
98 /// within that category.
100  public UT_ArrayStringMap<STY_ResultMap>
101 {
102 };
103 
104 #endif
105 
const GLdouble * v
Definition: glcorearb.h:836
static SYS_FORCE_INLINE void clear(STY_Result &v)
Definition: STY_Results.h:63
static SYS_FORCE_INLINE void clearConstruct(STY_Result *p)
Definition: STY_Results.h:69
static SYS_FORCE_INLINE bool isClear(STY_Result &v)
Definition: STY_Results.h:66
#define STY_API
Definition: STY_API.h:10
void clear()
Definition: STY_Results.h:31
bool operator==(const STY_Result &that) const
Definition: STY_Results.h:44
UT_SharedPtr< const STY_Constant > STY_ConstantHandle
Definition: STY_Types.h:90
STY_StyleHandle mySource
Definition: STY_Results.h:55
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
STY_Result(const STY_ConstantHandle &value, const STY_StyleHandle &source)
Definition: STY_Results.h:26
unsigned int uint
Definition: SYS_Types.h:40
GLsizei const GLfloat * value
Definition: glcorearb.h:823
bool isClear() const
Definition: STY_Results.h:36
STY_ConstantHandle myValue
Definition: STY_Results.h:54
bool operator!=(const STY_Result &that) const
Definition: STY_Results.h:48
WARNING: This class DOES NOT ALLOW EMPTY STRING as a key!
A map of property names to result values.
Definition: STY_Results.h:77
GLenum src
Definition: glcorearb.h:1792