Private implementation of the stream factory services.
More...
#include "internal/stream_factory_handle.h"#include "stream/cr/stream_factory_cr_api.h"#include "osal/mem/osal_mem.h"#include "policy/lexleo_cstd_types.h"
Go to the source code of this file.
Functions | |
| static const stream_branch_t * | stream_registry_find (const stream_registry_t *reg, stream_key_t key) |
| static stream_status_t | stream_registry_create (const stream_registry_t *reg, stream_key_t key, const void *args, stream_t **out_stream) |
| 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. | |
| void | stream_destroy_factory (stream_factory_t **fact) |
| Destroy 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. | |
| 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. | |
This file implements:
Definition in file stream_factory.c.
| stream_status_t stream_create_factory | ( | stream_factory_t ** | out, |
| const stream_factory_cfg_t * | cfg, | ||
| const stream_env_t * | env | ||
| ) |
| [out] | out | Receives the created factory handle. Must not be NULL. |
| [in] | cfg | Factory configuration. Must not be NULL. |
| [in] | env | Factory environment. Must not be NULL. |
STREAM_STATUS_OK on successSTREAM_STATUS_INVALID if an argument is invalid*out contains a valid stream_factory_t *. Definition at line 54 of file stream_factory.c.
| void stream_destroy_factory | ( | stream_factory_t ** | fact | ) |
| [in,out] | fact | Address of the factory handle to destroy. |
If fact == NULL or *fact == NULL, this function does nothing. Otherwise, it releases the factory object and sets *fact to NULL.
Definition at line 89 of file stream_factory.c.
| stream_status_t stream_factory_add_adapter | ( | stream_factory_t * | fact, |
| const stream_adapter_desc_t * | desc | ||
| ) |
| [in,out] | fact | Target factory. Must not be NULL. |
| [in] | desc | Adapter descriptor to register. Must not be NULL. |
STREAM_STATUS_OK on successSTREAM_STATUS_INVALID if an argument is invalidSTREAM_STATUS_ALREADY_EXISTS if the key is already registeredSTREAM_STATUS_FULL if the factory has reached its registration capacityOn success, a later call to stream_factory_create_stream() with the same key can resolve the registered descriptor.
Definition at line 109 of file stream_factory.c.
| stream_status_t stream_factory_create_stream | ( | const stream_factory_t * | f, |
| stream_key_t | key, | ||
| const void * | args, | ||
| stream_t ** | out | ||
| ) |
| [in] | f | Factory used for adapter lookup. Must not be NULL. |
| [in] | key | Registered adapter key. Must not be NULL and must not be empty. |
| [in] | args | Adapter-specific creation arguments. Must not be NULL. |
| [out] | out | Receives the created stream handle. Must not be NULL. |
STREAM_STATUS_OK on successSTREAM_STATUS_INVALID if an argument is invalidSTREAM_STATUS_NOT_FOUND if key is not registeredThis function resolves the adapter descriptor registered under key and delegates stream creation to its constructor.
Definition at line 151 of file stream_factory.c.
|
static |
Definition at line 39 of file stream_factory.c.
|
static |
Definition at line 26 of file stream_factory.c.