fixed distribution event
This commit is contained in:
@@ -16,17 +16,30 @@ class DistributingEvent : public Event
|
||||
{
|
||||
public:
|
||||
DistributingEvent(char address, int priority, std::string name,
|
||||
std::chrono::milliseconds deactivation_time, std::shared_ptr<IEventNotifier> event_notifier);
|
||||
std::chrono::milliseconds bounce_time, std::shared_ptr<IEventNotifier> event_notifier);
|
||||
|
||||
void active();
|
||||
void inactive();
|
||||
|
||||
private:
|
||||
bool is_bouncing();
|
||||
|
||||
void distribute();
|
||||
|
||||
public:
|
||||
std::chrono::milliseconds deactivation_time;
|
||||
std::chrono::milliseconds bounce_time;
|
||||
|
||||
private:
|
||||
enum ActivationState
|
||||
{
|
||||
NOT_ACTIVATED,
|
||||
FIRST_ACTIVATED,
|
||||
ACTIVATED
|
||||
};
|
||||
std::shared_ptr<IEventNotifier> event_notifier;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> last_activation;
|
||||
|
||||
ActivationState activation_state;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user