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++));
74 #endif // __WVFUNCTORENCODER_H
T * alloc(size_t count)
Allocates exactly the specified number of elements and returns a pointer to an UNINITIALIZED storage ...
virtual bool _typedencode(IBuffer &inbuf, OBuffer &outbuf, bool flush)
Typed variant of _encode().
size_t optgettable() const
Returns the optimal maximum number of elements in the buffer currently available for reading without ...
The generic buffer base type.
This template facilitates the creation and use of encoders that manipulate typed buffers.
virtual bool _reset()
Template method implementation of reset().
Functor specifies the functor type which must have an operator() with a signature compatible with inv...
bool flush(IBuffer &inbuf, OBuffer &outbuf, bool finish=false)
Typed variant of flush().
size_t optallocable() const
Returns the optimal maximum number of elements that the buffer can currently accept for writing witho...
const T * get(size_t count)
Reads exactly the specified number of elements and returns a pointer to a storage location owned by t...