LexLeo 0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
stream_io_creator_t Struct Reference

Owner-facing creator object for standard I/O-oriented streams. More...

#include <stream_io_creator.h>

Data Fields

stream_status_t(* create )(const void *ud, stream_io_kind_t kind, stream_t **out)
 Create a standard I/O-oriented stream.
 
void * ud
 Opaque context bound to create.
 

Detailed Description

A stream_io_creator_t packages:

  • a creation callback,
  • opaque user data bound to that callback.

Such an object is typically prepared by the Composition Root and then injected into owner-side runtime code that needs to create standard input/output/error stream_t instances without depending directly on factory wiring details.

Definition at line 51 of file stream_io_creator.h.

Field Documentation

◆ create

stream_status_t(* stream_io_creator_t::create) (const void *ud, stream_io_kind_t kind, stream_t **out)
Parameters
[in]udOpaque creator-owned context.
[in]kindRequested standard I/O kind.
[out]outReceives the created stream handle.
Returns
A stream_status_t describing the creation result.

Definition at line 67 of file stream_io_creator.h.

◆ ud

void* stream_io_creator_t::ud

This pointer typically hides Composition Root wiring details such as a factory reference and the associated adapter key.

Definition at line 79 of file stream_io_creator.h.