diff options
Diffstat (limited to 'main/performance.h')
-rw-r--r-- | main/performance.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/main/performance.h b/main/performance.h index ddbe45fa00..5f88a24c0f 100644 --- a/main/performance.h +++ b/main/performance.h @@ -32,6 +32,7 @@ #define PERFORMANCE_H #include "core/object.h" +#include "core/ordered_hash_map.h" #define PERF_WARN_OFFLINE_FUNCTION #define PERF_WARN_PROCESS_SYNC @@ -47,6 +48,19 @@ class Performance : public Object { float _process_time; float _physics_process_time; + class MonitorCall { + Callable _callable; + Vector<Variant> _arguments; + + public: + MonitorCall(Callable p_callable, Vector<Variant> p_arguments); + MonitorCall(); + Variant call(bool &r_error, String &r_error_message); + }; + + OrderedHashMap<StringName, MonitorCall> _monitor_map; + uint64_t _monitor_modification_time; + public: enum Monitor { @@ -95,6 +109,14 @@ public: void set_process_time(float p_pt); void set_physics_process_time(float p_pt); + void add_custom_monitor(const StringName &p_id, const Callable &p_callable, const Vector<Variant> &p_args); + void remove_custom_monitor(const StringName &p_id); + bool has_custom_monitor(const StringName &p_id); + Variant get_custom_monitor(const StringName &p_id); + Array get_custom_monitor_names(); + + uint64_t get_monitor_modification_time(); + static Performance *get_singleton() { return singleton; } Performance(); |