#include <lsmp_prod.hh>

Public Member Functions | |
| LSMP_PROD (void) | |
| LSMP_PROD (const char *part) | |
| LSMP_PROD (const char *part, int nbuf, int lbuf) | |
| ~LSMP_PROD (void) | |
| bool | operator! (void) const |
| char * | get_buffer (int flags=0) |
| void | release (int length, int mask=-1, int flags=0) |
| void | return_buffer (void) |
| void | SetID (int ID) |
| LSMP_PROD::LSMP_PROD | ( | void | ) |
Constructs a null producer, not connected to any partition. brief Default constructor.
| LSMP_PROD::LSMP_PROD | ( | const char * | part | ) |
Initialize a producer structure and attach it to an existing partition. If the named partition doesn't exist, it is created with default parameters. brief Attach to a partition.
| part | Name of partition to be attached. |
| LSMP_PROD::LSMP_PROD | ( | const char * | part, | |
| int | nbuf, | |||
| int | lbuf | |||
| ) |
A partition is created and is accessed by the producer. If a partiton with the desired buffer count and length already exists it is accessed. If an incompatible partition exists, it is not accessed. brief Create a partition and attach a producer.
| part | Name of partition to be created/attached. | |
| nbuf | Minimum number of buffer in partition. | |
| lbuf | Minimum buffer length in bytes of partition. |
| LSMP_PROD::~LSMP_PROD | ( | void | ) |
If a buffer has been allocated, it is released. If a partition is attached, it is released (see LSMP::release). brief Producer destructor.
| bool LSMP_PROD::operator! | ( | void | ) | const [inline] |
This operator returns true if the producer is not ready to supply data to the specified partition. brief Test for error condition.
| char* LSMP_PROD::get_buffer | ( | int | flags = 0 |
) |
A buffer is allocate according to the current buffer mode and its address is returned. The buffer will normally be allocated from the free list. If there are no free buffers available and if the buffer allocation mode is set to a scavaging mode (see LSMP::bufmode) the oldest unused full buffer is allocated. If no (free or full) buffers can be found, get_buffer will block until a buffer is available unless (flags & NOWAIT) != 0. brief Allocate an empty buffer.
| flags | function modifier flag. |
| void LSMP_PROD::release | ( | int | length, | |
| int | mask = -1, |
|||
| int | flags = 0 | |||
| ) |
The current buffer is released and marked as reserved by any consumers waiting for a buffer. The trigger bit mask indicates the type of data contained in the buffer. The data buffer will be sent only to those consumers with a trigger mask containing one or more common bits with the buffer mask. If flags is set to SHOWALL, the specified buffer will be reserved by all current consumers, independent of the number of buffers currently reserved by the consumer and the reservation limit. The SHOWALL mechanism may be used to transmit control information suc as end-of-file status. brief Release a full buffer.
| length | The length of the buffer data in bytes. | |
| mask | A trigger identifier mask. | |
| flags | Special handling flags as described above. |
| void LSMP_PROD::return_buffer | ( | void | ) |
The current buffer is returned to the free list without being distributed to any consumers. brief Return an unused buffer.
| void LSMP_PROD::SetID | ( | int | ID | ) |
SetID sets a record ID for the buffer currently owned by the consumer. The record ID may be used by the consumer to access a specific record. brief Set the record ID for the current buffer.
| ID | Record identifier for the current buffer. |
1.5.4