OSSIA
Open Scenario System for Interactive Application
ossia::time_event Class Reference

The time_event class. More...

Detailed Description

The time_event class.

#time_event is use to describe temporal structure to launch the start or the end of each attached #time_interval.

#time_event has a #State and can also be submitted to an expression.

Public Types

enum class  status : uint8_t {
  NONE = 0b00000000 , PENDING = 0b00000001 , HAPPENED = 0b00000010 , DISPOSED = 0b00000011 ,
  FINISHED = 0b10000000
}
 event status
 
enum class  offset_behavior : uint8_t { EXPRESSION_TRUE , EXPRESSION_FALSE , EXPRESSION }
 The OffsetBehavior enum Describes what happens when a parent scenario does an offset beyond this event. This is useful to make default cases for the scenario. More...
 
using exec_callback = std::function< void(status)>
 to get the event status back More...
 

Public Member Functions

 time_event (time_event::exec_callback, time_sync &aTimeSync, expression_ptr anExpression)
 
 ~time_event ()
 destructor
 
void set_callback (time_event::exec_callback)
 changes the callback in the event More...
 
void add_time_process (std::shared_ptr< time_process >)
 
void remove_time_process (time_process *)
 
const auto & get_time_processes () const
 
void tick (ossia::time_value date, ossia::time_value offset)
 
time_syncget_time_sync () const
 get the #time_sync where the event is More...
 
void set_time_sync (time_sync &)
 
const expressionget_expression () const
 get the expression of the event More...
 
time_eventset_expression (expression_ptr)
 set the expression of the event More...
 
status get_status () const
 get the status of the event More...
 
offset_behavior get_offset_behavior () const
 getOffsetValue Returns the value of the condition if we are offsetting past this time event.
 
time_eventset_offset_behavior (offset_behavior)
 setOffsetValue Sets the value of the condition if we are offsetting past this time event.
 
auto & previous_time_intervals ()
 get previous time constraints attached to the event More...
 
const auto & previous_time_intervals () const
 get previous time constraints attached to the event More...
 
auto & next_time_intervals ()
 get next time constraints attached to the event More...
 
const auto & next_time_intervals () const
 get next time constraints attached to the event More...
 
void set_status (status s)
 
void reset ()
 
void cleanup ()
 
void mute (bool m)
 

Member Typedef Documentation

◆ exec_callback

using ossia::time_event::exec_callback = std::function<void(status)>

to get the event status back

Parameters
Statusnew status

Member Enumeration Documentation

◆ offset_behavior

enum ossia::time_event::offset_behavior : uint8_t
strong

The OffsetBehavior enum Describes what happens when a parent scenario does an offset beyond this event. This is useful to make default cases for the scenario.

Enumerator
EXPRESSION_FALSE 

The condition is considered True.

EXPRESSION 

The condition is considered False.

The condition will be evaluated

Member Function Documentation

◆ set_callback()

void ossia::time_event::set_callback ( time_event::exec_callback  callback)

changes the callback in the event

Parameters
time_event::ExecutionCallbackto get #time_event's status back

this may be unsafe to do during execution

◆ get_time_sync()

time_sync & ossia::time_event::get_time_sync ( ) const

get the #time_sync where the event is

Returns
std::shared_ptr<#time_sync>

◆ get_expression()

const expression & ossia::time_event::get_expression ( ) const

get the expression of the event

Returns
std::shared_ptr<expression>

◆ set_expression()

time_event & ossia::time_event::set_expression ( expression_ptr  exp)

set the expression of the event

Parameters
std::shared_ptr<expression>
Returns
#time_event the event

◆ get_status()

time_event::status ossia::time_event::get_status ( ) const

get the status of the event

Returns
#Status

◆ previous_time_intervals() [1/2]

auto& ossia::time_event::previous_time_intervals ( )
inline

get previous time constraints attached to the event

Returns
#Container<#time_interval>

◆ previous_time_intervals() [2/2]

const auto& ossia::time_event::previous_time_intervals ( ) const
inline

get previous time constraints attached to the event

Returns
#Container<#TimeProcess>

◆ next_time_intervals() [1/2]

auto& ossia::time_event::next_time_intervals ( )
inline

get next time constraints attached to the event

Returns
#Container<#time_interval>

◆ next_time_intervals() [2/2]

const auto& ossia::time_event::next_time_intervals ( ) const
inline

get next time constraints attached to the event

Returns
#Container<#TimeProcess>