Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class xsi_shared_memory

boost::interprocess::xsi_shared_memory

Synopsis

// In header: <boost/interprocess/xsi_shared_memory.hpp>


class xsi_shared_memory {
public:
  // construct/copy/destruct
  () ;
  (open_only_t, );
  (create_only_t, xsi_key &, , 
                    permissions & = permissions());
  (open_or_create_t, xsi_key &, , 
                    permissions & = permissions());
  (open_only_t, xsi_key &);
  (xsi_shared_memory &&) ;
  xsi_shared_memory & (xsi_shared_memory &&) ;
  ~();

  // public member functions
   (xsi_shared_memory &) ;
   () ;
   () ;

  // public static functions
   ();
};

Description

A class that wraps XSI (System V) shared memory. Unlike shared_memory_object, xsi_shared_memory needs a valid xsi_key to identify a shared memory object.

Warning: XSI shared memory and interprocess portable shared memory (boost::interprocess::shared_memory_object) can't communicate between them.

xsi_shared_memory public construct/copy/destruct

  1. () ;

    Default constructor. Represents an empty xsi_shared_memory.

  2. (open_only_t,  shmid);

    Initializes *this with a shmid previously obtained (possibly from another process) This lower-level initializer allows shared memory mapping without having a key.

  3. (create_only_t, xsi_key & key,  size, 
                      permissions & perm = permissions());

    Creates a new XSI shared memory from 'key', with size "size" and permissions "perm". If the shared memory previously exists, throws an error.

  4. (open_or_create_t, xsi_key & key,  size, 
                      permissions & perm = permissions());

    Opens an existing shared memory with identifier 'key' or creates a new XSI shared memory from identifier 'key', with size "size" and permissions "perm".

  5. (open_only_t, xsi_key & key);

    Tries to open a XSI shared memory with identifier 'key' If the shared memory does not previously exist, it throws an error.

  6. (xsi_shared_memory && 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

  7. xsi_shared_memory & (xsi_shared_memory && moved) ;

    Moves the ownership of "moved"'s shared memory to *this. After the call, "moved" does not represent any shared memory. Does not throw

  8. ~();

    Destroys *this. The shared memory won't be destroyed, just this connection to it. Use remove() to destroy the shared memory.

xsi_shared_memory public member functions

  1.  (xsi_shared_memory & other) ;
    Swaps two xsi_shared_memorys. Does not throw.
  2.  () ;

    Returns the shared memory ID that identifies the shared memory

  3.  () ;

    Returns the mapping handle. Never throws

xsi_shared_memory public static functions

  1.  ( shmid);

    Erases the XSI shared memory object identified by shmid from the system. Returns false on error. Never throws


PrevUpHomeNext