5 #ifndef CRYPTOPP_IMPORTS 16 m_defaultRoutes.push_back(Route(&destination, channel));
19 void MessageSwitch::AddRoute(
unsigned int begin,
unsigned int end,
BufferedTransformation &destination,
const std::string &channel)
21 RangeRoute route(begin, end, Route(&destination, channel));
22 RouteList::iterator it = upper_bound(m_routes.begin(), m_routes.end(), route);
23 m_routes.insert(it, route);
100 pair<MapIterator, MapIterator> range =
m_cs.
m_routeMap.equal_range(channel);
101 if (range.first == range.second)
159 if (m_it.Destination().ChannelPut2(m_it.Channel(), begin, length, messageEnd, blocking))
175 m_defaultRoutes.clear();
192 if (m_it.Destination().ChannelFlush(m_it.Channel(), completeFlush, propagation, blocking))
218 if (m_it.Destination().ChannelMessageSeriesEnd(m_it.Channel(), propagation))
236 const std::string &
ch = m_it.Channel();
253 const std::string &targetChannel = it.
Channel();
259 return ChannelPut2(channel, inString, length, messageEnd, blocking);
269 for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it)
270 if (it->first == &destination && !it->second.get())
272 m_defaultRoutes.erase(it);
279 m_defaultRoutes.push_back(
DefaultRoute(&destination, outChannel));
284 for (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it)
285 if (it->first == &destination && (it->second.get() && *it->second == outChannel))
287 m_defaultRoutes.erase(it);
294 m_routeMap.insert(RouteMap::value_type(inChannel,
Route(&destination, outChannel)));
299 typedef ChannelSwitch::RouteMap::iterator
MapIterator;
300 pair<MapIterator, MapIterator> range = m_routeMap.equal_range(inChannel);
302 for (MapIterator it = range.first; it != range.second; ++it)
303 if (it->second.first == &destination && it->second.second == outChannel)
305 m_routeMap.erase(it);
MapIterator m_itMapCurrent
void RemoveRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel)
std::pair< BufferedTransformation *, std::string > Route
#define NAMESPACE_BEGIN(x)
const std::string & Channel()
Abstract base classes that provide a uniform interface to this library.
void AddDefaultRoute(BufferedTransformation &destination)
std::hash for asio::adress
ListIterator m_itListCurrent
Classes for multiple named channels.
void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs)
Initialize or reinitialize this object, without signal propagation.
DefaultRouteList m_defaultRoutes
BufferedTransformation & Destination()
size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing on a channel.
size_t ChannelPutModifiable2(const std::string &channel, byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes that may be modified by callee on a channel.
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
void RemoveDefaultRoute(BufferedTransformation &destination)
#define USING_NAMESPACE(x)
bool ChannelFlush(const std::string &channel, bool completeFlush, int propagation=-1, bool blocking=true)
Flush buffered input and/or output on a channel.
uint8_t const size_t const size
#define CRYPTOPP_UNUSED(x)
std::pair< BufferedTransformation *, value_ptr< std::string > > DefaultRoute
std::vector< char * > parameters
uint32_t ch(uint32_t x, uint32_t y, uint32_t z)
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size)
Request space which can be written into by the caller.
RouteMap::iterator MapIterator
void AddRoute(const std::string &inChannel, BufferedTransformation &destination, const std::string &outChannel)
void Reset(const std::string &channel)
Interface for retrieving values given their names.