Loading...
Searching...
No Matches
pluginRenderDelegateUniqueHandle.h
1//
2// Copyright 2020 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_PLUGIN_RENDER_DELEGATE_UNIQUE_HANDLE_H
8#define PXR_IMAGING_HD_PLUGIN_RENDER_DELEGATE_UNIQUE_HANDLE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/rendererPluginHandle.h"
13
14#include <cstddef>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18class HdRenderDelegate;
19
31{
32public:
33 HdPluginRenderDelegateUniqueHandle() : _delegate(nullptr) { }
34 HdPluginRenderDelegateUniqueHandle(const std::nullptr_t &)
35 : _delegate(nullptr) { }
36
38 HD_API
40
41 HD_API
43
45 HD_API
48
49 HD_API
51 const std::nullptr_t &);
52
54 HdRenderDelegate *Get() const { return _delegate; }
55
56 HdRenderDelegate *operator->() const { return _delegate; }
57 HdRenderDelegate &operator*() const { return *_delegate; }
58
60 explicit operator bool() const { return _delegate; }
61
63 HD_API
65
66private:
67 friend class HdRendererPlugin;
68
70 const HdRendererPluginHandle &plugin, HdRenderDelegate * delegate)
71 : _plugin(plugin), _delegate(delegate) { }
72
74 HdRenderDelegate *_delegate;
75};
76
77PXR_NAMESPACE_CLOSE_SCOPE
78
79#endif
A (movable) handle for a render delegate that was created using a a plugin.
HD_API TfToken GetPluginId() const
Get the id of the plugin used to create render delegate.
HdRenderDelegate * Get() const
Get render delegate.
HD_API HdPluginRenderDelegateUniqueHandle(HdPluginRenderDelegateUniqueHandle &&)
Transfer ownership.
HD_API HdPluginRenderDelegateUniqueHandle & operator=(HdPluginRenderDelegateUniqueHandle &&)
Transfer ownership.
A handle for HdRendererPlugin also storing the plugin id.
This class defines a renderer plugin interface for Hydra.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71