Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_EventTrigger

ClanLib Event trigger.
Contained in: global
Derived from: none
Derived by: none
Group: Core (System)

#include <ClanLib/core.h>

### public function member index:

### Construction:

`` | `CL_EventTrigger` | `()`;
`` | `CL_EventTrigger` | `(`const` `CL_EventTrigger`& `copy`)`;
``virtual`` | `~CL_EventTrigger` | `()`;

### Attributes:

``bool`` | `get_flag` | `() `const``;

### Operations:

``CL_EventTrigger`&` | `operator``=` | `(`const` `CL_EventTrigger`& `copy`)`;
``void`` | `reset` | `() `const``;
``void`` | `set_flag` | `()`;
``bool`` | `wait` | `(`int` `timeout` = -1)`;

## Description:

This class represents an event that can be triggered.
Collect several triggers together using the CL_EventListener class, and then call the CL_EventListener::wait function to sleep until one of the events are triggered.

## Function Member Descriptions:

CL_EventTrigger::CL_EventTrigger - Constructs an event trigger object.
`` `CL_EventTrigger` `()`;

CL_EventTrigger::CL_EventTrigger - Copy constructor.
`` `CL_EventTrigger` `(`const` `CL_EventTrigger`& `copy`)`;

CL_EventTrigger::get_flag - Returns true if the trigger flag has been raised.
``bool`` `get_flag` `() `const``;

CL_EventTrigger::reset - Reset trigger flag.
``void`` `reset` `() `const``;

CL_EventTrigger::set_flag - Raise trigger flag.
``void`` `set_flag` `()`;

CL_EventTrigger::wait - Wait until one of the event triggers.
The timeout is in milliseconds.
``bool`` `wait` `(`int` `timeout` = -1)`;

> If timeout = -1, this function will not timeout.
> Returns true if the event triggered, false if it timed out.

CL_EventTrigger::~CL_EventTrigger - Event Trigger Destructor
``virtual`` `~CL_EventTrigger` `()`;

## Variable Member Descriptions: