14 #ifndef PI_PythonResourceTypes_H
15 #define PI_PythonResourceTypes_H
20 namespace PI_PythonResource
25 using ParmVariant = std::variant<int32, fpreal, UT_StringHolder>;
129 myDataArray.
append(
Elem(key,value,
false,
false));
132 void add(
char const * key,
char const *
value,
bool double_quote)
151 add(
"state_type", value, double_quote);
156 add(
"state_label", value, double_quote);
161 add(
"handle_type", value, double_quote);
166 add(
"handle_label", value, double_quote);
171 add(
"package_name", value, double_quote);
176 add(
"package_filepath", value, double_quote);
181 add(
"event_message", value, double_quote);
182 addExpr(
"event_message_type",
"hou.severityType.Message");
187 add(
"event_message", value, double_quote);
188 addExpr(
"event_message_type",
"hou.severityType.ImportantMessage");
193 add(
"event_message", value, double_quote);
194 addExpr(
"event_message_type",
"hou.severityType.Warning");
199 add(
"event_message", value, double_quote);
200 addExpr(
"event_message_type",
"hou.severityType.Error");
205 add(
"event_message", value, double_quote);
206 addExpr(
"event_message_type",
"hou.severityType.Fatal");
211 myDeliveryMode =
mode;
216 return myDeliveryMode;
247 template <
typename T>
T
250 if (
typeid(
int) == any.type())
252 return static_cast<T>(hboost::any_cast<
int>(
any));
254 else if (
typeid(
double) == any.type())
256 return static_cast<T>(hboost::any_cast<
double>(
any));
258 else if (
typeid(
bool) == any.type())
260 return static_cast<T>(hboost::any_cast<
bool>(
any));
265 template <>
inline std::string
268 if (
typeid(std::string) == any.type())
270 return hboost::any_cast<std::string>(
any);
272 else if (
typeid(
int) == any.type())
276 else if (
typeid(
double) == any.type())
280 else if (
typeid(
bool) == any.type())
284 return std::string();
287 template <>
inline int
290 if (
typeid(
int) == any.type())
292 return hboost::any_cast<
int>(
any);
294 else if (
typeid(
bool) == any.type())
296 return (
int)hboost::any_cast<
bool>(
any);
304 #endif // PI_PythonResourceTypes_H
void addStateLabel(char const *value, bool double_quote=false)
void add(char const *key, Elem::Value const &value)
GLsizei const GLfloat * value
Elem(char const *key, Value const &value, bool expr, bool double_quote)
std::variant< int32, fpreal, UT_StringHolder > ParmVariant
const char * c_str() const
int substitute(const char *find, const char *replacement, exint count=-1)
GLint GLint GLsizei GLint GLenum GLenum type
bool any(const vbool4 &v)
void setDeliveryMode(EventMessage::DeliveryMode mode)
void addMessage(char const *value, bool double_quote=false)
void addImportantMessage(char const *value, bool double_quote=false)
DeliveryMode deliveryMode() const
void addWarning(char const *value, bool double_quote=false)
void addFatal(char const *value, bool double_quote=false)
void addHandleType(char const *value, bool double_quote=false)
void addError(char const *value, bool double_quote=false)
void addPackageName(char const *value, bool double_quote=false)
T anyToType(hboost::any const &any)
Array const & values() const
void addStateType(char const *value, bool double_quote=false)
void add(char const *key, char const *value, bool double_quote)
void addExpr(char const *key, char const *value)
std::pair< UT_StringHolder, UT_StringHolder > ActiveViewerPair
void addPackageFilepath(char const *value, bool double_quote=false)
void addHandleLabel(char const *value, bool double_quote=false)