A class for managing shared files.
More...
#include <shared_memory.h>
|
| sharedFile (std::string name_="", unsigned int len_=0, bool master_=false, bool autoBackoff=true) |
| brief Creates a shared file More...
|
|
| sharedFile (std::string name_="", unsigned int len_=0, bool master_=false, bool autoBackoff=true) |
|
| sharedFile (const sharedFile &rhs) |
| Creates a copy of a shared page. More...
|
|
| sharedFile (const sharedFile &rhs) |
|
| ~sharedFile () |
| Default destructor. More...
|
|
| ~sharedFile () |
|
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 |
| Returns whether the shared file is valid or not. More...
|
|
| operator bool () const |
|
bool | operator< (const sharedFile &rhs) const |
|
bool | operator< (const sharedFile &rhs) const |
|
void | operator= (sharedFile &rhs) |
| Assignment operator. More...
|
|
void | operator= (sharedFile &rhs) |
|
void | unmap () |
|
void | unmap () |
| Unmaps a shared file if allowed. More...
|
|
|
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 managing shared files.
IPC::sharedFile::sharedFile |
( |
std::string |
name_ = "" , |
|
|
unsigned int |
len_ = 0 , |
|
|
bool |
master_ = false , |
|
|
bool |
autoBackoff = true |
|
) |
| |
brief Creates a shared file
- Parameters
-
name_ | The name of the file to be created |
len_ | The size to make the file |
master_ | Whether to create or merely open the file |
autoBackoff | When only opening the file, wait for it to appear or fail |
IPC::sharedFile::sharedFile |
( |
const sharedFile & |
rhs | ) |
|
Creates a copy of a shared page.
- Parameters
-
IPC::sharedFile::~sharedFile |
( |
| ) |
|
IPC::sharedFile::sharedFile |
( |
std::string |
name_ = "" , |
|
|
unsigned int |
len_ = 0 , |
|
|
bool |
master_ = false , |
|
|
bool |
autoBackoff = true |
|
) |
| |
IPC::sharedFile::sharedFile |
( |
const sharedFile & |
rhs | ) |
|
IPC::sharedFile::~sharedFile |
( |
| ) |
|
void IPC::sharedFile::close |
( |
| ) |
|
Unmaps, closes and unlinks (if master and name is set) the shared file.
void IPC::sharedFile::close |
( |
| ) |
|
void IPC::sharedFile::init |
( |
std::string |
name_, |
|
|
unsigned int |
len_, |
|
|
bool |
master_ = false , |
|
|
bool |
autoBackoff = true |
|
) |
| |
void IPC::sharedFile::init |
( |
std::string |
name_, |
|
|
unsigned int |
len_, |
|
|
bool |
master_ = false , |
|
|
bool |
autoBackoff = true |
|
) |
| |
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 |
Returns whether the shared file is valid or not.
IPC::sharedFile::operator bool |
( |
| ) |
const |
bool IPC::sharedFile::operator< |
( |
const sharedFile & |
rhs | ) |
const |
|
inline |
bool IPC::sharedFile::operator< |
( |
const sharedFile & |
rhs | ) |
const |
|
inline |
void IPC::sharedFile::operator= |
( |
sharedFile & |
rhs | ) |
|
void IPC::sharedFile::operator= |
( |
sharedFile & |
rhs | ) |
|
void IPC::sharedFile::unmap |
( |
| ) |
|
Unmaps a shared file if allowed.
void IPC::sharedFile::unmap |
( |
| ) |
|
int IPC::sharedFile::handle |
The fd handle of the opened shared file.
long long int IPC::sharedFile::len |
The size in bytes of the opened shared file.
char * IPC::sharedFile::mapped |
A pointer to the payload of the file file.
bool IPC::sharedFile::master |
Whether this class should unlink the shared file upon deletion or not.
std::string IPC::sharedFile::name |
The name of the opened shared file.
The documentation for this class was generated from the following files: