CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
timer.h
1
3#ifndef _aspose_system_timers_timer_h_
4#define _aspose_system_timers_timer_h_
5
6#include <system/eventhandler.h>
7#include <system/component_model/component.h>
8#include <system/threading/timer.h>
9
10#include "elapsed_event_args.h"
11
12namespace System { namespace Timers {
13
16
18class ASPOSECPP_SHARED_CLASS Timer final : public ComponentModel::Component
19{
21 typedef Timers::Timer ThisType;
23 typedef BaseTypesInfo<ComponentModel::Component> ThisBaseTypesInfo;
25 RTTI_INFO(ThisType, ThisBaseTypesInfo)
26
27public:
29 ASPOSECPP_SHARED_API Timer();
32 ASPOSECPP_SHARED_API Timer(double interval);
33
36 ASPOSECPP_SHARED_API double get_Interval() const;
39 ASPOSECPP_SHARED_API void set_Interval(double ms);
40
43 ASPOSECPP_SHARED_API bool get_AutoReset() const;
46 ASPOSECPP_SHARED_API void set_AutoReset(bool autoreset);
47
50 ASPOSECPP_SHARED_API bool get_Enabled() const;
53 ASPOSECPP_SHARED_API void set_Enabled(bool value);
54
57 ASPOSECPP_SHARED_API bool get_IsStopped() const;
58
60 ASPOSECPP_SHARED_API void Start();
62 ASPOSECPP_SHARED_API void Stop();
63
65 ASPOSECPP_SHARED_API void Close();
67 ASPOSECPP_SHARED_API void Dispose();
68
71
72private:
74 void UpdateTimer();
76 void TimerCallback(const SharedPtr<Object>& state);
77
78private:
80 bool m_enabled;
82 bool m_auto_reset;
84 int m_interval;
87};
88
89}} // System::Timers
90
91#endif //_aspose_system_timers_timer_h_
Dummy class to make translated code using Component class compilable. Objects of this class should on...
Definition: component.h:15
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Timer that calls delegate in a loop.
Definition: timer.h:19
void Close()
Stops timer, frees allocated resources.
ElapsedEventHandler Elapsed
Callback function to be called by timer.
Definition: timer.h:70
bool get_IsStopped() const
Checks if timer is stopped.
bool get_AutoReset() const
Checks if timer is in auto-reset mode.
Timer(double interval)
Constructs stopped timer with specified interval.
bool get_Enabled() const
Checks if timer is active.
void Stop()
Stops timer.
void Dispose()
Stops timer, frees allocated resources.
void set_Interval(double ms)
Sets timer interval.
double get_Interval() const
Gets timer interval.
void set_Enabled(bool value)
Starts or stops timer. Starting timer doesn't restart time counting if timer is already executing.
void Start()
Starts timer. Doesn't restart time counting if timer is already executing.
void set_AutoReset(bool autoreset)
Sets timer into auto-reset mode or out of it.
Timer()
RTTI information.
EventHandler< SharedPtr< ElapsedEventArgs > > ElapsedEventHandler
Delegate type to handle timer event.
Definition: timer.h:15
Definition: db_command.h:9
MulticastDelegate< void(System::SharedPtr< Object >, TEventArgs)> EventHandler
Represents a method that reacts to and processes an event. This type should be allocated on stack and...
Definition: eventhandler.h:16