Logo Search packages:      
Sourcecode: djvulibre version File versions

DjVuPortcaster Class Reference

#include <DjVuPort.h>

List of all members.


Detailed Description

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.

Definition at line 356 of file DjVuPort.h.


Public Member Functions

void add_alias (const DjVuPort *port, const GUTF8String &alias)
void add_route (const DjVuPort *src, DjVuPort *dst)
GP< DjVuPortalias_to_port (const GUTF8String &name)
void clear_aliases (const DjVuPort *port)
void copy_routes (DjVuPort *dst, const DjVuPort *src)
void del_port (const DjVuPort *port)
void del_route (const DjVuPort *src, DjVuPort *dst)
 DjVuPortcaster (void)
virtual GP< DjVuFileid_to_file (const DjVuPort *source, const GUTF8String &id)
virtual GURL id_to_url (const DjVuPort *source, const GUTF8String &id)
GP< DjVuPortis_port_alive (DjVuPort *port)
virtual void notify_chunk_done (const DjVuPort *source, const GUTF8String &name)
virtual void notify_decode_progress (const DjVuPort *source, float done)
virtual void notify_doc_flags_changed (const class DjVuDocument *source, long set_mask, long clr_mask)
virtual bool notify_error (const DjVuPort *source, const GUTF8String &msg)
virtual void notify_file_flags_changed (const class DjVuFile *source, long set_mask, long clr_mask)
virtual void notify_redisplay (const class DjVuImage *source)
virtual void notify_relayout (const class DjVuImage *source)
virtual bool notify_status (const DjVuPort *source, const GUTF8String &msg)
GPList< DjVuPortprefix_to_ports (const GUTF8String &prefix)
virtual GP< DataPoolrequest_data (const DjVuPort *source, const GURL &url)

Static Public Member Functions

static void clear_all_aliases (void)
static DjVuPortcasterget_portcaster (void)

Private Member Functions

void add_to_closure (GMap< const void *, void * > &set, const DjVuPort *dst, int distance)
void compute_closure (const DjVuPort *src, GPList< DjVuPort > &list, bool sorted=false)

Private Attributes

GMap< GUTF8String, const void * > a2p_map
GMap< const void *, void * > cont_map
GCriticalSection map_lock
GMap< const void *, void * > route_map

Friends

class DjVuPort

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index