30 if (!reg || !reg->
entries || !reg->
count || !key)
return NULL;
32 for (
size_t i = 0; i < reg->
count; i++) {
51 return e->
ctor(e->
ud, args, out_stream);
91 if (!fact || !*fact)
return;
97 if (!mem || !mem->
free)
return;
100 for (
size_t i = 0; i < f->
reg.
count; ++i) {
117 || *desc->
key ==
'\0'
133 for (
size_t i = 0; i < reg->
count; ++i) {
157 if (!out || !f || !args || !key || *key ==
'\0')
int osal_strcmp(const char *s1, const char *s2)
stream_status_t stream_create_factory(stream_factory_t **out, const stream_factory_cfg_t *cfg, const stream_env_t *env)
Create a stream factory.
stream_status_t stream_factory_add_adapter(stream_factory_t *fact, const stream_adapter_desc_t *desc)
Register an adapter descriptor into a stream factory.
static const stream_branch_t * stream_registry_find(const stream_registry_t *reg, stream_key_t key)
stream_status_t stream_factory_create_stream(const stream_factory_t *f, stream_key_t key, const void *args, stream_t **out)
Create a stream from a registered adapter key.
void stream_destroy_factory(stream_factory_t **fact)
Destroy a stream factory.
static stream_status_t stream_registry_create(const stream_registry_t *reg, stream_key_t key, const void *args, stream_t **out_stream)
Composition Root factory API for the stream port.
Private factory handle definition for the stream port.
const char * stream_key_t
Public identifier type for a registered stream adapter.
stream_status_t
Public status codes used by the stream port.
@ STREAM_STATUS_NOT_FOUND
@ STREAM_STATUS_ALREADY_EXISTS
@ STREAM_STATUS_NO_BACKEND
void *(* calloc)(size_t nmemb, size_t size)
Public descriptor used to register a concrete stream adapter.
stream_key_t key
Public key used to identify the adapter.
const void * ud
Optional opaque user data bound to the constructor.
ud_dtor_fn_t ud_dtor
Optional destructor for ud.
stream_ctor_fn_t ctor
Adapter constructor used to create a stream_t.
Private registered adapter entry.
Runtime environment for the stream port.
const osal_mem_ops_t * mem
Memory operations used by the stream port.
Configuration for stream_factory_t.
Private handle structure for a stream_factory_t.
const osal_mem_ops_t * mem
Private adapter registry used by stream_factory_t.
stream_branch_t * entries
Private handle structure for a stream_t.