WvStreams
|
Functor specifies the functor type which must have an operator() with a signature compatible with invocations of the form: const IT data = ...; OT result = func(data);. More...
#include <wvfunctorencoder.h>
Public Types | |
typedef FT | FType |
typedef IT | IType |
typedef OT | OType |
typedef WvBufBase< IType > | IBuffer |
typedef WvBufBase< OType > | OBuffer |
typedef WvBufViewBase< IType > | IBufferView |
typedef WvBufViewBase< OType > | OBufferView |
Public Member Functions | |
WvFunctorEncoder (const FType &f) | |
bool | encode (IBuffer &inbuf, OBuffer &outbuf, bool flush=false, bool finish=false) |
Typed variant of encode(). More... | |
bool | encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false) |
bool | flush (IBuffer &inbuf, OBuffer &outbuf, bool finish=false) |
Typed variant of flush(). More... | |
bool | flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false) |
bool | finish (OBuffer &outbuf) |
Typed variant of finish(). More... | |
bool | finish (WvBuf &outbuf) |
Protected Member Functions | |
virtual bool | _typedencode (IBuffer &inbuf, OBuffer &outbuf, bool flush) |
Typed variant of _encode(). More... | |
virtual bool | _reset () |
virtual bool | _typedfinish (OBuffer &outbuf) |
Typed variant of _finish(). More... | |
virtual bool | _encode (WvBuf &inbuf, WvBuf &outbuf, bool flush) |
Wrapper implementation of _encode(). More... | |
virtual bool | _finish (WvBuf &outbuf) |
Wrapper implementation of _finish(). More... | |
Protected Attributes | |
FT | f |
Functor specifies the functor type which must have an operator() with a signature compatible with invocations of the form: const IT data = ...; OT result = func(data);.
The best way to use this monster is to subclass with friendly names for the implementations that are needed. For maximum performance, define the functor as a struct that provides an operator() inline. This is extremely efficent since this class is templated, so there's room for lots of compiler optimization.
"IT" is the input buffer datatype "OT" is the output buffer datatype "FT" is the functor type
Definition at line 31 of file wvfunctorencoder.h.
|
inlineprotectedvirtual |
Typed variant of _encode().
Implements WvTypedEncoder< IT, OT >.
Definition at line 46 of file wvfunctorencoder.h.
References WvBufBaseCommonImpl< T >::alloc(), WvTypedEncoder< IT, OT >::flush(), WvBufBaseCommonImpl< T >::get(), WvBufBaseCommonImpl< T >::optallocable(), and WvBufBaseCommonImpl< T >::optgettable().
|
inlineinherited |
Typed variant of encode().
Definition at line 47 of file wvtypedencoder.h.
References WvTypedEncoder< IT, OT, S >::finish(), and WvTypedEncoder< IT, OT, S >::flush().
|
inlineinherited |
Typed variant of flush().
Definition at line 59 of file wvtypedencoder.h.
References WvTypedEncoder< IT, OT, S >::finish().
Referenced by WvFunctorEncoder< IT, OT, FT >::_typedencode().
|
inlineinherited |
|
inlineprotectedvirtualinherited |
Typed variant of _finish().
Definition at line 103 of file wvtypedencoder.h.
|
inlineprotectedvirtualinherited |
Wrapper implementation of _encode().
Definition at line 107 of file wvtypedencoder.h.
References WvTypedEncoder< IT, OT, S >::_typedencode().
|
inlineprotectedvirtualinherited |
Wrapper implementation of _finish().
Definition at line 116 of file wvtypedencoder.h.
References WvTypedEncoder< IT, OT, S >::_typedfinish().