HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
thisPlugin.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_PLUG_THIS_PLUGIN_H
8 #define PXR_BASE_PLUG_THIS_PLUGIN_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/base/plug/registry.h"
13 
15 
16 /// The name of the current library registered with the plugin system. This
17 /// may be used to lookup the current library in the plugin registry.
18 /// This uses the value of the MFB_PACKAGE_NAME macro defined at compile-time
19 /// unless overridden.
20 #ifndef PLUG_THIS_PLUGIN_NAME
21 #define PLUG_THIS_PLUGIN_NAME MFB_PACKAGE_NAME
22 #endif
23 
24 /// Returns a plugin registered with the name of the current library (as
25 /// defined by PLUG_THIS_PLUGIN_NAME). Note that plugin registration occurs as a
26 /// side effect of using this macro, at the point in time the code at the
27 /// macro site is invoked.
28 #define PLUG_THIS_PLUGIN \
29  PlugRegistry::GetInstance().GetPluginWithName(\
30  TF_PP_STRINGIZE(PLUG_THIS_PLUGIN_NAME))
31 
33 
34 #endif // PXR_BASE_PLUG_THIS_PLUGIN_H
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74