HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_ExpansionState.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_ExpansionState_h__
19 #define __HUSD_ExpansionState_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_Path.h"
23 #include "HUSD_PathSet.h"
24 #include <UT/UT_IntrusivePtr.h>
25 #include <UT/UT_NonCopyable.h>
26 #include <iosfwd>
27 
28 class UT_IStream;
29 class UT_JSONValue;
30 class UT_JSONWriter;
32 
34 
36  public UT_IntrusiveRefCounter<HUSD_ExpansionState>,
37  public UT_NonCopyable
38 {
39 public:
42 
44  { return myExpandedPinnedPaths; }
46  { return myExpandedScenePaths; }
47  void setExpanded(const HUSD_Path &path,
48  bool pinned,
49  bool expanded);
50 
51  exint getMemoryUsage() const;
52 
53  void clear();
54  void copy(const HUSD_ExpansionState &src);
55  bool save(std::ostream &os, bool binary) const;
56  bool load(UT_IStream &is);
57 
58 private:
59  bool save(UT_JSONWriter &writer,
60  const HUSD_PathSet &paths,
61  bool allow_saving_indirect_descendants,
62  HUSD_PathSet::iterator &iter) const;
63  bool load(const UT_JSONValue &value,
64  const HUSD_Path &path,
65  HUSD_PathSet &paths);
66 
67  HUSD_PathSet myExpandedPinnedPaths;
68  HUSD_PathSet myExpandedScenePaths;
69 };
70 
71 #endif
const HUSD_PathSet & expandedPinnedPaths() const
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int64 exint
Definition: SYS_Types.h:125
#define HUSD_API
Definition: HUSD_API.h:32
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
A reference counter base class for use with UT_IntrusivePtr.
UT_IntrusivePtr< HUSD_ExpansionState > HUSD_ExpansionStateHandle
Wrapper around hboost::intrusive_ptr.
const HUSD_PathSet & expandedScenePaths() const
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:99
Definition: core.h:1131
GLenum src
Definition: glcorearb.h:1793