HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PerfMonTypes.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_PerfMonTypes.h (UT Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Performance monitor enumerations, defines, structures.
11  */
12 
13 #ifndef __UT_PerfMonTypes__
14 #define __UT_PerfMonTypes__
15 
16 #include "UT_API.h"
17 
18 /// Default file extension to use for profiles.
19 #define UT_PERFMON_PROFILE_FILE_EXTENSION ".hperf"
20 
21 static const int UT_PERFORMANCE_INVALID_FRAME = -1;
22 
23 /// Categories.
25 {
36 };
37 
38 /// Event types.
40 {
46 };
47 
48 /// Object types.
50 {
60 };
61 
62 // Enumeration of stat types.
64 {
75 };
76 
77 /// Viewport types recognized by the performance monitor.
79 {
83 };
84 
85 /// Script types recognized by the performance monitor.
87 {
91 };
92 
93 // Enumeration of attribute types.
95 {
102 };
103 
104 // Enumeration of public profile attributes.
106 {
112 };
113 
114 // Enumeration of public stats attributes.
116 {
126 };
127 
128 // Enumeration of public stat definition attributes.
130 {
137 };
138 
139 // Time formats to use in event logs.
141 {
145 };
146 
147 /// Return the (display) name of the given event type.
149 
150 /// Return the (display) name of the given category.
151 UT_API const char *UTgetCategoryName(UT_PerfMonCategory category);
152 
153 /// Return the (display) name of the given event object type.
154 UT_API const char *UTgetObjectTypeName(UT_PerfMonObjectType object_type);
155 
156 /// Return the (display) name of the given stat type.
157 UT_API const char *UTgetStatTypeName(UT_PerfMonStatType stat_type);
158 
159 /// Return the event type enum of the given event type name.
161  UTgetEventType(const char *type_name);
162 
163 /// Return the category enum of the given category name.
165  UTgetCategory(const char *category_name);
166 
167 /// Return the enum type of the given object type name.
169  UTgetObjectType(const char *type_name);
170 
171 /// Return the enum type of the given stat type name.
173  UTgetStatType(const char *type_name);
174 
175 /// Return the (display) name of the given profile attribute.
177 
178 /// Return the type of the given profile attribute.
181 
182 /// Return the (display) name of the given stats attribute.
184 
185 /// Return the (display) name of the given stat definition attribute.
187 
188 /// Return the profile attribute bound to the given (display) name.
189 /// Return UT_PERFMON_INVALID_PROFILE_ATTR if no such attribute exists.
191  UTgetProfileAttribute(const char *attr_name);
192 
193 /// Return the type of the given stats attribute.
196 
197 /// Return the stats attribute bound to the given (display) name.
198 /// Return UT_PERFMON_INVALID_STATS_ATTR if no such attribute exists.
200  UTgetStatsAttribute(const char *attr_name);
201 
202 /// Return the stat definition attribute bound to the given (display) name.
203 /// Return UT_PERFMON_INVALID_STAT_DEF_ATTR if no such attribute exists.
205  UTgetStatDefAttribute(const char *attr_name);
206 
207 /// Initialize data structures internal to this module.
208 /// This should only be called once from the UT_Performance constructor.
210 #endif
UT_PerfMonLogTimeFormat
UT_API UT_PerfMonStatDefAttribute UTgetStatDefAttribute(const char *attr_name)
UT_PerfMonEventType
Event types.
UT_API UT_PerfMonEventType UTgetEventType(const char *type_name)
Return the event type enum of the given event type name.
UT_API UT_PerfMonAttributeType UTgetStatsAttrType(UT_PerfMonStatsAttribute attr)
Return the type of the given stats attribute.
UT_API void UTinitPerfMonTypes()
UT_API UT_PerfMonProfileAttribute UTgetProfileAttribute(const char *attr_name)
UT_API const char * UTgetStatDefAttrName(UT_PerfMonStatDefAttribute attr)
Return the (display) name of the given stat definition attribute.
#define UT_API
Definition: UT_API.h:14
UT_API const char * UTgetStatTypeName(UT_PerfMonStatType stat_type)
Return the (display) name of the given stat type.
UT_PerfMonProfileAttribute
UT_API const char * UTgetCategoryName(UT_PerfMonCategory category)
Return the (display) name of the given category.
UT_PerfMonObjectType
Object types.
UT_API UT_PerfMonStatsAttribute UTgetStatsAttribute(const char *attr_name)
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
Definition: CLI11.h:1729
UT_API const char * UTgetObjectTypeName(UT_PerfMonObjectType object_type)
Return the (display) name of the given event object type.
UT_PerfMonStatType
UT_PerfMonCategory
Categories.
UT_PerfMonViewportType
Viewport types recognized by the performance monitor.
UT_API const char * UTgetProfileAttrName(UT_PerfMonProfileAttribute attr)
Return the (display) name of the given profile attribute.
UT_API UT_PerfMonAttributeType UTgetProfileAttrType(UT_PerfMonProfileAttribute attr)
Return the type of the given profile attribute.
UT_API UT_PerfMonObjectType UTgetObjectType(const char *type_name)
Return the enum type of the given object type name.
UT_PerfMonAttributeType
UT_PerfMonStatsAttribute
UT_API const char * UTgetEventTypeName(UT_PerfMonEventType type)
Return the (display) name of the given event type.
UT_PerfMonStatDefAttribute
UT_PerfMonScriptType
Script types recognized by the performance monitor.
type
Definition: core.h:1059
UT_API UT_PerfMonCategory UTgetCategory(const char *category_name)
Return the category enum of the given category name.
UT_API const char * UTgetStatsAttrName(UT_PerfMonStatsAttribute attr)
Return the (display) name of the given stats attribute.
UT_API UT_PerfMonStatType UTgetStatType(const char *type_name)
Return the enum type of the given stat type name.