#include <lsmp.hh>

Public Types | |
| typedef int | eventid_type |
Public Member Functions | |
| bool | valid () const |
| bool | found () const |
| void | dump (int flg=0xff) const |
| void | dump (std::ostream &Out, int flg=0xff) const |
| void | rqsynch (bool on) |
| void | bufmode (int mode) |
| void | keep (bool flag=true) |
| void | lock (bool flag=true) |
| const char * | Error (void) const |
| int | getBufferLength (void) const |
| int | getBufferCount (void) const |
| LSMP (void) | |
| LSMP (LSMP ©) | |
| LSMP (const char *name) | |
| LSMP (const char *name, int nbuf, int size) | |
| ~LSMP (void) | |
| std::string | getStat (const std::string &par) const |
| bool | testFlag (int x) const |
| int | getLockCount (void) const |
| void | clrLockCount (void) |
Public Attributes | |
| LSMP_error | error |
| The last error to occur while accessing the partition. | |
Protected Member Functions | |
| char * | buffer_addr (int ibuf) const |
| int | buffer_length (int ibuf) const |
| bool | gate (bool close) const |
| void | Zeuss (const char *name) |
Protected Attributes | |
| struct LSMP_global * | pointer |
| Pointer to the partition control area. | |
| struct LSMP_consbk * | conptr |
| Pointer to the partitions consumer database. | |
| struct LSMP_buffer * | bufptr |
| Pointer to the partitions buffer database. | |
| LSMP::LSMP | ( | void | ) |
The default constructor creates the LSMP data structure without attaching it to a shared memory partition. brief Default constructor.
| LSMP::LSMP | ( | LSMP & | copy | ) |
The Copy Constructor copies an existing partition handle and links it into the process list. brief Copy constructor.
| LSMP::LSMP | ( | const char * | name | ) |
Attach and access an existing named partition. brief Access existing partition.
| name | Name of existing partition. |
| LSMP::LSMP | ( | const char * | name, | |
| int | nbuf, | |||
| int | size | |||
| ) |
Create a new partition with a specified name, number of buffers and buffer size (in bytes). This constructor will attach an existing parition with the correct name if the number of buffers and the buffer size are greater than or equal to the specified values. brief Partition creation constructor.
| name | Name of parition to be created. | |
| nbuf | Number of buffers in the partition to be created. | |
| size | Size (in bytes) of each buffer in the partition. |
| LSMP::~LSMP | ( | void | ) |
Deaccess and detach a partition. The physical shared memory partition and the semaphores used for synchronization are deleted if the use count falls to zero and the keep flag is not set. brief The Partition destructor.
| bool LSMP::valid | ( | ) | const [inline] |
Test that a partition is enabled for use.
| bool LSMP::found | ( | ) | const [inline] |
Test that a partition has been found.
| void LSMP::dump | ( | int | flg = 0xff |
) | const |
Write a formatted dump of the current status of the partition to the standard output stream.
| flg | Flag indicating which portions of partition to dump brief Print the partition status to cout |
| void LSMP::dump | ( | std::ostream & | Out, | |
| int | flg = 0xff | |||
| ) | const |
Write a formatted dump of the current status of the partition to the specified output stream. Individual sections of the dump may be selected with flg. as follows:
| flag | Data to be printed |
| 1 | Header (partition name) |
| 2 | Control/status data |
| 4 | Buffer information |
| 8 | Consumer infomation |
| Out | output stream to which the status dump will be written. | |
| flg | Or of flag bits indicating portions of dump to be included. |
| void LSMP::rqsynch | ( | bool | on | ) |
Turn On/Off request synchronization.
| void LSMP::bufmode | ( | int | mode | ) |
Set the buffer allocation to a specified mode.
| mode=0 | A buffer is released (moved to free list) any time is not reserved and not in use. |
| mode=1 | A buffer is released after it has been seen by at least one consumer and is no longer reserved or in use. |
| mode=2 | A buffer is not released except if it is unreserved, not in use and needed to fill a producer request. |
| void LSMP::keep | ( | bool | flag = true |
) |
Set a flag to indicate whether the partition is to be deleted when it is detached. If flag is true, the partition will not be deleted when it is detached and the use count falls to zero. brief Keep (or destroy) the partition on release.
| void LSMP::lock | ( | bool | flag = true |
) |
Locks the shared memory partition into memory. In order for lock to work, the process must be able to set the effective user ID to 0. brief Lock the shared memory partition into memory
| const char* LSMP::Error | ( | void | ) | const |
Get a description of the last error.
| int LSMP::getBufferLength | ( | void | ) | const [inline] |
Get the length of the buffers in the attached partition. brief buffer length.
| int LSMP::getBufferCount | ( | void | ) | const [inline] |
Get the number of buffers in the attached partition. brief buffer count.
| std::string LSMP::getStat | ( | const std::string & | par | ) | const |
Get a shared memory parameter value. Valid parameters are:
| par | parameter name. |
| bool LSMP::testFlag | ( | int | x | ) | const |
Test a shared memory status flag brief Get a flag value.
| x | Flag number. |
| int LSMP::getLockCount | ( | void | ) | const [inline] |
Get the lock count.
| void LSMP::clrLockCount | ( | void | ) | [inline] |
Clear the lock count.
| char* LSMP::buffer_addr | ( | int | ibuf | ) | const [protected] |
brief Get the address of a specified buffer.
| int LSMP::buffer_length | ( | int | ibuf | ) | const [protected] |
Get the current data length of a specified buffer
| bool LSMP::gate | ( | bool | close | ) | const [protected] |
Request or release exclusive write control over the partition control structure.
| void LSMP::Zeuss | ( | const char * | name | ) | [protected] |
Zero the use count and clean the keep flag for the named (not attached) partition. The named partition will be like totally blown away after this.
1.5.4