This is automatic generated document for things in Swow\SharedBuffer class
Class SharedBuffer
A shared memory byte buffer with named and anonymous mappings.
An anonymous buffer is visible to threads of this process and to a forked child. A named buffer is visible to another process that attaches the same name. The buffer does not lock. The caller coordinates access. The typed methods use offsetBytes as a byte offset and count as an element count. The endian argument selects the byte order.
Constants
Store and load typed values in big-endian order.
Store and load typed values in little-endian order.
Use the byte order of this machine.
Methods
Static method attachNamed
Attach a named buffer.
Static method createNamed
Create a named buffer.
Static method unlink
Remove a name. An existing mapping stays valid.
Method __construct
Create an anonymous buffer.
Param int $size size in bytes
Throws \ValueError when the size is not positive Throws \Swow\SyncException when the buffer cannot be created
Method __debugInfo
Return debug information.
Method __serialize
Serialize the buffer by name or shared object id.
Method __unserialize
Restore the buffer from a name or shared object id.
Method clear
Set all bytes to zero.
Method copyFrom
Copy bytes between buffers.
Method fill
Fill bytes with one value.
Method getName
Return the name, or null for an anonymous buffer.
Method getSharedId
Return the shared object id.
Method getSize
Return the buffer size in bytes.
Method read
Copy bytes out of the buffer.
Method viewF32
Load 32-bit float values at a byte offset.
Method viewF64
Load 64-bit float values at a byte offset.
Method viewI16
Load signed 16-bit integers at a byte offset.
Method viewI32
Load signed 32-bit integers at a byte offset.
Method viewI64
Load signed 64-bit integers at a byte offset.
Method viewI8
Load signed 8-bit integers at a byte offset.
Method viewU16
Load unsigned 16-bit integers at a byte offset.
Method viewU32
Load unsigned 32-bit integers at a byte offset.
Method viewU64
Load unsigned 64-bit integers at a byte offset.
Method viewU8
Load unsigned 8-bit integers at a byte offset.
Method write
Copy bytes into the buffer.
Method writeF32
Store 32-bit float values at a byte offset.
Method writeF64
Store 64-bit float values at a byte offset.
Method writeI16
Store signed 16-bit integers at a byte offset.
Method writeI32
Store signed 32-bit integers at a byte offset.
Method writeI64
Store signed 64-bit integers at a byte offset.
Method writeI8
Store signed 8-bit integers at a byte offset.
Method writeU16
Store unsigned 16-bit integers at a byte offset.
Method writeU32
Store unsigned 32-bit integers at a byte offset.
Method writeU64
Store unsigned 64-bit integers at a byte offset.
Method writeU8
Store unsigned 8-bit integers at a byte offset.