1 #ifndef CRYPTOPP_CHANNELS_H
2 #define CRYPTOPP_CHANNELS_H
9 NAMESPACE_BEGIN(CryptoPP)
13 class MessageSwitch :
public Sink
17 void AddRoute(
unsigned int begin,
unsigned int end,
BufferedTransformation &destination,
const std::string &channel);
19 void Put(byte inByte);
20 void Put(
const byte *inString,
unsigned int length);
22 void Flush(
bool completeFlush,
int propagation=-1);
23 void MessageEnd(
int propagation=-1);
24 void PutMessageEnd(
const byte *inString,
unsigned int length,
int propagation=-1);
28 typedef std::pair<BufferedTransformation *, std::string> Route;
31 RangeRoute(
unsigned int begin,
unsigned int end,
const Route &route)
32 : begin(begin), end(end), route(route) {}
33 bool operator<(
const RangeRoute &rhs)
const {
return begin < rhs.begin;}
34 unsigned int begin, end;
38 typedef std::list<RangeRoute> RouteList;
39 typedef std::list<Route> DefaultRouteList;
42 DefaultRouteList m_defaultRoutes;
43 unsigned int m_nCurrentMessage;
50 typedef std::pair<BufferedTransformation *, std::string> Route;
51 typedef std::multimap<std::string, Route> RouteMap;
53 typedef std::pair<BufferedTransformation *, value_ptr<std::string> > DefaultRoute;
54 typedef std::list<DefaultRoute> DefaultRouteList;
57 typedef RouteMap::iterator MapIterator;
58 typedef DefaultRouteList::iterator ListIterator;
67 std::string m_channel;
69 MapIterator m_itMapCurrent, m_itMapEnd;
70 ListIterator m_itListCurrent, m_itListEnd;
73 void Reset(
const std::string &channel);
77 const std::string & Channel();
87 AddDefaultRoute(destination);
91 AddDefaultRoute(destination, outChannel);
96 size_t ChannelPut2(
const std::string &channel,
const byte *begin,
size_t length,
int messageEnd,
bool blocking);
97 size_t ChannelPutModifiable2(
const std::string &channel, byte *begin,
size_t length,
int messageEnd,
bool blocking);
99 bool ChannelFlush(
const std::string &channel,
bool completeFlush,
int propagation=-1,
bool blocking=
true);
100 bool ChannelMessageSeriesEnd(
const std::string &channel,
int propagation=-1,
bool blocking=
true);
102 byte * ChannelCreatePutSpace(
const std::string &channel,
size_t &size);
108 void AddRoute(
const std::string &inChannel,
BufferedTransformation &destination,
const std::string &outChannel);
109 void RemoveRoute(
const std::string &inChannel,
BufferedTransformation &destination,
const std::string &outChannel);
113 DefaultRouteList m_defaultRoutes;
Route input to different and/or multiple channels based on channel ID.
const NameValuePairs & g_nullNameValuePairs
empty set of name-value pairs
bool operator<(const ::PolynomialMod2 &a, const ::PolynomialMod2 &b)
compares degree
A BufferedTransformation that doesn't produce any retrievable output.
interface for retrieving values given their names