ImGraph
 All Classes Functions Variables Enumerations Pages
Scheduling and synchronization

Introduction

As seen in section Block, there is 2 types of rendering allowed : asynchronous and synchronous. The differences between each mode imply that the graph processing should allow "push" and "pull" data flow.

  • a "Push" event occurs when a block produces a value and wake up a child block which was waiting for a value (this is true only if each input value of this block is new or constant). This is the case when, for example, an input block read a frame from a video file and give this frame to the next block.
  • a "Pull" event occurs when a block asks for a value instead of waiting the parent to produce. This is the case when, for example, a block want to skip a frame: it will then ask the parent to render again.

In order to allow these functionalities, we use a double linked oriented graph. Each node of the graph need to know every child that are connected, as well as its parents. charliesoft::GraphOfProcess stores a std::map of charliesoft::Block, and each block stores a std::map of parameters (charliesoft::ParamValue) which can be then be an edge of the graph. A parameter can indeed be linked to another parameter. In this case, the parameter knows its parent (the block which owns him), and if it's an input parameter, its value will be the address of the output parameter. If it's an output parameter, the children can be recovered from charliesoft::ParamValue::_distantListeners.