9 #ifndef __WVFUNCTORENCODER_H
10 #define __WVFUNCTORENCODER_H
12 #include "wvtypedencoder.h"
30 template<
class IT,
class OT,
class FT>
57 const IType *indata = inbuf.
get(count);
58 OType *outdata = outbuf.
alloc(count);
60 *(outdata++) = f(*(indata++));
size_t optgettable() const
Returns the optimal maximum number of elements in the buffer currently available for reading without ...
const T * get(size_t count)
Reads exactly the specified number of elements and returns a pointer to a storage location owned by t...
size_t optallocable() const
Returns the optimal maximum number of elements that the buffer can currently accept for writing witho...
T * alloc(size_t count)
Allocates exactly the specified number of elements and returns a pointer to an UNINITIALIZED storage ...
The generic buffer base type.
Functor specifies the functor type which must have an operator() with a signature compatible with inv...
virtual bool _typedencode(IBuffer &inbuf, OBuffer &outbuf, bool flush)
Typed variant of _encode().
virtual bool _reset()
Template method implementation of reset().
This template facilitates the creation and use of encoders that manipulate typed buffers.
bool flush(IBuffer &inbuf, OBuffer &outbuf, bool finish=false)
Typed variant of flush().