HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pageCacheExecutor.h
Go to the documentation of this file.
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_EF_PAGE_CACHE_EXECUTOR_H
8 #define PXR_EXEC_EF_PAGE_CACHE_EXECUTOR_H
9 
10 ///\file
11 
12 #include "pxr/pxr.h"
13 
15 
19 
21 
22 ///////////////////////////////////////////////////////////////////////////////
23 ///
24 /// \class EfPageCacheExecutor
25 ///
26 /// \brief Executes a VdfNetwork to compute a requested set of values. Caches
27 /// the computed data in a EfPageCacheStorage container and recalls
28 /// existing data using a page specified via the currently set value
29 /// on the key output.
30 ///
31 /// This executor stores its data in the output-member data manager.
32 ///
33 template <
34  template <typename> class EngineType,
35  typename DataManagerType>
37  public EfPageCacheBasedExecutor<EngineType, DataManagerType>
38 {
39  // Base type definition.
41 
42  // The speculatino executor engine alias declaration, to be bound as a
43  // template template parameter.
44  template <typename T>
45  using SpeculationEngineType =
46  typename EngineType<T>::SpeculationExecutorEngine;
47 
48  // Executor factory.
49  typedef
53  _Factory;
54 
55 public:
56 
57  /// Constructor.
58  ///
59  explicit EfPageCacheExecutor(EfPageCacheStorage *cacheStorage) :
60  Base(cacheStorage)
61  {}
62 
63  /// Destructor.
64  ///
65  virtual ~EfPageCacheExecutor() {}
66 
67  /// Factory construction.
68  ///
69  virtual const VdfExecutorFactoryBase &GetFactory() const override final {
70  return _factory;
71  }
72 
73 private:
74 
75  // Clear all data in the local data manager.
76  //
77  virtual void _ClearData() override;
78 
79  // The factory shared amongst executors of this type.
80  //
81  static const _Factory _factory;
82 
83 };
84 
85 template <template <typename> class EngineType, typename DataManagerType>
88 
89 /* virtual */
90 template <template <typename> class EngineType, typename DataManagerType>
91 void
93 {
94  Base::_ClearData();
95  Base::_dataManager.Clear();
96 }
97 
99 
100 #endif
virtual const VdfExecutorFactoryBase & GetFactory() const overridefinal
Manages a page cache and provides methods for invalidation of cached values.
virtual ~EfPageCacheExecutor()
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Executor used in speculation.
Executes a VdfNetwork to compute a requested set of values. Caches the computed data in a EfPageCache...
EfPageCacheExecutor(EfPageCacheStorage *cacheStorage)
Executes a VdfNetwork to compute a requested set of values. Caches the computed data in a EfPageCache...
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74