Redirector Class Reference

Redirect input to another BufferedTransformation without owning it. More...

Inheritance diagram for Redirector:

## Public Types

enum | Behavior { DATA_ONLY = 0x00 , PASS_SIGNALS = 0x01 , PASS_WAIT_OBJECTS = 0x02 , PASS_EVERYTHING = PASS_SIGNALS | PASS_WAIT_OBJECTS }
| Controls signal propagation behavior. More...

## Public Member Functions

| Redirector ()
| Construct a Redirector.
| Redirector (BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING)
| Construct a Redirector. More...
void | Redirect (BufferedTransformation &target)
| Redirect input to another BufferedTransformation. More...
void | StopRedirection ()
| Stop redirecting input.
Behavior | GetBehavior ()
| Retrieve signal propagation behavior. More...
void | SetBehavior (Behavior behavior)
| Set signal propagation behavior. More...
bool | GetPassSignals () const
| Retrieve signal propagation behavior. More...
void | SetPassSignals (bool pass)
| Set signal propagation behavior. More...
bool | GetPassWaitObjects () const
| Retrieve signal propagation behavior. More...
void | SetPassWaitObjects (bool pass)
| Set signal propagation behavior. More...
bool | CanModifyInput () const
void | Initialize (const NameValuePairs &parameters, int propagation)
| Initialize or reinitialize this object, with signal propagation. More...
byte * | CreatePutSpace (size_t &size)
size_t | Put2 (const byte *inString, size_t length, int messageEnd, bool blocking)
bool | Flush (bool hardFlush, int propagation=-1, bool blocking=true)
| Flush buffered input and/or output, with signal propagation. More...
bool | MessageSeriesEnd (int propagation=-1, bool blocking=true)
byte * | ChannelCreatePutSpace (const std::string &channel, size_t &size)
size_t | ChannelPut2 (const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking)
size_t | ChannelPutModifiable2 (const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking)
bool | ChannelFlush (const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
bool | ChannelMessageSeriesEnd (const std::string &channel, int propagation=-1, bool blocking=true)
unsigned int | GetMaxWaitObjectCount () const
void | GetWaitObjects (WaitObjectContainer &container, CallStack const &callStack)
Public Member Functions inherited from CustomFlushPropagation< T >

## Detailed Description

Redirect input to another BufferedTransformation without owning it.

Since
  Crypto++ 4.0

Definition at line 883 of file filters.h.

## Member Enumeration Documentation

## Behavior

enum Redirector::Behavior

Controls signal propagation behavior.

Enumerator
DATA_ONLY | Pass data only.
PASS_SIGNALS | Pass signals.
PASS_WAIT_OBJECTS | Pass wait events.
PASS_EVERYTHING | Pass everything. PASS_EVERYTHING is default

Definition at line 888 of file filters.h.

## Constructor & Destructor Documentation

## Redirector()

Redirector::Redirector | ( | BufferedTransformation & | target,
|  | Behavior | behavior = `PASS_EVERYTHING`
| ) |  |

inline

Construct a Redirector.

Parameters

  target | the destination BufferedTransformation
  behavior | Behavior "flags" specifying signal propagation

Definition at line 909 of file filters.h.

## Member Function Documentation

## Redirect()

void Redirector::Redirect | ( | BufferedTransformation & | target | ) |

inline

Redirect input to another BufferedTransformation.

Parameters

  target | the destination BufferedTransformation

Definition at line 914 of file filters.h.

## GetBehavior()

Behavior Redirector::GetBehavior | ( |  | ) |

inline

Retrieve signal propagation behavior.

Returns
  the current signal propagation behavior

Definition at line 920 of file filters.h.

## SetBehavior()

void Redirector::SetBehavior | ( | Behavior | behavior | ) |

inline

Set signal propagation behavior.

Parameters

  behavior | the new signal propagation behavior

Definition at line 923 of file filters.h.

## GetPassSignals()

bool Redirector::GetPassSignals | ( |  | ) | const

inline

Retrieve signal propagation behavior.

Returns
  true if the Redirector passes signals, false otherwise.

Definition at line 926 of file filters.h.

## SetPassSignals()

void Redirector::SetPassSignals | ( | bool | pass | ) |

inline

Set signal propagation behavior.

Parameters

  pass | flag indicating if the Redirector should pass signals

Definition at line 929 of file filters.h.

## GetPassWaitObjects()

bool Redirector::GetPassWaitObjects | ( |  | ) | const

inline

Retrieve signal propagation behavior.

Returns
  true if the Redirector passes wait objects, false otherwise.

Definition at line 932 of file filters.h.

## SetPassWaitObjects()

void Redirector::SetPassWaitObjects | ( | bool | pass | ) |

inline

Set signal propagation behavior.

Parameters

  pass | flag indicating if the Redirector should pass wait objects

Definition at line 935 of file filters.h.

## Initialize()

void Redirector::Initialize | ( | const NameValuePairs & | parameters,
|  | int | propagation
| ) |  |

virtual

Initialize or reinitialize this object, with signal propagation.

Parameters

  parameters | a set of NameValuePairs to initialize or reinitialize this object
  propagation | the number of attached transformations the Initialize() signal should be passed

Initialize() is used to initialize or reinitialize an object using a variable number of arbitrarily typed arguments. The function avoids the need for multiple constructors providing all possible combintations of configurable parameters.

propagation count includes this object. Setting propagation to `1` means this object only. Setting propagation to `-1` means unlimited propagation.

Implements CustomSignalPropagation< Sink >.

## Flush()

bool Redirector::Flush | ( | bool | hardFlush,
|  | int | propagation = `-1`,
|  | bool | blocking = `true`
| ) |  |

inline virtual

Flush buffered input and/or output, with signal propagation.

Parameters

  hardFlush | is used to indicate whether all data should be flushed
  propagation | the number of attached transformations the Flush() signal should be passed
  blocking | specifies whether the object should block when processing input

propagation count includes this object. Setting propagation to `1` means this object only. Setting propagation to `-1` means unlimited propagation.

Note
  Hard flushes must be used with care. It means try to process and output everything, even if there may not be enough data to complete the action. For example, hard flushing a HexDecoder would cause an error if you do it after inputing an odd number of hex encoded characters.
  For some types of filters, like ZlibDecompressor, hard flushes can only be done at "synchronization points". These synchronization points are positions in the data stream that are created by hard flushes on the corresponding reverse filters, in this example ZlibCompressor. This is useful when zlib compressed data is moved across a network in packets and compression state is preserved across packets, as in the SSH2 protocol.

Implements CustomFlushPropagation< T >.

Definition at line 953 of file filters.h.

The documentation for this class was generated from the following file:

- filters.h