Loading...
Searching...
No Matches
cacheView.h
1//
2// Copyright 2025 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_EXEC_EXEC_CACHE_VIEW_H
8#define PXR_EXEC_EXEC_CACHE_VIEW_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/exec/exec/api.h"
13
14#include "pxr/base/tf/span.h"
15#include "pxr/exec/vdf/dataManagerFacade.h"
16
17#include <memory>
18#include <optional>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
22class Exec_ValueExtractor;
24class VdfMaskedOutput;
25class VtValue;
26
34{
35public:
37 Exec_CacheView() = default;
38
40 Exec_CacheView(const Exec_CacheView &) = delete;
41
46 EXEC_API
48
49 EXEC_API
51
57 EXEC_API
58 VtValue Get(int index) const;
59
60private:
61 friend class Exec_RequestImpl;
62
63 // Constructs a cache view that extracts computed values from
64 // \p dataManager. The data manager must outlive the cache view.
66 const VdfDataManagerFacade dataManager,
69
70 // Constructs a cache view that assumes ownership of an \p executor, so that
71 // it remains valid while computed values are extracted from it.
73 std::unique_ptr<VdfExecutorInterface> &&executor,
76
77private:
78 std::optional<const VdfDataManagerFacade> _dataManager;
79 const TfSpan<const VdfMaskedOutput> _outputs;
80 const TfSpan<const Exec_ValueExtractor> _extractors;
81 std::unique_ptr<VdfExecutorInterface> _executor;
82};
83
84PXR_NAMESPACE_CLOSE_SCOPE
85
86#endif
A view into values cached by ExecSystem.
Definition: cacheView.h:34
Exec_CacheView()=default
Constructs an invalid cache view.
EXEC_API VtValue Get(int index) const
Returns the computed value for the provided extraction index.
EXEC_API Exec_CacheView(Exec_CacheView &&other)
Constructs a cache view from another.
Exec_CacheView(const Exec_CacheView &)=delete
Exec_CacheView is move-only.
Contains data structures necessary to implement exec requests that are independent of scene descripti...
Definition: requestImpl.h:47
Represents a range of contiguous elements.
Definition: span.h:71
Facade that gives clients access to values cached on an executor, without exposing the entire VdfExec...
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values.
Class to hold on to an externally owned output and a mask.
Definition: maskedOutput.h:32
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90