Composition Root factory API for the stream port.
More...
#include "stream/borrowers/stream_types.h"#include "stream/adapters/stream_key_type.h"#include "stream/adapters/stream_install.h"#include "stream/cr/stream_cr_api.h"#include "osal/mem/osal_mem_ops.h"#include "policy/lexleo_cstd_types.h"

Go to the source code of this file.
Data Structures | |
| struct | stream_factory_cfg_t |
Configuration for stream_factory_t. More... | |
Typedefs | |
| typedef struct stream_factory_t | stream_factory_t |
| Opaque stream factory type. | |
| typedef struct stream_factory_cfg_t | stream_factory_cfg_t |
Configuration for stream_factory_t. | |
Functions | |
| 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. | |
| stream_factory_cfg_t | stream_default_factory_cfg (void) |
| Return the default configuration for a stream factory. | |
This header exposes the public factory-oriented Composition Root services used to:
stream factory,Definition in file stream_factory_cr_api.h.
| typedef struct stream_factory_cfg_t stream_factory_cfg_t |
This structure defines the public configuration values required to create a stream factory.
| typedef struct stream_factory_t stream_factory_t |
A stream_factory_t stores adapter descriptors indexed by public stream_key_t values and can later create stream_t handles from them.
Definition at line 45 of file stream_factory_cr_api.h.
| 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.
| stream_factory_cfg_t stream_default_factory_cfg | ( | void | ) |
stream_factory_cfg_t. | 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.