11 #ifndef _UT_PropertyTable_
12 #define _UT_PropertyTable_
68 int getNumProps()
const {
return size(); }
71 {
return findRName(name); }
106 OptionEntryPtr
value(
int i)
const;
116 {
return myProperties[i].jsonMap(); }
122 {
return myProperties[idx].import(
name,
val); }
126 {
return myProperties[idx].import(
name,
val,
size); }
146 {
return myTable.rclass(map(i)); }
148 {
return myTable.rname(map(i)); }
150 {
return myTable.hname(map(i)); }
152 {
return myTable.label(map(i)); }
154 {
return myTable.value(map(i)); }
156 {
return myTable.minValue(map(i)); }
158 {
return myTable.maxValue(map(i)); }
161 {
return myTable.save(w, &myProperties); }
163 {
return myTable.dump(&myProperties); }
175 return i >= 0 && i < myProperties.size() ? myProperties(i) : -1;
182 {
return getSubset(&name, 1); }
183 const PropertySubsetList &getSubset(
const UT_StringRef names[],
205 for (
auto &&pdef : myProperties)
207 if (predicate(pdef.jsonMap()))
208 matched.
append(&pdef.jsonMap());
217 for (
auto &&pdef : myProperties)
219 if (predicate(pdef.jsonMap()))
220 FUNC(pdef.jsonMap());
227 IncludeGuards(
bool v=
false)
233 bool verbose()
const {
return myVerbose && mySet.size() == 0; }
237 size_t size()
const {
return mySet.size(); }
242 IncludeGuards &guards);
243 bool load(
UT_IStream &is, IncludeGuards &guards);
246 IncludeGuards &guards);
247 const PropertySubsetList &buildSubset(
const UT_StringRef names[],
268 const OptionEntryPtr &
value()
const {
return myValue; }
269 fpreal64 minValue()
const {
return myMin; }
270 fpreal64 maxValue()
const {
return myMax; }
273 {
return (*myJSONMap)(
name); }
279 return item && item->
import(
v);
293 OptionEntryPtr myValue;
302 PropertySubsetListMap mySubsets;
Relatively lightweight representation of a subset of a UT_PropertyList.
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
GT_API const UT_StringHolder filename
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
GLuint GLsizei const GLchar * label
#define SYS_DEPRECATED(__V__)
const UT_StringHolder & rclass(int i) const
UT_SharedPtr< UT_OptionEntry > OptionEntryPtr
fpreal64 maxValue(int i) const
GLsizei const GLfloat * value
bool loadStatus() const
Return the load status of the table in the c-tor.
PropertySubsetList(const UT_PropertyTable &table)
bool save(UT_JSONWriter &w) const
const UT_StringHolder & hname(int i) const
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
exint parentIndex(int i) const
Get the index in the parent table.
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
__hostdev__ bool getMax() const
const UT_JSONValueMap & jsonMap(int i) const
Return a raw JSONValueMap representing the property.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
exint size() const
Number of properties stored in the table.
const UT_StringHolder & label(int i) const
GLuint const GLchar * name
OptionEntryPtr value(int i) const
GLenum GLenum GLsizei void * table
void appendProperty(int id)
Add a property using the index from the base table.
const UT_StringHolder & rname(int i) const
SYS_FORCE_INLINE bool import(bool &result) const
Extract a bool (returns false if type is invalid)
__hostdev__ bool getMin() const
Class to store JSON objects as C++ objects.
SYS_FORCE_INLINE void filter(FUNC &func, SELECT &predicate)
GLubyte GLubyte GLubyte GLubyte w
const PropertySubsetList & getSubset(const UT_StringRef &name)
fpreal64 minValue(int i) const
SYS_FORCE_INLINE void select(UT_Array< const UT_JSONValueMap * > &matched, SELECT &predicate)