#include <common.h>
Inheritance diagram for rpa::obuf_guard< Mutex >:

Public Member Functions | |
| void | check (void) const |
| obuf_guard (Mutex *aMtx, size_t aMaxSz) | |
| Only important explicit constructor. | |
| obuf_guard (const obuf_guard &aOIG) | |
| size_t | max_size (void) const |
Private Member Functions | |
| obuf_guard () | |
| No default constructor because of the pointer. | |
| obuf_guard & | operator= (const obuf_guard &) |
Private Attributes | |
| Mutex * | _Mtx |
| Points to any mutex as long as it is conformant to the mutex interface. | |
| size_t | _maxSz |
| The maximum number of elements to be written into the output buffer. | |
Classes | |
| class | inner_guard |
When the size of buffers is limited, we need a mutex. Otherwise not. Therefore, the two things are grouped together.
| rpa::obuf_guard< Mutex >::obuf_guard | ( | ) | [private] |
No default constructor because of the pointer.
| rpa::obuf_guard< Mutex >::obuf_guard | ( | Mutex * | aMtx, | |
| size_t | aMaxSz | |||
| ) | [inline] |
Only important explicit constructor.
| rpa::obuf_guard< Mutex >::obuf_guard | ( | const obuf_guard< Mutex > & | aOIG | ) | [inline] |
Simple copy constructor. Note that the mutex pointer is copied as is, because the mutex object is not managed by us.
| void rpa::obuf_guard< Mutex >::check | ( | void | ) | const [inline] |
Run_time check, for debugging. Mainly checks whether the maximum number of elements is a reasonable size, or it is the usual max size of a dynamic container. This number is temporary only and should be replaced by a clean constant. Is it equal to 'size_type(-1)' ? Check standard.
| size_t rpa::obuf_guard< Mutex >::max_size | ( | void | ) | const [inline] |
When a buffer reaches the maximum size, the mutex is locked, and the buffer is flushed into the output iterator.
| obuf_guard& rpa::obuf_guard< Mutex >::operator= | ( | const obuf_guard< Mutex > & | ) | [private] |
size_t rpa::obuf_guard< Mutex >::_maxSz [private] |
The maximum number of elements to be written into the output buffer.
Mutex* rpa::obuf_guard< Mutex >::_Mtx [private] |
Points to any mutex as long as it is conformant to the mutex interface.
1.4.7