OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google, Inc. | 2 * Copyright 2013 Google, Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #ifndef SkRTConf_DEFINED | 9 #ifndef SkRTConf_DEFINED |
10 #define SkRTConf_DEFINED | 10 #define SkRTConf_DEFINED |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 /** \class SkRTConfRegistry | 68 /** \class SkRTConfRegistry |
69 A class that maintains a systemwide registry of all runtime configuration | 69 A class that maintains a systemwide registry of all runtime configuration |
70 parameters. Mainly used for printing them out and handling multiply-defined | 70 parameters. Mainly used for printing them out and handling multiply-defined |
71 knobs. | 71 knobs. |
72 */ | 72 */ |
73 | 73 |
74 class SkRTConfRegistry { | 74 class SkRTConfRegistry { |
75 public: | 75 public: |
76 SkRTConfRegistry(); | 76 SkRTConfRegistry(); |
| 77 ~SkRTConfRegistry(); |
77 void printAll(const char *fname = NULL) const; | 78 void printAll(const char *fname = NULL) const; |
78 bool hasNonDefault() const; | 79 bool hasNonDefault() const; |
79 void printNonDefault(const char *fname = NULL) const; | 80 void printNonDefault(const char *fname = NULL) const; |
80 const char *configFileLocation() const; | 81 const char *configFileLocation() const; |
81 void possiblyDumpFile() const; | 82 void possiblyDumpFile() const; |
82 void validate() const; | 83 void validate() const; |
83 template <typename T> void set(const char *confname, | 84 template <typename T> void set(const char *confname, |
84 T value, | 85 T value, |
85 bool warnIfNotFound = true); | 86 bool warnIfNotFound = true); |
86 #ifdef SK_SUPPORT_UNITTEST | 87 #ifdef SK_SUPPORT_UNITTEST |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // static_cast here is okay because there's only one kind of child class. | 186 // static_cast here is okay because there's only one kind of child class. |
186 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf); | 187 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf); |
187 return child_pointer && | 188 return child_pointer && |
188 fName == child_pointer->fName && | 189 fName == child_pointer->fName && |
189 fDescription == child_pointer->fDescription && | 190 fDescription == child_pointer->fDescription && |
190 fValue == child_pointer->fValue && | 191 fValue == child_pointer->fValue && |
191 fDefault == child_pointer->fDefault; | 192 fDefault == child_pointer->fDefault; |
192 } | 193 } |
193 | 194 |
194 #endif | 195 #endif |
OLD | NEW |