HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
expiryNotifier.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_BASE_TF_EXPIRY_NOTIFIER_H
8 #define PXR_BASE_TF_EXPIRY_NOTIFIER_H
9 
10 /// \file tf/expiryNotifier.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/base/arch/hints.h"
14 #include "pxr/base/tf/api.h"
15 
17 
18 /// \class Tf_ExpiryNotifier
19 ///
20 /// Set the extra notifier function.
21 ///
22 /// Objects derived from \c TfWeakBase can request that extra notification be
23 /// performed when they expire. Objects that do not request extra
24 /// notification do not suffer any performance penalty when they expire, while
25 /// objects that request the notification will have the extra notifier
26 /// function run on them, with the address returned by \c
27 /// TfWeakPtr::GetUniqueIdentifier() passed to the notifier function.
28 ///
29 /// An object requests extra notification be performed by calling \c
30 /// wp.RequestExtraNotification() where \c wp is a \c TfWeakPtr pointing to
31 /// the object in question.
32 ///
33 /// This functions sets the extra notifier function to \p func. At present,
34 /// this notifier is intended to be used only by the scripting system to
35 /// inform the system that a particular object has expired and scripting
36 /// resources devoted to that object can be discarded. Accordingly, if
37 /// \p func is non-NULL and a previous non-NULL notifier function has been
38 /// set, a fatal error is issued.
40 public:
41  TF_API static void Invoke(void const *p);
42  TF_API static void SetNotifier(void (*func)(void const *));
43 
44  TF_API static void Invoke2(void const *p);
45  TF_API static void SetNotifier2(void (*func)(void const *));
46 private:
47 
48  static void (*_func)(void const *);
49  static void (*_func2)(void const *);
50 };
51 
53 
54 #endif
#define TF_API
Definition: api.h:23
void
Definition: png.h:1083
static TF_API void SetNotifier2(void(*func)(void const *))
static TF_API void Invoke2(void const *p)
GLenum func
Definition: glcorearb.h:783
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static TF_API void Invoke(void const *p)
static TF_API void SetNotifier(void(*func)(void const *))