summaryrefslogtreecommitdiff
path: root/public/panorama/uischeduleddel.h
diff options
context:
space:
mode:
Diffstat (limited to 'public/panorama/uischeduleddel.h')
-rw-r--r--public/panorama/uischeduleddel.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/public/panorama/uischeduleddel.h b/public/panorama/uischeduleddel.h
new file mode 100644
index 0000000..2103c30
--- /dev/null
+++ b/public/panorama/uischeduleddel.h
@@ -0,0 +1,44 @@
+//=========== Copyright Valve Corporation, All rights reserved. ===============//
+//
+// Purpose:
+//=============================================================================//
+
+#ifndef UISCHEDULEDDEL_H
+#define UISCHEDULEDDEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/utldelegate.h"
+
+namespace panorama
+{
+
+
+// Panorama wrapper around CUtlSymbol which always creates symbol in panorama.dll module
+class CUIScheduledDel
+{
+public:
+ // constructor, destructor
+ CUIScheduledDel( CUtlDelegate< void() > del );
+ ~CUIScheduledDel();
+
+ void Schedule( double flSecondsToRunIn );
+
+ void Cancel();
+
+ bool BScheduled();
+
+ double GetSecondsUntilScheduled() { return MAX( m_flNextScheduled - UIEngine()->GetCurrentFrameTime(), 0.0 ); }
+
+private:
+
+ double m_flNextScheduled;
+ int m_iScheduledIndex;
+ CUtlDelegate< void() > m_del;
+};
+
+} // namespace panorama
+
+#endif // UISCHEDULEDDEL_H \ No newline at end of file