6#ifndef MATERIALX_GENUSERDATA_H
7#define MATERIALX_GENUSERDATA_H
14MATERIALX_NAMESPACE_BEGIN
26class MX_GENSHADER_API
GenUserData :
public std::enable_shared_from_this<GenUserData>
34 return shared_from_this();
40 return shared_from_this();
44 template <
class T> shared_ptr<T>
asA()
46 return std::dynamic_pointer_cast<T>(getSelf());
50 template <
class T> shared_ptr<const T>
asA()
const
52 return std::dynamic_pointer_cast<const T>(getSelf());
59MATERIALX_NAMESPACE_END
std::shared_ptr< const GenUserData > ConstGenUserDataPtr
Shared pointer to a constant GenUserData.
Definition: GenUserData.h:22
std::shared_ptr< GenUserData > GenUserDataPtr
Shared pointer to a GenUserData.
Definition: GenUserData.h:19
Macros for declaring imported and exported symbols.
Base class for custom user data needed during shader generation.
Definition: GenUserData.h:27
shared_ptr< const T > asA() const
Return this object cast to a templated type.
Definition: GenUserData.h:50
ConstGenUserDataPtr getSelf() const
Return a shared pointer for this object.
Definition: GenUserData.h:38
shared_ptr< T > asA()
Return this object cast to a templated type.
Definition: GenUserData.h:44
GenUserDataPtr getSelf()
Return a shared pointer for this object.
Definition: GenUserData.h:32