ContentsIndex
Network.AdHoc.Routing
MaintainerStephan Friedrichs, Henning Guenther
Description
Synopsis
class RoutingStrategy rs where
routeSingle :: UserID -> rs -> Maybe SockAddr
routeMulti :: [UserID] -> rs -> (Map SockAddr [UserID], [UserID])
class Addressed a where
route :: RoutingStrategy r => r -> a -> (Map SockAddr a, Maybe a)
Documentation
class RoutingStrategy rs where
This class abstracts routing strategies for data-structures like SimpleRT. Minimal definition: one of routeSingle or routeMulti.
Methods
routeSingle :: UserID -> rs -> Maybe SockAddr
Tries to find a route for a given user. The SockAddr is the starting point of the route.
routeMulti :: [UserID] -> rs -> (Map SockAddr [UserID], [UserID])
Find routes for many users. The first object in the tuple maps nodes to a list of users that should be reached over it. The second one is a list of users that couldn't be reached.
show/hide Instances
class Addressed a where
Abstracts addressed contents that can be sent to (several) users.
Methods
route
:: RoutingStrategy r
=> rThe RoutingStrategy to locate users.
-> aThe data to be routed.
-> (Map SockAddr a, Maybe a)Starting-points and target-data of routes and, optionally, an addressed, failed-to-route datagram.
Routes an Addressed datagram.
show/hide Instances
Produced by Haddock version 0.8