# Processor.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/core/data/buffer/Processor.hpp"
# InlineReadData
Convenience structure for stream Async-Inline read operations.
namespace oatpp { namespace data { namespace buffer {
struct InlineReadData {}
}}}
# Fields
Type | Name | Summary |
---|---|---|
void* | currBufferPtr | Pointer to current position in the buffer. |
v_buff_size | bytesLeft | Bytes left to read to the buffer. |
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | InlineReadData | Multiple implementations:
|
void | set | Set currBufferPtr and bytesLeft values. |
void | inc | Increase position in the read buffer by amount bytes. |
void | setEof | Same as inc(bytesLeft). |
# InlineReadData::currBufferPtr
Pointer to current position in the buffer.
void* currBufferPtr
# InlineReadData::bytesLeft
Bytes left to read to the buffer.
v_buff_size bytesLeft
# InlineReadData::InlineReadData
- Default constructor.
InlineReadData()
- Constructor.
- @param data
- @param size
InlineReadData(void* data, v_buff_size size)
# InlineReadData::set
Set currBufferPtr
and bytesLeft
values.
- @param data - pointer to buffer to store read data.
- @param size - size in bytes of the buffer.
void set(void* data, v_buff_size size)
# InlineReadData::inc
Increase position in the read buffer by amount
bytes.
This will increase currBufferPtr
and descrease bytesLeft
values.
- @param amount
void inc(v_buff_size amount)
# InlineReadData::setEof
Same as inc(bytesLeft).
void setEof()
# InlineWriteData
Convenience structure for stream Async-Inline write operations.
namespace oatpp { namespace data { namespace buffer {
struct InlineWriteData {}
}}}
# Fields
Type | Name | Summary |
---|---|---|
const void* | currBufferPtr | Pointer to current position in the buffer. |
v_buff_size | bytesLeft | Bytes left to write from the buffer. |
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | InlineWriteData | Multiple implementations:
|
void | set | Set currBufferPtr and bytesLeft values. |
void | inc | Increase position in the write buffer by amount bytes. |
void | setEof | Same as inc(bytesLeft). |
# InlineWriteData::currBufferPtr
Pointer to current position in the buffer.
const void* currBufferPtr
# InlineWriteData::bytesLeft
Bytes left to write from the buffer.
v_buff_size bytesLeft
# InlineWriteData::InlineWriteData
- Default constructor.
InlineWriteData()
- Constructor.
- @param data
- @param size
InlineWriteData(const void* data, v_buff_size size)
# InlineWriteData::set
Set currBufferPtr
and bytesLeft
values.
- @param data - pointer to buffer containing data to be written.
- @param size - size in bytes of the buffer.
void set(const void* data, v_buff_size size)
# InlineWriteData::inc
Increase position in the write buffer by amount
bytes.
This will increase currBufferPtr
and descrease bytesLeft
values.
- @param amount
void inc(v_buff_size amount)
# InlineWriteData::setEof
Same as inc(bytesLeft).
void setEof()
# Processor
Buffer processor. Note: all processors are considered to be stateful.
namespace oatpp { namespace data { namespace buffer {
class Processor {}
}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | ~Processor | Default virtual destructor. |
v_io_size | suggestInputStreamReadSize | If the client is using the input stream to read data and push it to the processor, |
v_int32 | iterate | Process data. |
# Processor::~Processor
Default virtual destructor.
virtual ~Processor() = default
# Processor::suggestInputStreamReadSize
If the client is using the input stream to read data and push it to the processor, the client MAY ask the processor for a suggested read size.
- @return - suggested read size.
virtual v_io_size suggestInputStreamReadSize() = 0
# Processor::iterate
Process data.
- @param dataIn - data provided by client to processor. Input data. data::buffer::InlineReadData. Set
dataIn
buffer pointer tonullptr
to designate the end of input. - @param dataOut - data provided to client by processor. Output data. data::buffer::InlineReadData.
- @return - Processor::Error.
virtual v_int32 iterate(data::buffer::InlineReadData& dataIn,
data::buffer::InlineReadData& dataOut) = 0
# Processor::Error
Enum of processing errors.
namespace oatpp { namespace data { namespace buffer {
class Processor {}
}}}
# Processor::Error::OK
No error.
OK = 0
# Processor::Error::PROVIDE_DATA_IN
Caller must set fields of dataIn
parameter.
PROVIDE_DATA_IN = 1
# Processor::Error::FLUSH_DATA_OUT
Caller must read all the data from the dataOut
.
FLUSH_DATA_OUT = 2
# Processor::Error::FINISHED
Processing is finished.
FINISHED = 3
//*********************************************//
// Other values are processor-specific errors. //
//*********************************************//
# ProcessingPipeline
Pipeline of buffer processors.
namespace oatpp { namespace data { namespace buffer {
class ProcessingPipeline : public Processor {}
}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | ProcessingPipeline | Constructor. |
v_io_size | suggestInputStreamReadSize | If the client is using the input stream to read data and push it to the processor, |
v_int32 | iterate | Process data. |
# ProcessingPipeline::ProcessingPipeline
Constructor.
- @param m_processors - the array of processors defining the pipeline.
ProcessingPipeline(const std::vector<base::ObjectHandle<Processor>>& m_processors)
# ProcessingPipeline::suggestInputStreamReadSize
If the client is using the input stream to read data and push it to the processor, the client MAY ask the processor for a suggested read size.
- @return - suggested read size.
v_io_size suggestInputStreamReadSize() override
# ProcessingPipeline::iterate
Process data.
- @param dataIn - data provided by client to processor. Input data. data::buffer::InlineReadData. Set
dataIn
buffer pointer tonullptr
to designate the end of input. - @param dataOut - data provided to client by processor. Output data. data::buffer::InlineReadData.
- @return - Processor::Error.
v_int32 iterate(data::buffer::InlineReadData& dataIn,
data::buffer::InlineReadData& dataOut) override