HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributeQuery.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  * COMMENTS:
7  */
8 
9 #ifndef __PDG_ATTRIBUTE_QUERY_H__
10 #define __PDG_ATTRIBUTE_QUERY_H__
11 
12 #include "PDG_API.h"
13 
14 #include <UT/UT_Array.h>
15 #include <UT/UT_StringHolder.h>
16 
17 class UT_WorkBuffer;
18 
19 /**
20  * Stores a list of parsed attribute query tokens, to speed up evaluation
21  * when matching the same query across multiple parm expression evaluations
22  */
24 {
25 public:
26  /// Query entry, with a pre-parsed integer value to avoid having to
27  /// parse the string each time the query is applied to an attribute.
28  struct Entry
29  {
33  };
34 
36 
37  /// Constructs an empty query, which can be initialized later from a
38  /// string
40 
41  /// Constructs a new query from an input string in the form
42  /// first.second.3.third... etc
43  explicit PDG_AttributeQuery(
44  const char* query_string);
45 
46  /// Builds a query from the specified string
47  void initialize(const char* query_string);
48 
49  /// Returns the parsed entries
50  const EntryArray& entries() const
51  { return myQueryEntries; }
52 
53  /// Returns the size of the query
54  exint size() const
55  { return myQueryEntries.size(); }
56 
57  /// Returns the raw query string
58  const UT_StringHolder& query() const
59  { return myQueryString; }
60 
61  /// Returns the query string up to the specified index
62  UT_StringHolder queryIndex(exint index) const;
63 
64 private:
65  UT_StringHolder myQueryString;
66  EntryArray myQueryEntries;
67 };
68 
69 #endif
#define PDG_API
Definition: PDG_API.h:23
UT_StringHolder myString
int64 exint
Definition: SYS_Types.h:125
exint myInteger
bool myHasInteger
exint size() const
Returns the size of the query.
const UT_StringHolder & query() const
Returns the raw query string.
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
GLuint index
Definition: glcorearb.h:786
const EntryArray & entries() const
Returns the parsed entries.