HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
notice.h
Go to the documentation of this file.
1
//
2
// Copyright 2021 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_USD_AR_NOTICE_H
8
#define PXR_USD_AR_NOTICE_H
9
10
#include "
pxr/pxr.h
"
11
12
#include "
pxr/usd/ar/api.h
"
13
#include "
pxr/usd/ar/resolverContext.h
"
14
15
#include "
pxr/base/tf/notice.h
"
16
17
#include <functional>
18
19
PXR_NAMESPACE_OPEN_SCOPE
20
21
template
<
class
ContextObj>
22
bool
Ar_ContextIsHolding
(
23
const
ContextObj& contextObj,
const
ArResolverContext
& ctx)
24
{
25
const
ContextObj* testObj = ctx.
Get
<ContextObj>();
26
return
testObj && *testObj == contextObj;
27
}
28
29
/// \class ArNotice
30
///
31
class
ArNotice
32
{
33
public
:
34
/// \class ResolverNotice
35
/// Base class for all ArResolver-related notices.
36
class
ResolverNotice
37
:
public
TfNotice
38
{
39
public
:
40
AR_API
virtual
~ResolverNotice
();
41
protected
:
42
AR_API
ResolverNotice
();
43
};
44
45
/// \class ResolverChanged
46
/// Notice sent when asset paths may resolve to a different path than
47
/// before due to a change in the resolver.
48
class
ResolverChanged
49
:
public
ResolverNotice
50
{
51
public
:
52
/// Create a notice indicating that the results of asset resolution
53
/// might have changed, regardless of what ArResolverContext object
54
/// is bound.
55
AR_API
56
ResolverChanged
();
57
58
/// Create a notice using \p affectsFn to determine the
59
/// ArResolverContext objects that are affected by this resolver
60
/// change. If \p affectsFn returns true, it means the results of asset
61
/// resolution when the given ArResolverContext is bound might have
62
/// changed.
63
AR_API
64
ResolverChanged
(
65
const
std::function<
bool
(
const
ArResolverContext
&)>& affectsFn);
66
67
/// Create a notice indicating that the results of asset resolution when
68
/// any ArResolverContext containing \p contextObj is bound might have
69
/// changed.
70
template
<
71
class
ContextObj,
72
typename
std::enable_if<ArIsContextObject<ContextObj>::value
>
::type
*
73
=
nullptr
>
74
ResolverChanged
(
75
const
ContextObj& contextObj)
76
// XXX: Ideally this would just use a lambda and forward it to
77
// the other c'tor. Both of those cause issues in MSVC 2015; the
78
// first causes an unspecified type error and the second causes
79
// odd linker errors.
80
: _affects(std::bind(&
Ar_ContextIsHolding
<ContextObj>, contextObj,
81
std::placeholders::_1))
82
{
83
}
84
85
AR_API
86
virtual
~ResolverChanged
();
87
88
/// Returns true if the results of asset resolution when \p ctx
89
/// is bound may be affected by this resolver change.
90
AR_API
91
bool
AffectsContext
(
const
ArResolverContext
& ctx)
const
;
92
93
private
:
94
std::function<bool(const ArResolverContext&)> _affects;
95
};
96
97
};
98
99
PXR_NAMESPACE_CLOSE_SCOPE
100
101
#endif
TfNotice
Definition:
notice.h:77
ArResolverContext::Get
const ContextObj * Get() const
Definition:
resolverContext.h:161
ArNotice::ResolverChanged::ResolverChanged
AR_API ResolverChanged()
value
GLsizei const GLfloat * value
Definition:
glcorearb.h:824
ArNotice::ResolverNotice::~ResolverNotice
virtual AR_API ~ResolverNotice()
ArNotice::ResolverChanged::ResolverChanged
ResolverChanged(const ContextObj &contextObj)
Definition:
notice.h:74
AR_API
#define AR_API
Definition:
api.h:23
ArNotice::ResolverNotice
Definition:
notice.h:36
ArNotice::ResolverChanged::AffectsContext
AR_API bool AffectsContext(const ArResolverContext &ctx) const
resolverContext.h
type
GLint GLint GLsizei GLint GLenum GLenum type
Definition:
glcorearb.h:108
api.h
pxr.h
ArNotice::ResolverChanged::~ResolverChanged
virtual AR_API ~ResolverChanged()
ArNotice::ResolverChanged
Definition:
notice.h:48
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1425
notice.h
ArNotice::ResolverNotice::ResolverNotice
AR_API ResolverNotice()
ArNotice
Definition:
notice.h:31
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
ArResolverContext
Definition:
resolverContext.h:107
Ar_ContextIsHolding
PXR_NAMESPACE_OPEN_SCOPE bool Ar_ContextIsHolding(const ContextObj &contextObj, const ArResolverContext &ctx)
Definition:
notice.h:22
pxr
usd
ar
notice.h
Generated on Wed Oct 15 2025 02:35:33 for HDK by
1.8.6