All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sortedIds.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_SORTED_IDS_H
8#define PXR_IMAGING_HD_SORTED_IDS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12
13#include "pxr/usd/sdf/path.h"
14
15#include <memory>
16
17PXR_NAMESPACE_OPEN_SCOPE
18
25class Hd_SortedIds {
26public:
28 HD_API
29 Hd_SortedIds();
30
31 HD_API
32 ~Hd_SortedIds();
33
35 HD_API
36 Hd_SortedIds(Hd_SortedIds const &);
37
39 HD_API
40 Hd_SortedIds(Hd_SortedIds &&);
41
43 HD_API
44 Hd_SortedIds &operator=(Hd_SortedIds const &);
45
47 HD_API
48 Hd_SortedIds &operator=(Hd_SortedIds &&);
49
51 HD_API
52 const SdfPathVector &GetIds();
53
56 HD_API
57 void Insert(const SdfPath &id);
58
61 HD_API
62 void Remove(const SdfPath &id);
63
67 HD_API
68 void RemoveRange(size_t start, size_t end);
69
71 HD_API
72 void Clear();
73
74private:
75 class _UpdateImpl;
76
77 enum _EditMode { _NoMode, _InsertMode, _RemoveMode, _UpdateMode };
78
79 void _Sort();
80
81 SdfPathVector _ids;
82 SdfPathVector _edits;
83 _EditMode _mode = _NoMode;
84 std::unique_ptr<_UpdateImpl> _updater;
85};
86
87PXR_NAMESPACE_CLOSE_SCOPE
88
89#endif // PXR_IMAGING_HD_SORTED_IDS_H
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274