aether::blob Class Reference

manages a memory area and provides access to it via an aether::container::span More...

#include <blob_store.hh>

Public Member Functions

 blob (const std::string &sh_mem_name)
 tries to open the shared memory using its name and maps it the the process address space More...
 
 blob (std::vector< char > &&data, const std::string &sh_mem_name, const std::string &error_msg)
 if data is non empty it creates a shared memory, maps it to the process space and copies the data there More...
 
bool is_valid (std::string *error=nullptr) const
 returns true if valid, false otherwise. More...
 
container::span< const char > get () const
 provides access to the shared memory More...
 
 blob ()=default
 
 blob (const blob &)=default
 
 blob (blob &&)=default
 
bloboperator= (const blob &)=default
 
bloboperator= (blob &&)=default
 

Detailed Description

manages a memory area and provides access to it via an aether::container::span

Constructor & Destructor Documentation

aether::blob::blob ( const std::string &  sh_mem_name)

tries to open the shared memory using its name and maps it the the process address space

throws boost::inteprocess::interprocess_exceptions if it fails

aether::blob::blob ( std::vector< char > &&  data,
const std::string &  sh_mem_name,
const std::string &  error_msg 
)

if data is non empty it creates a shared memory, maps it to the process space and copies the data there

if data is empyt propagates the error message

throws boost::inteprocess::interprocess_exceptions if it fails

aether::blob::blob ( )
default
aether::blob::blob ( const blob )
default
aether::blob::blob ( blob &&  )
default

Member Function Documentation

container::span<const char> aether::blob::get ( ) const

provides access to the shared memory

bool aether::blob::is_valid ( std::string *  error = nullptr) const

returns true if valid, false otherwise.

If a string pointer is provided the error message will be copied

blob& aether::blob::operator= ( const blob )
default
blob& aether::blob::operator= ( blob &&  )
default