7#ifndef PXR_BASE_TF_PY_WRAP_CONTEXT_H
8#define PXR_BASE_TF_PY_WRAP_CONTEXT_H
17PXR_NAMESPACE_OPEN_SCOPE
21class Tf_PyWrapContextManager {
22 Tf_PyWrapContextManager(
const Tf_PyWrapContextManager&) =
delete;
23 Tf_PyWrapContextManager&
24 operator=(
const Tf_PyWrapContextManager&) =
delete;
28 typedef Tf_PyWrapContextManager This;
30 static This &GetInstance() {
34 std::string GetCurrentContext()
const {
35 return _contextStack.empty() ? std::string() : _contextStack.back();
38 void PushContext(std::string
const &ctx) {
39 _contextStack.push_back(ctx);
43 _contextStack.pop_back();
48 Tf_PyWrapContextManager();
52 std::vector<std::string> _contextStack;
55PXR_NAMESPACE_CLOSE_SCOPE
Manage a single instance of an object (see.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Manage a single instance of an object.