forb
Public Attributes | List of all members
forb::streams::shared_memory::shmem_data Struct Reference

Definition of the private structure that will be allocated within the shared memory area. More...

Public Attributes

mutex_t mutex
 Mutex that avoids concurrent access to the shared memory.
 
condition_t non_empty
 Condition that signals whenever the shared memory is not empty.
 
condition_t non_full
 Condition that signals whenever the shared memory is not full.
 
index_t rear
 Consuming pointer.
 
index_t front
 Producing pointer.
 
size_t data_size
 The dimension of the data buffer, since the structure will stretch automatically that attribute to fit the requested buffer size. More...
 
size_t how_many_free
 Counts the number of free spaces within the shared memory.
 
size_t how_many_data
 Counts the number of data spaces occupied within the shared memory. More...
 
unsigned char data [1]
 Data buffer, to be expanded when shared memory is allocated.
 

Detailed Description

Definition of the private structure that will be allocated within the shared memory area.

It will share mutexes, condition variables, indexes, the data buffer and its size and counters. NOTICE: the dimension of this data structure is variable, in that the last argument will be "stretched" when allocating the shared memory area to fit the given size.

Member Data Documentation

§ data_size

size_t forb::streams::shared_memory::shmem_data::data_size

The dimension of the data buffer, since the structure will stretch automatically that attribute to fit the requested buffer size.

§ how_many_data

size_t forb::streams::shared_memory::shmem_data::how_many_data

Counts the number of data spaces occupied within the shared memory.

NOTICE: some spaces may be temporarily not free nor marked as data, while they are filled by the producer or emptied by the consumer.


The documentation for this struct was generated from the following file: