Pipe
This class represents pipe objects. A set of filters can be placed into a pipe, and information flows through the pipe until it reaches the end, where the output is collected for retrieval. If you're familiar with the Unix shell environment, this design will sound quite familiar.
An opaque type that identifies a message in this Pipe
Exception if you use an invalid message as an argument to read, remaining, etc
string where | the error occured |
message_id msg | the invalid message id that was used |
A meta-id for whatever the last message is
A meta-id for the default message (set with set_defaultMsg)
Write input to the pipe, i.e. to its first filter.
const(ubyte)* input | the ubyte array to write |
size_t length | the length of the ubyte array in |
Write input to the pipe, i.e. to its first filter.
RefCounted!(Vector!(T, ALLOC), ALLOC) input | the SecureVector containing the data to write |
Write input to the pipe, i.e. to its first filter.
Vector!(T, ALLOC) input | the std::vector containing the data to write |
Write input to the pipe, i.e. to its first filter.
string input | the string containing the data to write |
Write input to the pipe, i.e. to its first filter.
DataSource source | the DataSource to read the data from |
Write input to the pipe, i.e. to its first filter.
ubyte input | a single ubyte to be written |
Write input to the pipe, i.e. to its first filter.
ubyte[] input | a ubyte array to be written |
Perform startMsg(), write() and endMsg() sequentially.
const(ubyte)* input | the ubyte array containing the data to write |
size_t length | the length of the ubyte array to write |
Perform startMsg(), write() and endMsg() sequentially.
Vector!(ubyte, ALLOC) input | the SecureVector containing the data to write |
Perform startMsg(), write() and endMsg() sequentially.
RefCounted!(Vector!(ubyte, ALLOC), ALLOC) input | the SecureVector containing the data to write |
Perform startMsg(), write() and endMsg() sequentially.
string input | the string containing the data to write |
Perform startMsg(), write() and endMsg() sequentially.
DataSource input | the DataSource providing the data to write |
Find out how many bytes are ready to read.
message_id msg | the number identifying the message for which the information is desired |
Read the default message from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.
ubyte* output | the ubyte array to write the read bytes to |
size_t length | the length of the ubyte array output |
Read a specified message from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.
ubyte* output | the ubyte array to write the read bytes to |
size_t length | the length of the ubyte array output |
message_id msg | the number identifying the message to read from |
Read a specified message from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.
ubyte[] output | the ubyte array to write the read bytes to |
message_id msg | the number identifying the message to read from |
Read the full contents of the pipe.
message_id msg | the number identifying the message to read from |
Read the full contents of the pipe.
message_id msg | the number identifying the message to read from |
Read from the default message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.
ubyte* output | the ubyte array to write the peeked message part to |
size_t length | the length of the ubyte array output |
size_t offset | the offset from the current position in message |
message_id msg | the number identifying the message to peek from |
Read from the specified message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.
ubyte[] output | the ubyte array to write the peeked message part to |
size_t offset | the offset from the current position in message |
message_id msg | the number identifying the message to peek from |
Read a single ubyte from the specified message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.
ubyte output | the ubyte to write the peeked message ubyte to |
size_t offset | the offset from the current position in message |
message_id msg | the number identifying the message to peek from |
Read one ubyte.
ubyte output | the ubyte to read to |
Peek at one ubyte.
ubyte output | an output ubyte |
Discard the next N bytes of the data
size_t n | the number of bytes to discard |
Set the default message
message_id msg | the number identifying the message which is going to be the new default message |
Get the number of messages the are in this pipe.
Test whether this pipe has any data that can be read from.
Start a new message in the pipe. A potential other message in this pipe must be closed with endMsg() before this function may be called.
End the current message.
Insert a new filter at the front of the pipe
Filter filter | the new filter to insert |
Insert a new filter at the back of the pipe
Filter filter | the new filter to insert |
Remove the first filter at the front of the pipe.
Reset this pipe to an empty pipe.
Construct a Pipe of up to four filters. The filters are set up in the same order as the arguments.
Construct a Pipe from a list of filters
Filter[] filters | the set of filters to use |