Maintains associations between ports.
Maintains associations between ports. It monitors the status of all ports (have they been destructed yet?), accepts requests and notifications from them and forwards them to destinations according to internally maintained map of routes.The caller can modify the route map any way he likes (see add_route(), del_route(), copy_routes(), etc. functions). Any port can be either a sender of a message, an intermediary receiver or a final destination.
When a request is sent, the DjVuPortcaster computes the list of destinations by consulting with the route map. Notifications are only sent to ``alive'' ports. A port is alive if it is referenced by a valid GP smartpointer. As a consequence, a port usually becomes alive after running the constructor (since the returned pointer is then assigned to a smartpointer) and is no longer alive when the port is destroyed (because it would not be destroyed if a smartpointer was referencing it).
Destination ports are sorted according to their distance from the source. For example, if port A is connected to ports B and C directly, and port B is connected to D, then B and C are assumed to be one hop away from A, while D is two hops away from A.
In some cases the requests and notifications are sent to every possible destination, and the order is not significant (like it is for notify_file_flags_changed() request). Others should be sent to the closest destinations first, and only then to the farthest, in case if they have not been processed by the closest. The examples are request_data(), notify_error() and notify_status().
The user is not expected to create the DjVuPortcaster itself. He should use get_portcaster() global function instead.
DjVuPortcaster(void)
void del_port(const DjVuPort * port)
void add_route(const DjVuPort *src, DjVuPort *dst)
dst - The destination void del_route(const DjVuPort *src, DjVuPort *dst)
void copy_routes(DjVuPort *dst, const DjVuPort *src)
GP<DjVuPort> is_port_alive(DjVuPort *port)
void add_alias(const DjVuPort * port, const char * alias)
static void clear_all_aliases(void)
void clear_aliases(const DjVuPort * port)
GP<DjVuPort> alias_to_port(const char * name)
GPList<DjVuPort> prefix_to_ports(const char * prefix)
virtual GURL id_to_url(const DjVuPort * source, const char * id)
virtual GPBase id_to_file(const DjVuPort * source, const char * id)
virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url)
virtual bool notify_error(const DjVuPort * source, const char * msg)
virtual bool notify_status(const DjVuPort * source, const char * msg)
virtual void notify_redisplay(const class DjVuImage * source)
virtual void notify_relayout(const class DjVuImage * source)
virtual void notify_chunk_done(const DjVuPort * source, const char * name)
virtual void notify_file_flags_changed(const class DjVuFile * source, long set_mask, long clr_mask)
virtual void notify_doc_flags_changed(const class DjVuDocument * source, long set_mask, long clr_mask)
virtual void notify_decode_progress(const DjVuPort * source, float done)
Alphabetic index HTML hierarchy of classes or Java