24 #ifndef PXR_BASE_TF_PY_NOTICE_WRAPPER_H
25 #define PXR_BASE_TF_PY_NOTICE_WRAPPER_H
36 #include <hboost/python/bases.hpp>
37 #include <hboost/python/class.hpp>
38 #include <hboost/python/extract.hpp>
39 #include <hboost/python/handle.hpp>
41 #include <type_traits>
55 (*_generators)[
typeid(
T).
name()] = This::_Generate<T>;
80 template <
class Notice>
84 using namespace hboost::python;
86 Notice
const *wrapper =
static_cast<Notice
const *
>(objPtr);
87 return wrapper ?
object(wrapper->GetNoticePythonObject()) :
object();
91 template <
typename NoticeType,
typename BaseType>
96 "Notice type must be derived from or equal to TfNotice.");
100 "BaseType type must be derived from or equal to TfNotice.");
105 "BaseType type must be a base of notice, unless both "
106 "BaseType and Notice type are equal to TfNotice.");
115 hboost::python::bases<>,
116 hboost::python::bases<BaseType>>;
118 typedef hboost::python::class_<NoticeType, This, Bases>
ClassType;
122 if (wrappedName.empty()) {
124 wrappedName = TfType::Find<NoticeType>().GetTypeName();
128 Tf_PyNoticeObjectGenerator::Register<NoticeType>();
132 return ClassType(wrappedName.c_str(), hboost::python::no_init)
139 return hboost::python::handle<>(hboost::python::borrowed(_self));
144 template <
typename... Args>
146 : NoticeType(
args...)
154 #define TF_INSTANTIATE_NOTICE_WRAPPER(T, Base) \
155 TF_REGISTRY_FUNCTION(TfType) \
157 TfType::Define< TfPyNoticeWrapper<T, Base>, \
158 TfType::Bases<Base> >(); \
163 #endif // PXR_BASE_TF_PY_NOTICE_WRAPPER_H
TF_API std::string TfStringGetSuffix(const std::string &name, char delimiter= '.')
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
TfPyNoticeWrapper(PyObject *self, Args...args)
virtual ~Tf_PyNoticeObjectFinder()
TF_API void Tf_RegisterPythonObjectFinderInternal(std::type_info const &type, Tf_PyObjectFinderBase const *finder)
hboost::python::class_< NoticeType, This, Bases > ClassType
TfPyNoticeWrapper< NoticeType, BaseType > This
virtual hboost::python::object Find(void const *objPtr) const
static ClassType Wrap(std::string const &name=std::string())
Tf_PyNoticeObjectGenerator This
GLuint const GLchar * name
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
virtual hboost::python::handle GetNoticePythonObject() const
hboost::python::object(* MakeObjectFunc)(TfNotice const &)
#define PXR_NAMESPACE_CLOSE_SCOPE
**If you just want to fire and args
virtual TF_API ~TfPyNoticeWrapperBase()
static TF_API hboost::python::object Invoke(TfNotice const &n)
std::conditional_t< std::is_same< NoticeType, TfNotice >::value, hboost::python::bases<>, hboost::python::bases< BaseType >> Bases
virtual hboost::python::handle GetNoticePythonObject() const =0