A class for handling shared memory pages.
More...
#include <shared_memory.h>
|
| | sharedPage (std::string name_="", unsigned int len_=0, bool master_=false, bool autoBackoff=true) |
| | brief Creates a shared page More...
|
| |
| | sharedPage (std::string name_="", unsigned int len_=0, bool master_=false, bool autoBackoff=true) |
| |
| | sharedPage (const sharedPage &rhs) |
| | Creates a copy of a shared page. More...
|
| |
| | sharedPage (const sharedPage &rhs) |
| |
| | ~sharedPage () |
| | Default destructor. More...
|
| |
| | ~sharedPage () |
| |
| void | close () |
| | Unmaps, closes and unlinks (if master and name is set) the shared file. More...
|
| |
| void | close () |
| |
| void | init (std::string name_, unsigned int len_, bool master_=false, bool autoBackoff=true) |
| | Initialize a page, de-initialize before if needed. More...
|
| |
| void | init (std::string name_, unsigned int len_, bool master_=false, bool autoBackoff=true) |
| |
| | operator bool () const |
| |
| | operator bool () const |
| | Returns whether the shared file is valid or not. More...
|
| |
| bool | operator< (const sharedFile &rhs) const |
| |
| bool | operator< (const sharedFile &rhs) const |
| |
| void | unmap () |
| | Unmaps a shared file if allowed. More...
|
| |
| void | unmap () |
| |
|
| int | handle |
| | The fd handle of the opened shared file. More...
|
| |
| long long int | len |
| | The size in bytes of the opened shared file. More...
|
| |
| char * | mapped |
| | A pointer to the payload of the file file. More...
|
| |
| bool | master |
| | Whether this class should unlink the shared file upon deletion or not. More...
|
| |
| std::string | name |
| | The name of the opened shared file. More...
|
| |
A class for handling shared memory pages.
Uses shared files at its backbone, defined for portability
| IPC::sharedPage::sharedPage |
( |
std::string |
name_ = "", |
|
|
unsigned int |
len_ = 0, |
|
|
bool |
master_ = false, |
|
|
bool |
autoBackoff = true |
|
) |
| |
brief Creates a shared page
- Parameters
-
| name_ | The name of the page to be created |
| len_ | The size to make the page |
| master_ | Whether to create or merely open the page |
| autoBackoff | When only opening the page, wait for it to appear or fail |
| IPC::sharedPage::sharedPage |
( |
const sharedPage & |
rhs | ) |
|
Creates a copy of a shared page.
- Parameters
-
| IPC::sharedPage::~sharedPage |
( |
| ) |
|
| IPC::sharedPage::sharedPage |
( |
std::string |
name_ = "", |
|
|
unsigned int |
len_ = 0, |
|
|
bool |
master_ = false, |
|
|
bool |
autoBackoff = true |
|
) |
| |
| IPC::sharedPage::sharedPage |
( |
const sharedPage & |
rhs | ) |
|
| IPC::sharedPage::~sharedPage |
( |
| ) |
|
| void IPC::sharedFile::close |
( |
| ) |
|
|
inherited |
Unmaps, closes and unlinks (if master and name is set) the shared file.
| void IPC::sharedFile::close |
( |
| ) |
|
|
inherited |
| void IPC::sharedFile::init |
( |
std::string |
name_, |
|
|
unsigned int |
len_, |
|
|
bool |
master_ = false, |
|
|
bool |
autoBackoff = true |
|
) |
| |
|
inherited |
| void IPC::sharedFile::init |
( |
std::string |
name_, |
|
|
unsigned int |
len_, |
|
|
bool |
master_ = false, |
|
|
bool |
autoBackoff = true |
|
) |
| |
|
inherited |
Initialize a page, de-initialize before if needed.
- Parameters
-
| name_ | The name of the page to be created |
| len_ | The size to make the page |
| master_ | Whether to create or merely open the page |
| autoBackoff | When only opening the page, wait for it to appear or fail |
- Todo:
- Use ACCESSPERMS instead of 0600?
| IPC::sharedFile::operator bool |
( |
| ) |
const |
|
inherited |
| IPC::sharedFile::operator bool |
( |
| ) |
const |
|
inherited |
Returns whether the shared file is valid or not.
| bool IPC::sharedFile::operator< |
( |
const sharedFile & |
rhs | ) |
const |
|
inlineinherited |
| bool IPC::sharedFile::operator< |
( |
const sharedFile & |
rhs | ) |
const |
|
inlineinherited |
| void IPC::sharedFile::unmap |
( |
| ) |
|
|
inherited |
Unmaps a shared file if allowed.
| void IPC::sharedFile::unmap |
( |
| ) |
|
|
inherited |
| int IPC::sharedFile::handle |
|
inherited |
The fd handle of the opened shared file.
| long long int IPC::sharedFile::len |
|
inherited |
The size in bytes of the opened shared file.
| char * IPC::sharedFile::mapped |
|
inherited |
A pointer to the payload of the file file.
| bool IPC::sharedFile::master |
|
inherited |
Whether this class should unlink the shared file upon deletion or not.
| std::string IPC::sharedFile::name |
|
inherited |
The name of the opened shared file.
The documentation for this class was generated from the following files: