7 #ifndef CRYPTOPP_CHANNELS_H 8 #define CRYPTOPP_CHANNELS_H 19 class MessageSwitch :
public Sink 23 void AddRoute(
unsigned int begin,
unsigned int end,
BufferedTransformation &destination,
const std::string &channel);
25 void Put(byte inByte);
26 void Put(
const byte *inString,
unsigned int length);
28 void Flush(
bool completeFlush,
int propagation=-1);
30 void PutMessageEnd(
const byte *inString,
unsigned int length,
int propagation=-1);
34 typedef std::pair<BufferedTransformation *, std::string> Route;
37 RangeRoute(
unsigned int begin,
unsigned int end,
const Route &route)
38 : begin(begin), end(end), route(route) {}
39 bool operator<(
const RangeRoute &rhs)
const {
return begin < rhs.begin;}
40 unsigned int begin, end;
44 typedef std::list<RangeRoute> RouteList;
45 typedef std::list<Route> DefaultRouteList;
48 DefaultRouteList m_defaultRoutes;
49 unsigned int m_nCurrentMessage;
56 typedef std::pair<BufferedTransformation *, std::string> Route;
57 typedef std::multimap<std::string, Route> RouteMap;
59 typedef std::pair<BufferedTransformation *, value_ptr<std::string> > DefaultRoute;
60 typedef std::list<DefaultRoute> DefaultRouteList;
63 typedef RouteMap::iterator MapIterator;
64 typedef DefaultRouteList::iterator ListIterator;
74 void Reset(
const std::string &channel);
78 const std::string & Channel();
81 std::string m_channel;
83 MapIterator m_itMapCurrent, m_itMapEnd;
84 ListIterator m_itListCurrent, m_itListEnd;
98 AddDefaultRoute(destination);
102 AddDefaultRoute(destination, outChannel);
107 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
108 size_t ChannelPutModifiable2(
const std::string &channel, byte *begin,
size_t length,
int messageEnd,
bool blocking);
110 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true);
111 bool ChannelMessageSeriesEnd(
const std::string &channel,
int propagation=-1,
bool blocking=
true);
113 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &size);
119 void AddRoute(
const std::string &inChannel,
BufferedTransformation &destination,
const std::string &outChannel);
120 void RemoveRoute(
const std::string &inChannel,
BufferedTransformation &destination,
const std::string &outChannel);
124 DefaultRouteList m_defaultRoutes;
Classes providing simple keying interfaces.
Abstract base classes that provide a uniform interface to this library.
Classes for automatic resource management.
Route input to different and/or multiple channels based on channel ID.
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
bool operator<(const ::PolynomialMod2 &a, const ::PolynomialMod2 &b)
compares degree
Implementation of BufferedTransformation's attachment interface.
Crypto++ library namespace.
Provides multiple channels support for custom flush signal processing.
Interface for retrieving values given their names.