... | @@ -3,7 +3,7 @@ Two types of events can be posted: "standard" events are posted at the moment of |
... | @@ -3,7 +3,7 @@ Two types of events can be posted: "standard" events are posted at the moment of |
|
|
|
|
|
### Standard events
|
|
### Standard events
|
|
To post a "standard" event the following code is used:
|
|
To post a "standard" event the following code is used:
|
|
```
|
|
```cpp
|
|
// Include the event broker
|
|
// Include the event broker
|
|
#include <events/EventBroker.h>
|
|
#include <events/EventBroker.h>
|
|
|
|
|
... | @@ -21,7 +21,7 @@ void someFunction() |
... | @@ -21,7 +21,7 @@ void someFunction() |
|
```
|
|
```
|
|
### Delayed events
|
|
### Delayed events
|
|
The delayed events are posted in a very similar way:
|
|
The delayed events are posted in a very similar way:
|
|
```
|
|
```cpp
|
|
// Include the event broker
|
|
// Include the event broker
|
|
#include <events/EventBroker.h>
|
|
#include <events/EventBroker.h>
|
|
|
|
|
... | @@ -40,7 +40,7 @@ void someFunction() |
... | @@ -40,7 +40,7 @@ void someFunction() |
|
}
|
|
}
|
|
```
|
|
```
|
|
It is good practice to save the event id returned by the function in order to remove it later.
|
|
It is good practice to save the event id returned by the function in order to remove it later.
|
|
```
|
|
```cpp
|
|
// Define a private property in your class to store the event id
|
|
// Define a private property in your class to store the event id
|
|
class MyClass : public FSM<MyClass>
|
|
class MyClass : public FSM<MyClass>
|
|
{
|
|
{
|
... | @@ -86,7 +86,7 @@ class MyClass : public FSM<MyClass> |
... | @@ -86,7 +86,7 @@ class MyClass : public FSM<MyClass> |
|
```
|
|
```
|
|
### Events with parameters
|
|
### Events with parameters
|
|
If the event has some parameter associated (a typical example is a remote command from the ground station) the event has to be manually instanciated
|
|
If the event has some parameter associated (a typical example is a remote command from the ground station) the event has to be manually instanciated
|
|
```
|
|
```cpp
|
|
// Include the event broker
|
|
// Include the event broker
|
|
#include <events/EventBroker.h>
|
|
#include <events/EventBroker.h>
|
|
|
|
|
... | | ... | |