Note for implementing a source in NES

When implementing a NES DataSource, particular care must be ensured for the `receiveData` method. In particular, regarding the return value. It shall return an 'std::optional<TupleBuffer>' that must be valid if anything was ever read from the internal resource. This does not prevent from returning an empty TupleBuffer, which is considered as a valid optional. However, an 'std::nullopt' must be returned in the following two cases:

  1. 'receiveData' is called but the internal resource (e.g., file, tcp connection, etc..) has actually no data so we need to signal the 'runningRoutine' of the source object that there is nothing to push downstream
  2. 'receiveData' might be blocking when reading from the internal resource. If we issue stop on the data source, we need to unblock receiveData and we still need to let the runningRoutine method know that we do not have data to push downstream
 
how_to_get_data_into_of_nes.txt · Last modified: 2020/12/14 13:45 by 134.96.191.189
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki