![]() |
Home | Libraries | People | FAQ | More |
boost::interprocess::shared_memory_object
// In header: <boost/interprocess/shared_memory_object.hpp> class shared_memory_object { public: // construct/copy/destruct () ; (create_only_t, , , permissions & = permissions()); (open_or_create_t, , , permissions & = permissions()); (open_only_t, , ); (create_only_t, , , permissions & = permissions()); (open_or_create_t, , , permissions & = permissions()); (open_only_t, , ); (shared_memory_object &&) ; shared_memory_object & (shared_memory_object &&) ; ~(); // public member functions (shared_memory_object &) ; (); () ; () ; () ; () ; // public static functions (); (); };
A class that wraps a shared memory mapping that can be used to create mapped regions from the mapped files
shared_memory_object
public
construct/copy/destruct() ;Default constructor. Represents an empty
shared_memory_object
. (create_only_t, name, mode, permissions & perm = permissions());
Creates a shared memory object with name "name" and mode "mode", with the access mode "mode" If the file previously exists, throws an error.*<zwj></zwj>/
(open_or_create_t, name, mode, permissions & perm = permissions());
Tries to create a shared memory object with name "name" and mode "mode", with the access mode "mode". If the file previously exists, it tries to open it with mode "mode". Otherwise throws an error.
(open_only_t, name, mode);
Tries to open a shared memory object with name "name", with the access mode "mode". If the file does not previously exist, it throws an error.
(create_only_t, name, mode, permissions & perm = permissions());
Creates a shared memory object with name "name" and mode "mode", with the access mode "mode" If the file previously exists, throws an error.
Note: This function is only available on operating systems with native wchar_t APIs (e.g. Windows).
(open_or_create_t, name, mode, permissions & perm = permissions());
Tries to create a shared memory object with name "name" and mode "mode", with the access mode "mode". If the file previously exists, it tries to open it with mode "mode". Otherwise throws an error.
Note: This function is only available on operating systems with native wchar_t APIs (e.g. Windows).
(open_only_t, name, mode);
Tries to open a shared memory object with name "name", with the access mode "mode". If the file does not previously exist, it throws an error.
Note: This function is only available on operating systems with native wchar_t APIs (e.g. Windows).
(shared_memory_object && moved) ;
Moves the ownership of "moved"'s shared memory object to *this. After the call, "moved" does not represent any shared memory object. Does not throw
shared_memory_object & (shared_memory_object && moved) ;
Moves the ownership of "moved"'s shared memory to *this. After the call, "moved" does not represent any shared memory. Does not throw
~();
Destroys *this and indicates that the calling process is finished using the resource. All mapped regions are still valid after destruction. The destructor function will deallocate any system resources allocated by the system for use by this process for this resource. The resource can still be opened again calling the open constructor overload. To erase the resource from the system use remove().
shared_memory_object
public member functions(shared_memory_object & moved) ;Swaps the shared_memory_objects. Does not throw.
( length);Sets the size of the shared memory mapping.
() ;Returns the name of the shared memory object.
( size) ;
Returns true if the size of the shared memory object can be obtained and writes the size in the passed reference
() ;Returns access mode.
() ;Returns mapping handle. Never throws.