ChibiOS 21.11.4
chfactory.h File Reference

ChibiOS objects factory structures and macros. More...

Go to the source code of this file.

Data Structures

struct  ch_dyn_element
 Type of a dynamic object list element. More...
struct  ch_dyn_list
 Type of a dynamic object list. More...
struct  ch_registered_static_object
 Type of a registered object. More...
struct  ch_dyn_object
 Type of a dynamic buffer object. More...
struct  ch_dyn_semaphore
 Type of a dynamic semaphore. More...
struct  ch_dyn_mailbox
 Type of a dynamic buffer object. More...
struct  ch_dyn_objects_fifo
 Type of a dynamic buffer object. More...
struct  ch_dyn_pipe
 Type of a dynamic pipe object. More...
struct  ch_objects_factory
 Type of the factory main object. More...

Macros

#define CH_CFG_FACTORY_MAX_NAMES_LENGTH   8
 Maximum length for object names.
#define CH_CFG_FACTORY_OBJECTS_REGISTRY   TRUE
 Enables the registry of generic objects.
#define CH_CFG_FACTORY_GENERIC_BUFFERS   TRUE
 Enables factory for generic buffers.
#define CH_CFG_FACTORY_SEMAPHORES   TRUE
 Enables factory for semaphores.
#define CH_CFG_FACTORY_MAILBOXES   TRUE
 Enables factory for mailboxes.
#define CH_CFG_FACTORY_OBJ_FIFOS   TRUE
 Enables factory for objects FIFOs.
#define CH_CFG_FACTORY_OBJ_FIFOS   TRUE
 Enables factory for objects FIFOs.
#define CH_CFG_FACTORY_PIPES   TRUE
 Enables factory for Pipes.
#define CH_CFG_FACTORY_SEMAPHORES   FALSE
 Enables factory for semaphores.
#define CH_CFG_FACTORY_MAILBOXES   FALSE
 Enables factory for mailboxes.
#define CH_CFG_FACTORY_OBJ_FIFOS   FALSE
 Enables factory for objects FIFOs.
#define CH_CFG_FACTORY_PIPES   FALSE
 Enables factory for Pipes.
#define CH_FACTORY_REQUIRES_POOLS
#define CH_FACTORY_REQUIRES_HEAP

Typedefs

typedef struct ch_dyn_element dyn_element_t
 Type of a dynamic object list element.
typedef struct ch_dyn_list dyn_list_t
 Type of a dynamic object list.
typedef struct ch_registered_static_object registered_object_t
 Type of a registered object.
typedef struct ch_dyn_object dyn_buffer_t
 Type of a dynamic buffer object.
typedef struct ch_dyn_semaphore dyn_semaphore_t
 Type of a dynamic semaphore.
typedef struct ch_dyn_mailbox dyn_mailbox_t
 Type of a dynamic buffer object.
typedef struct ch_dyn_objects_fifo dyn_objects_fifo_t
 Type of a dynamic buffer object.
typedef struct ch_dyn_pipe dyn_pipe_t
 Type of a dynamic pipe object.
typedef struct ch_objects_factory objects_factory_t
 Type of the factory main object.

Functions

void __factory_init (void)
 Initializes the objects factory.
registered_object_tchFactoryRegisterObject (const char *name, void *objp)
 Registers a generic object.
registered_object_tchFactoryFindObject (const char *name)
 Retrieves a registered object.
registered_object_tchFactoryFindObjectByPointer (void *objp)
 Retrieves a registered object by pointer.
void chFactoryReleaseObject (registered_object_t *rop)
 Releases a registered object.
dyn_buffer_tchFactoryCreateBuffer (const char *name, size_t size)
 Creates a generic dynamic buffer object.
dyn_buffer_tchFactoryFindBuffer (const char *name)
 Retrieves a dynamic buffer object.
void chFactoryReleaseBuffer (dyn_buffer_t *dbp)
 Releases a dynamic buffer object.
dyn_semaphore_tchFactoryCreateSemaphore (const char *name, cnt_t n)
 Creates a dynamic semaphore object.
dyn_semaphore_tchFactoryFindSemaphore (const char *name)
 Retrieves a dynamic semaphore object.
void chFactoryReleaseSemaphore (dyn_semaphore_t *dsp)
 Releases a dynamic semaphore object.
dyn_mailbox_tchFactoryCreateMailbox (const char *name, size_t n)
 Creates a dynamic mailbox object.
dyn_mailbox_tchFactoryFindMailbox (const char *name)
 Retrieves a dynamic mailbox object.
void chFactoryReleaseMailbox (dyn_mailbox_t *dmp)
 Releases a dynamic mailbox object.
dyn_objects_fifo_tchFactoryCreateObjectsFIFO (const char *name, size_t objsize, size_t objn, unsigned objalign)
 Creates a dynamic "objects FIFO" object.
dyn_objects_fifo_tchFactoryFindObjectsFIFO (const char *name)
 Retrieves a dynamic "objects FIFO" object.
void chFactoryReleaseObjectsFIFO (dyn_objects_fifo_t *dofp)
 Releases a dynamic "objects FIFO" object.
dyn_pipe_tchFactoryCreatePipe (const char *name, size_t size)
 Creates a dynamic pipe object.
dyn_pipe_tchFactoryFindPipe (const char *name)
 Retrieves a dynamic pipe object.
void chFactoryReleasePipe (dyn_pipe_t *dpp)
 Releases a dynamic pipe object.
static dyn_element_tchFactoryDuplicateReference (dyn_element_t *dep)
 Duplicates an object reference.
static void * chFactoryGetObject (registered_object_t *rop)
 Returns the pointer to the inner registered object.
static size_t chFactoryGetBufferSize (dyn_buffer_t *dbp)
 Returns the size of a generic dynamic buffer object.
static uint8_t * chFactoryGetBuffer (dyn_buffer_t *dbp)
 Returns the pointer to the inner buffer.
static semaphore_tchFactoryGetSemaphore (dyn_semaphore_t *dsp)
 Returns the pointer to the inner semaphore.
static mailbox_tchFactoryGetMailbox (dyn_mailbox_t *dmp)
 Returns the pointer to the inner mailbox.
static objects_fifo_tchFactoryGetObjectsFIFO (dyn_objects_fifo_t *dofp)
 Returns the pointer to the inner objects FIFO.
static pipe_tchFactoryGetPipe (dyn_pipe_t *dpp)
 Returns the pointer to the inner pipe.

Detailed Description

ChibiOS objects factory structures and macros.

Definition in file chfactory.h.