24 #ifndef PXR_BASE_TF_PY_WRAP_CONTEXT_H
25 #define PXR_BASE_TF_PY_WRAP_CONTEXT_H
31 #include <boost/noncopyable.hpp>
36 PXR_NAMESPACE_OPEN_SCOPE
40 class Tf_PyWrapContextManager :
public boost::noncopyable {
44 typedef Tf_PyWrapContextManager This;
46 static This &GetInstance() {
50 std::string GetCurrentContext()
const {
51 return _contextStack.empty() ? std::string() : _contextStack.back();
54 void PushContext(std::string
const &ctx) {
55 _contextStack.push_back(ctx);
59 _contextStack.pop_back();
64 Tf_PyWrapContextManager();
68 std::vector<std::string> _contextStack;
71 PXR_NAMESPACE_CLOSE_SCOPE
73 #endif // PXR_BASE_TF_PY_WRAP_CONTEXT_H
Manage a single instance of an object.
Manage a single instance of an object (see.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.