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
pyWrapContext.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_PY_WRAP_CONTEXT_H
8
#define PXR_BASE_TF_PY_WRAP_CONTEXT_H
9
10
#include "
pxr/pxr.h
"
11
12
#include "
pxr/base/tf/singleton.h
"
13
14
#include <string>
15
#include <vector>
16
17
PXR_NAMESPACE_OPEN_SCOPE
18
19
// This is used internally by the Tf python wrapping infrastructure.
20
21
class
Tf_PyWrapContextManager
{
22
Tf_PyWrapContextManager
(
const
Tf_PyWrapContextManager
&) =
delete
;
23
Tf_PyWrapContextManager
&
24
operator=(
const
Tf_PyWrapContextManager
&) =
delete
;
25
26
public
:
27
28
typedef
Tf_PyWrapContextManager
This
;
29
30
static
This
&
GetInstance
() {
31
return
TfSingleton<This>::GetInstance
();
32
}
33
34
std::string
GetCurrentContext
()
const
{
35
return
_contextStack.empty() ? std::string() : _contextStack.back();
36
}
37
38
void
PushContext
(std::string
const
&ctx) {
39
_contextStack.push_back(ctx);
40
}
41
42
void
PopContext
() {
43
_contextStack.pop_back();
44
}
45
46
private
:
47
48
Tf_PyWrapContextManager
();
49
50
friend
class
TfSingleton
<
This
>;
51
52
std::vector<std::string> _contextStack;
53
};
54
55
PXR_NAMESPACE_CLOSE_SCOPE
56
57
#endif // PXR_BASE_TF_PY_WRAP_CONTEXT_H
TfSingleton::GetInstance
static T & GetInstance()
Definition:
singleton.h:120
singleton.h
TfSingleton
Definition:
singleton.h:105
Tf_PyWrapContextManager::GetInstance
static This & GetInstance()
Definition:
pyWrapContext.h:30
Tf_PyWrapContextManager
Definition:
pyWrapContext.h:21
Tf_PyWrapContextManager::This
Tf_PyWrapContextManager This
Definition:
pyWrapContext.h:28
pxr.h
Tf_PyWrapContextManager::PopContext
void PopContext()
Definition:
pyWrapContext.h:42
Tf_PyWrapContextManager::PushContext
void PushContext(std::string const &ctx)
Definition:
pyWrapContext.h:38
Tf_PyWrapContextManager::GetCurrentContext
std::string GetCurrentContext() const
Definition:
pyWrapContext.h:34
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1425
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
pxr
base
tf
pyWrapContext.h
Generated on Thu Sep 4 2025 02:38:58 for HDK by
1.8.6