ProcessDetailsCollection
in package
implements
IteratorAggregate
The Process Details Collection Class
Table of Contents
Interfaces
- IteratorAggregate
Properties
- $processDetails : array<string|int, ProcessDetails>
- $freeProcessIds : array<string|int, mixed>
- $sockets : array<string|int, SimpleSocket>
Methods
- addFree() : ProcessDetailsCollection
- Adds the ProcessDetails to the list and registers it as a free one.
- getAllProcesssDetails() : array<string|int, ProcessDetails>
- Get all ProcessDetails by reference
- getFreeProcessesCount() : int
- Get the count of free processes
- getIterator() : ArrayIterator
- getProcessDetails() : ProcessDetails
- Get a ProcessDetails of the given PID
- getProcessesCount() : int
- Get the count of processes
- getSockets() : array<string|int, SimpleSocket>
- Returns the associated sockets of all processes in the list.
- hasProcess() : bool
- Checks if the ProcessDetails with given PID is in the list.
- killAllProcesses() : void
- Sends the kill signal to all processes and removes them from the list.
- registerFreeProcess() : ProcessDetailsCollection
- Register a ProcessDetails as free
- registerFreeProcessId() : ProcessDetailsCollection
- Register the ProcessDetails with the given PID as free.
- remove() : ProcessDetailsCollection
- Removes the ProcessDetails from the list.
- takeFreeProcess() : ProcessDetails
- Takes one ProcessDetails from the list of free ProcessDetails. Returns NULL if no free process is available.
Properties
$processDetails
public
array<string|int, ProcessDetails>
$processDetails
= array()
the details
$freeProcessIds
protected
array<string|int, mixed>
$freeProcessIds
= array()
the free process ids
$sockets
protected
array<string|int, SimpleSocket>
$sockets
= array()
all sockets
Methods
addFree()
Adds the ProcessDetails to the list and registers it as a free one.
public
addFree(ProcessDetails $processDetails) : ProcessDetailsCollection
Parameters
- $processDetails : ProcessDetails
Return values
ProcessDetailsCollectiongetAllProcesssDetails()
Get all ProcessDetails by reference
public
& getAllProcesssDetails() : array<string|int, ProcessDetails>
Return values
array<string|int, ProcessDetails>getFreeProcessesCount()
Get the count of free processes
public
getFreeProcessesCount() : int
Return values
intgetIterator()
public
getIterator() : ArrayIterator
Tags
Return values
ArrayIteratorgetProcessDetails()
Get a ProcessDetails of the given PID
public
getProcessDetails(int $pid) : ProcessDetails
Parameters
- $pid : int
Return values
ProcessDetailsgetProcessesCount()
Get the count of processes
public
getProcessesCount() : int
Return values
intgetSockets()
Returns the associated sockets of all processes in the list.
public
& getSockets() : array<string|int, SimpleSocket>
Return values
array<string|int, SimpleSocket>hasProcess()
Checks if the ProcessDetails with given PID is in the list.
public
hasProcess(int $pid) : bool
Parameters
- $pid : int
Return values
boolkillAllProcesses()
Sends the kill signal to all processes and removes them from the list.
public
killAllProcesses() : void
registerFreeProcess()
Register a ProcessDetails as free
public
registerFreeProcess(ProcessDetails $processDetails) : ProcessDetailsCollection
Parameters
- $processDetails : ProcessDetails
Tags
Return values
ProcessDetailsCollectionregisterFreeProcessId()
Register the ProcessDetails with the given PID as free.
public
registerFreeProcessId(int $pid) : ProcessDetailsCollection
Parameters
- $pid : int
Return values
ProcessDetailsCollectionremove()
Removes the ProcessDetails from the list.
public
remove(ProcessDetails $processDetails) : ProcessDetailsCollection
Parameters
- $processDetails : ProcessDetails
Tags
Return values
ProcessDetailsCollectiontakeFreeProcess()
Takes one ProcessDetails from the list of free ProcessDetails. Returns NULL if no free process is available.
public
takeFreeProcess() : ProcessDetails