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

Owner-facing creator object for file-backed streams. More...

#include <stream_file_creator.h>

Data Fields

stream_status_t(* create )(const void *ud, const char *path, uint32_t flags, bool autoclose, stream_t **out)
 Create a file-backed stream.
 
void * ud
 Opaque context bound to create.
 

Detailed Description

A stream_file_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 file-backed stream_t instances without depending directly on factory wiring details.

Definition at line 38 of file stream_file_creator.h.

Field Documentation

◆ create

stream_status_t(* stream_file_creator_t::create) (const void *ud, const char *path, uint32_t flags, bool autoclose, stream_t **out)
Parameters
[in]udOpaque creator-owned context.
[in]pathFile path used to open or create the target stream backend.
[in]flagsFile opening flags forwarded to the underlying file-oriented adapter.
[in]autocloseWhether the created stream should close the underlying file resource automatically when the stream is destroyed.
[out]outReceives the created stream handle.
Returns
A stream_status_t describing the creation result.

Definition at line 61 of file stream_file_creator.h.

◆ ud

void* stream_file_creator_t::ud

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

Definition at line 75 of file stream_file_creator.h.