HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
paramlist.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenImageIO project.
2 // SPDX-License-Identifier: Apache-2.0
3 // https://github.com/AcademySoftwareFoundation/OpenImageIO
4 
5 
6 /// \file
7 ///
8 /// Define the ParamValue and ParamValueList classes, which are used to
9 /// store lists of arbitrary name/data pairs for internal storage of
10 /// parameter lists, attributes, geometric primitive data, etc.
11 
12 
13 #pragma once
14 
15 #include <vector>
16 
18 #include <OpenImageIO/export.h>
20 #include <OpenImageIO/typedesc.h>
21 #include <OpenImageIO/ustring.h>
22 
23 
25 
26 /// ParamValue holds a parameter and a pointer to its value(s)
27 ///
28 /// Nomenclature: if you have an array of 4 colors for each of 15 points...
29 /// - There are 15 VALUES
30 /// - Each value has an array of 4 ELEMENTS, each of which is a color
31 /// - A color has 3 COMPONENTS (R, G, B)
32 ///
34 public:
35  /// Interpolation types
36  ///
37  enum Interp {
38  INTERP_CONSTANT = 0, ///< Constant for all pieces/faces
39  INTERP_PERPIECE = 1, ///< Piecewise constant per piece/face
40  INTERP_LINEAR = 2, ///< Linearly interpolated across each piece/face
41  INTERP_VERTEX = 3 ///< Interpolated like vertices
42  };
43 
44  OIIO_STRONG_PARAM_TYPE(Copy, bool);
45  OIIO_STRONG_PARAM_TYPE(FromUstring, bool);
46 
47  ParamValue() noexcept { m_data.ptr = nullptr; }
48 
49 #if OIIO_VERSION_LESS(3, 0, 0) && !defined(OIIO_DOXYGEN)
50  // DEPRECATED(2.4): Use the ones with strongly typed bool parameters
51  ParamValue(const ustring& _name, TypeDesc _type, int _nvalues,
52  const void* _value, bool _copy) noexcept
53  {
54  init_noclear(_name, _type, _nvalues, _value, Copy(_copy));
55  }
56  ParamValue(const ustring& _name, TypeDesc _type, int _nvalues,
57  Interp _interp, const void* _value, bool _copy) noexcept
58  {
59  init_noclear(_name, _type, _nvalues, _interp, _value, Copy(_copy));
60  }
61  ParamValue(string_view _name, TypeDesc _type, int _nvalues,
62  const void* _value, bool _copy) noexcept
63  {
64  init_noclear(ustring(_name), _type, _nvalues, _value, Copy(_copy));
65  }
66  ParamValue(string_view _name, TypeDesc _type, int _nvalues, Interp _interp,
67  const void* _value, bool _copy) noexcept
68  {
69  init_noclear(ustring(_name), _type, _nvalues, _interp, _value,
70  Copy(_copy));
71  }
72 #endif
73 
74  ParamValue(const ustring& _name, TypeDesc _type, int _nvalues,
75  const void* _value, Copy _copy = Copy(true)) noexcept
76  {
77  init_noclear(_name, _type, _nvalues, _value, _copy);
78  }
79  ParamValue(const ustring& _name, TypeDesc _type, int _nvalues,
80  Interp _interp, const void* _value,
81  Copy _copy = Copy(true)) noexcept
82  {
83  init_noclear(_name, _type, _nvalues, _interp, _value, _copy);
84  }
85  ParamValue(string_view _name, TypeDesc _type, int _nvalues,
86  const void* _value, Copy _copy = Copy(true)) noexcept
87  {
88  init_noclear(ustring(_name), _type, _nvalues, _value, _copy);
89  }
90  ParamValue(string_view _name, TypeDesc _type, int _nvalues, Interp _interp,
91  const void* _value, Copy _copy = Copy(true)) noexcept
92  {
93  init_noclear(ustring(_name), _type, _nvalues, _interp, _value, _copy);
94  }
95 
96  ParamValue(string_view _name, int value) noexcept
97  {
98  init_noclear(ustring(_name), TypeDesc::INT, 1, &value);
99  }
100  ParamValue(string_view _name, float value) noexcept
101  {
102  init_noclear(ustring(_name), TypeDesc::FLOAT, 1, &value);
103  }
105  {
106  init_noclear(ustring(_name), TypeDesc::STRING, 1, &value, Copy(true),
107  FromUstring(true));
108  }
110  : ParamValue(_name, ustring(value))
111  {
112  }
114  {
115  init_noclear(ustring(_name), TypeDesc::USTRINGHASH, 1, &value,
116  Copy(true));
117  }
118 
119  // Set from string -- parse
121 
122  // Copy constructor
123  ParamValue(const ParamValue& p) noexcept
124  {
125  init_noclear(p.name(), p.type(), p.nvalues(), p.interp(), p.data(),
126  Copy(true), FromUstring(true));
127  }
128  ParamValue(const ParamValue& p, Copy _copy) noexcept
129  {
130  init_noclear(p.name(), p.type(), p.nvalues(), p.interp(), p.data(),
131  _copy, FromUstring(true));
132  }
133 
134  // Rvalue (move) constructor
135  ParamValue(ParamValue&& p) noexcept
136  {
137  init_noclear(p.name(), p.type(), p.nvalues(), p.interp(), p.data(),
138  Copy(false), FromUstring(true));
139  m_copy = p.m_copy;
140  m_nonlocal = p.m_nonlocal;
141  p.m_data.ptr = nullptr; // make sure the old one won't free
142  }
143 
144  ~ParamValue() noexcept { clear_value(); }
145 
146 #if OIIO_VERSION_LESS(3, 0, 0) && !defined(OIIO_DOXYGEN)
147  // DEPRECATED(2.4): Use the ones with strongly typed bool parameters
148  void init(ustring _name, TypeDesc _type, int _nvalues, Interp _interp,
149  const void* _value, bool _copy) noexcept
150  {
151  clear_value();
152  init_noclear(_name, _type, _nvalues, _interp, _value, Copy(_copy));
153  }
154  void init(ustring _name, TypeDesc _type, int _nvalues, const void* _value,
155  bool _copy) noexcept
156  {
157  init(_name, _type, _nvalues, INTERP_CONSTANT, _value, Copy(_copy));
158  }
159  void init(string_view _name, TypeDesc _type, int _nvalues,
160  const void* _value, bool _copy) noexcept
161  {
162  init(ustring(_name), _type, _nvalues, _value, Copy(_copy));
163  }
164  void init(string_view _name, TypeDesc _type, int _nvalues, Interp _interp,
165  const void* _value, bool _copy) noexcept
166  {
167  init(ustring(_name), _type, _nvalues, _interp, _value, Copy(_copy));
168  }
169 #endif
170 
171  void init(ustring _name, TypeDesc _type, int _nvalues, Interp _interp,
172  const void* _value, Copy _copy) noexcept
173  {
174  clear_value();
175  init_noclear(_name, _type, _nvalues, _interp, _value, _copy);
176  }
177  void init(ustring _name, TypeDesc _type, int _nvalues, const void* _value,
178  Copy _copy = Copy(true)) noexcept
179  {
180  init(_name, _type, _nvalues, INTERP_CONSTANT, _value, _copy);
181  }
182  void init(string_view _name, TypeDesc _type, int _nvalues,
183  const void* _value, Copy _copy = Copy(true)) noexcept
184  {
185  init(ustring(_name), _type, _nvalues, _value, _copy);
186  }
187  void init(string_view _name, TypeDesc _type, int _nvalues, Interp _interp,
188  const void* _value, Copy _copy = Copy(true)) noexcept
189  {
190  init(ustring(_name), _type, _nvalues, _interp, _value, _copy);
191  }
192 
193  // Assignment
194  const ParamValue& operator=(const ParamValue& p) noexcept;
195  const ParamValue& operator=(ParamValue&& p) noexcept;
196 
197  // FIXME -- some time in the future (after more cleanup), we should make
198  // name() return a string_view, and use uname() for the rare time when
199  // the caller truly requires the ustring.
200  const ustring& name() const noexcept { return m_name; }
201  const ustring& uname() const noexcept { return m_name; }
202  TypeDesc type() const noexcept { return m_type; }
203  int nvalues() const noexcept { return m_nvalues; }
204  const void* data() const noexcept
205  {
206  return m_nonlocal ? m_data.ptr : &m_data;
207  }
208  int datasize() const noexcept
209  {
210  return m_nvalues * static_cast<int>(m_type.size());
211  }
212  Interp interp() const noexcept { return (Interp)m_interp; }
213  void interp(Interp i) noexcept { m_interp = (unsigned char)i; }
214  bool is_nonlocal() const noexcept { return m_nonlocal; }
215 
216  friend void swap(ParamValue& a, ParamValue& b) noexcept
217  {
218  auto tmp = std::move(a);
219  a = std::move(b);
220  b = std::move(tmp);
221  }
222 
223  // Use with extreme caution! This is just doing a cast. You'd better
224  // be really sure you are asking for the right type. Note that for
225  // "string" data, you can get<ustring> or get<char*>, but it's not
226  // a std::string.
227  template<typename T> const T& get(int i = 0) const noexcept
228  {
229  return (reinterpret_cast<const T*>(data()))[i];
230  }
231 
232  /// Retrieve an integer, with conversions from a wide variety of type
233  /// cases, including unsigned, short, byte. Not float. It will retrieve
234  /// from a string, but only if the string is entirely a valid int
235  /// format. Unconvertible types return the default value.
236  int get_int(int defaultval = 0) const;
237  int get_int_indexed(int index, int defaultval = 0) const;
238 
239  /// Retrieve a float, with conversions from a wide variety of type
240  /// cases, including integers. It will retrieve from a string, but only
241  /// if the string is entirely a valid float format. Unconvertible types
242  /// return the default value.
243  float get_float(float defaultval = 0) const;
244  float get_float_indexed(int index, float defaultval = 0) const;
245 
246  /// Convert any type to a string value. An optional maximum number of
247  /// elements is also passed. In the case of a single string, just the
248  /// string directly is returned. But for an array of strings, the array
249  /// is returned as one string that's a comma-separated list of double-
250  /// quoted, escaped strings. For an array or aggregate, at most `maxsize`
251  /// elements are returned (if `maxsize` is 0, all elements are returned,
252  /// no matter how large it is).
253  std::string get_string(int maxsize = 64) const;
254  std::string get_string_indexed(int index) const;
255  /// Convert any type to a ustring value. An optional maximum number of
256  /// elements is also passed. Same behavior as get_string, but returning a
257  /// ustring. For an array or aggregate, at most `maxsize` elements are
258  /// returned (if `maxsize` is 0, all elements are returned, no matter how
259  /// large it is).
260  ustring get_ustring(int maxsize = 64) const;
261  ustring get_ustring_indexed(int index) const;
262 
263 private:
264  ustring m_name; ///< data name
265  TypeDesc m_type; ///< data type, which may itself be an array
266  union {
267  char localval[16];
268  const void* ptr;
269  } m_data; ///< Our data, either a pointer or small local value
270  int m_nvalues = 0; ///< number of values of the given type
271  unsigned char m_interp = INTERP_CONSTANT; ///< Interpolation type
272  bool m_copy = false;
273  bool m_nonlocal = false;
274 
275  void init_noclear(ustring _name, TypeDesc _type, int _nvalues,
276  const void* _value, Copy _copy = Copy(true),
277  FromUstring _from_ustring = FromUstring(false)) noexcept;
278  void init_noclear(ustring _name, TypeDesc _type, int _nvalues,
279  Interp _interp, const void* _value,
280  Copy _copy = Copy(true),
281  FromUstring _from_ustring = FromUstring(false)) noexcept;
282  void clear_value() noexcept;
283 };
284 
285 
286 
287 /// A list of ParamValue entries, that can be iterated over or searched.
288 /// It's really just a std::vector<ParamValue>, but with a few more handy
289 /// methods.
291 public:
293 
294  /// Add space for one more ParamValue to the list, and return a
295  /// reference to its slot.
297  {
298  resize(size() + 1);
299  return back();
300  }
301 
302  /// Find the first entry with matching name, and if type != UNKNOWN,
303  /// then also with matching type. The name search is case sensitive if
304  /// casesensitive == true.
306  bool casesensitive = true);
308  bool casesensitive = true);
310  bool casesensitive = true) const;
311  const_iterator find(ustring name, TypeDesc type = TypeDesc::UNKNOWN,
312  bool casesensitive = true) const;
313 
314  /// Search for the first entry with matching name, etc., and return
315  /// a pointer to it, or nullptr if it is not found.
317  bool casesensitive = true)
318  {
319  iterator f = find(name, type, casesensitive);
320  return f != end() ? &(*f) : nullptr;
321  }
322  const ParamValue* find_pv(string_view name,
324  bool casesensitive = true) const
325  {
326  const_iterator f = find(name, type, casesensitive);
327  return f != cend() ? &(*f) : nullptr;
328  }
329 
330  /// Case insensitive search for an integer, with default if not found.
331  /// Automatically will return an int even if the data is really
332  /// unsigned, short, or byte, but not float. It will retrieve from a
333  /// string, but only if the string is entirely a valid int format.
334  int get_int(string_view name, int defaultval = 0,
335  bool casesensitive = false, bool convert = true) const;
336 
337  /// Case insensitive search for a float, with default if not found.
338  /// Automatically will return a float even if the data is really double
339  /// or half. It will retrieve from a string, but only if the string is
340  /// entirely a valid float format.
341  float get_float(string_view name, float defaultval = 0,
342  bool casesensitive = false, bool convert = true) const;
343 
344  /// Simple way to get a string attribute, with default provided.
345  /// If the value is another type, it will be turned into a string.
346  string_view get_string(string_view name,
347  string_view defaultval = string_view(),
348  bool casesensitive = false,
349  bool convert = true) const;
350  ustring get_ustring(string_view name,
351  string_view defaultval = string_view(),
352  bool casesensitive = false, bool convert = true) const;
353 
354  /// Remove the named parameter, if it is in the list.
356  bool casesensitive = true);
357 
358  /// Does the list contain the named attribute?
360  bool casesensitive = true) const;
361 
362  // Add the param to the list, replacing in-place any existing one with
363  // the same name.
364  void add_or_replace(const ParamValue& pv, bool casesensitive = true);
365  void add_or_replace(ParamValue&& pv, bool casesensitive = true);
366 
367  /// Add (or replace) a value in the list.
368  void attribute(string_view name, TypeDesc type, int nvalues,
369  const void* value)
370  {
371  if (!name.empty())
372  add_or_replace(ParamValue(name, type, nvalues, value));
373  }
374 
375  void attribute(string_view name, TypeDesc type, const void* value)
376  {
377  attribute(name, type, 1, value);
378  }
379 
380  /// Set directly from string -- parse if type is non-string.
382  {
383  if (!name.empty())
384  add_or_replace(ParamValue(name, type, value));
385  }
386 
387  // Shortcuts for single value of common types.
388  void attribute(string_view name, int value)
389  {
390  attribute(name, TypeInt, 1, &value);
391  }
392  void attribute(string_view name, unsigned int value)
393  {
394  attribute(name, TypeUInt, 1, &value);
395  }
396  void attribute(string_view name, float value)
397  {
398  attribute(name, TypeFloat, 1, &value);
399  }
401  {
402  ustring v(value);
403  attribute(name, TypeString, 1, &v);
404  }
405 
407  {
408  if (!name.empty())
409  add_or_replace(ParamValue(name, value));
410  }
411 
412  /// Search list for named item, return its type or TypeUnknown if not
413  /// found.
415  bool casesensitive = false) const
416  {
417  auto p = find(name, TypeUnknown, casesensitive);
418  return p != cend() ? p->type() : TypeUnknown;
419  }
420 
421  /// Retrieve from list: If found its data type is reasonably convertible
422  /// to `type`, copy/convert the value into val[...] and return true.
423  /// Otherwise, return false and don't modify what val points to.
424  bool getattribute(string_view name, TypeDesc type, void* value,
425  bool casesensitive = false) const;
426  /// Shortcut for retrieving a single string via getattribute.
427  bool getattribute(string_view name, std::string& value,
428  bool casesensitive = false) const;
429 
430  /// Retrieve from list: If found its data type is reasonably convertible
431  /// to `type`, copy/convert the value into val[...] and return true.
432  /// Otherwise, return false and don't modify what val points to.
433  bool getattribute_indexed(string_view name, int index, TypeDesc type,
434  void* value, bool casesensitive = false) const;
435  /// Shortcut for retrieving a single string via getattribute.
436  bool getattribute_indexed(string_view name, int index, std::string& value,
437  bool casesensitive = false) const;
438 
439  /// Sort alphabetically, optionally case-insensitively, locale-
440  /// independently, and with all the "un-namespaced" items appearing
441  /// first, followed by items with "prefixed namespaces" (e.g. "z" comes
442  /// before "foo:a").
443  void sort(bool casesensitive = true);
444 
445  /// Merge items from PVL `other` into `*this`. Note how this differs
446  /// from `operator=` : assignment completely replaces the list with
447  /// the contents of another. But merge() adds the other items without
448  /// erasing any items already in this list.
449  ///
450  /// @param other
451  /// The ParamValueList whose entries will be merged into this one.
452  /// @param override
453  /// If true, `other` attributes will replace any identically-named
454  /// attributes already in this list. If false, only attributes whose
455  /// names are not already in this list will be appended.
456  void merge(const ParamValueList& other, bool override = false);
457 
458  /// Even more radical than clear, free ALL memory associated with the
459  /// list itself.
460  void free()
461  {
462  clear();
463  shrink_to_fit();
464  }
465 
466  /// Array indexing by integer will return a reference to the ParamValue
467  /// in that position of the list.
468  ParamValue& operator[](int index)
469  {
470  return std::vector<ParamValue>::operator[](index);
471  }
472  const ParamValue& operator[](int index) const
473  {
474  return std::vector<ParamValue>::operator[](index);
475  }
476 
477  /// Array indexing by string will create a "Delegate" that enables a
478  /// convenient shorthand for adding and retrieving values from the list:
479  ///
480  /// 1. Assigning to the delegate adds a ParamValue to the list:
481  /// ParamValueList list;
482  /// list["foo"] = 42; // adds integer
483  /// list["bar"] = 39.8f; // adds float
484  /// list["baz"] = "hello"; // adds string
485  /// Be very careful, the attribute's type will be implied by the C++
486  /// type of what you assign.
487  ///
488  /// 2. The delegate supports a get<T>() that retrieves an item of type T:
489  /// int i = list["foo"].get<int>();
490  /// std::string s = list["baz"].get<std::string>();
491  ///
493  {
494  return { this, name };
495  }
497  {
498  return { this, name };
499  }
500 };
501 
502 
503 
~ParamValue() noexcept
Definition: paramlist.h:144
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
AttrDelegate< const ParamValueList > operator[](string_view name) const
Definition: paramlist.h:492
int datasize() const noexcept
Definition: paramlist.h:208
ParamValue(const ParamValue &p, Copy _copy) noexcept
Definition: paramlist.h:128
void attribute(string_view name, string_view value)
Definition: paramlist.h:400
reference grow()
Definition: paramlist.h:296
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:632
GLboolean * data
Definition: glcorearb.h:131
const GLdouble * v
Definition: glcorearb.h:837
ParamValue(string_view _name, TypeDesc _type, int _nvalues, Interp _interp, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:90
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void attribute(string_view name, TypeDesc type, string_view value)
Set directly from string – parse if type is non-string.
Definition: paramlist.h:381
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
unknown type
Definition: typedesc.h:57
ParamValue(string_view _name, ustring value) noexcept
Definition: paramlist.h:104
PUGI__FN void sort(I begin, I end, const Pred &pred)
Definition: pugixml.cpp:7550
ParamValue * find_pv(string_view name, TypeDesc type=TypeDesc::UNKNOWN, bool casesensitive=true)
Definition: paramlist.h:316
ParamValue(const ustring &_name, TypeDesc _type, int _nvalues, Interp _interp, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:79
Tto convert(const Tfrom &source)
ParamValue(string_view _name, int value) noexcept
Definition: paramlist.h:96
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2138
The hash of a ustring.
Definition: typedesc.h:86
#define OIIO_UTIL_API
Definition: export.h:71
void attribute(string_view name, int value)
Definition: paramlist.h:388
OIIO_INLINE_CONSTEXPR TypeDesc TypeInt(TypeDesc::INT)
basic_string_view< char > string_view
Definition: core.h:501
OIIO_INLINE_CONSTEXPR TypeDesc TypeUnknown(TypeDesc::UNKNOWN)
const ParamValue * find_pv(string_view name, TypeDesc type=TypeDesc::UNKNOWN, bool casesensitive=true) const
Definition: paramlist.h:322
OIIO_INLINE_CONSTEXPR TypeDesc TypeUInt(TypeDesc::UINT)
void attribute(string_view name, ustring value)
Definition: paramlist.h:406
void attribute(string_view name, unsigned int value)
Definition: paramlist.h:392
GLfloat f
Definition: glcorearb.h:1926
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
void attribute(string_view name, TypeDesc type, int nvalues, const void *value)
Add (or replace) a value in the list.
Definition: paramlist.h:368
int nvalues() const noexcept
Definition: paramlist.h:203
OIIO_INLINE_CONSTEXPR TypeDesc TypeFloat(TypeDesc::FLOAT)
ParamValue(ParamValue &&p) noexcept
Definition: paramlist.h:135
void init(ustring _name, TypeDesc _type, int _nvalues, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:177
GLuint GLuint end
Definition: glcorearb.h:475
friend void swap(ParamValue &a, ParamValue &b) noexcept
Definition: paramlist.h:216
const void * data() const noexcept
Definition: paramlist.h:204
ParamValue(string_view _name, ustringhash value) noexcept
Definition: paramlist.h:113
void init(string_view _name, TypeDesc _type, int _nvalues, Interp _interp, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:187
ParamValue(string_view _name, string_view value) noexcept
Definition: paramlist.h:109
const ParamValue & operator[](int index) const
Definition: paramlist.h:472
GLuint const GLchar * name
Definition: glcorearb.h:786
ParamValue & operator[](int index)
Definition: paramlist.h:468
OIIO_INLINE_CONSTEXPR TypeDesc TypeString(TypeDesc::STRING)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
void attribute(string_view name, TypeDesc type, const void *value)
Definition: paramlist.h:375
TypeDesc getattributetype(string_view name, bool casesensitive=false) const
Definition: paramlist.h:414
void init(string_view _name, TypeDesc _type, int _nvalues, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:182
const ustring & uname() const noexcept
Definition: paramlist.h:201
Character string.
Definition: typedesc.h:84
#define OIIO_STRONG_PARAM_TYPE(Name, Basetype)
Definition: strongparam.h:118
GLsizeiptr size
Definition: glcorearb.h:664
OIIO_API bool getattribute(string_view name, TypeDesc type, void *val)
bool is_nonlocal() const noexcept
Definition: paramlist.h:214
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
ParamValue(string_view _name, float value) noexcept
Definition: paramlist.h:100
void attribute(string_view name, float value)
Definition: paramlist.h:396
TypeDesc type() const noexcept
Definition: paramlist.h:202
ParamValue() noexcept
Definition: paramlist.h:47
void interp(Interp i) noexcept
Definition: paramlist.h:213
LeafData & operator=(const LeafData &)=delete
GLuint index
Definition: glcorearb.h:786
AttrDelegate< ParamValueList > operator[](string_view name)
Definition: paramlist.h:496
void init(ustring _name, TypeDesc _type, int _nvalues, Interp _interp, const void *_value, Copy _copy) noexcept
Definition: paramlist.h:171
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
ParamValue(const ParamValue &p) noexcept
Definition: paramlist.h:123
ParamValue(string_view _name, TypeDesc _type, int _nvalues, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:85
OutGridT XformOp bool bool MergePolicy merge
#define OIIO_NAMESPACE_END
Definition: oiioversion.h:127
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate and *a name There is also one special expression reference
constexpr bool empty() const noexcept
Is the basic_string_view empty, containing no characters?
Definition: string_view.h:209
ParamValue(const ustring &_name, TypeDesc _type, int _nvalues, const void *_value, Copy _copy=Copy(true)) noexcept
Definition: paramlist.h:74
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
const void * ptr
Definition: paramlist.h:268
Interp interp() const noexcept
Definition: paramlist.h:212
#define OIIO_NAMESPACE_BEGIN
Definition: oiioversion.h:126