Click
Loading...
Searching...
No Matches
Classes | List of all members
Router Class Reference

A router configuration. More...

Classes

class  InitFuture
 

Public Member Functions

enum  { STOP_RUNCOUNT = -2147483647 - 1 }
 
enum  { FIRST_GLOBAL_HANDLER = 0x40000000 }
 
Master * master () const
 Return the Master object for this router.
 
bool initialized () const
 Return true iff the router has been successfully initialized.
 
bool handlers_ready () const
 Return true iff the router's handlers have been initialized.
 
bool running () const
 Return true iff the router is currently running.
 
bool dying () const
 Return true iff the router is in the process of being killed.
 
int32_t runcount () const
 Return the router's runcount.
 
void adjust_runcount (int32_t delta)
 Adjust the runcount by delta.
 
void set_runcount (int32_t rc)
 Set the runcount.
 
void please_stop_driver ()
 Request a driver stop by adjusting the runcount by -1.
 
const Vector< Element * > & elements () const
 Returns a vector containing all the router's elements.
 
int nelements () const
 Returns the number of elements in the router.
 
Element * element (int i) const
 Returns the element with index i.
 
Element * root_element () const
 Returns this router's root element.
 
const String & ename (int i) const
 Returns element index eindex's name.
 
String ename_context (int i) const
 Returns element index eindex's name context.
 
String elandmark (int i) const
 Returns element index eindex's landmark.
 
const String & econfiguration (int i) const
 Returns element index eindex's configuration string.
 
void set_econfiguration (int i, const String &conf)
 Sets element index eindex's configuration string.
 
Element * find (const String &name, ErrorHandler *errh=0) const
 Finds an element named name.
 
Element * find (const String &name, String context, ErrorHandler *errh=0) const
 Finds an element named name.
 
Element * find (const String &name, const Element *context, ErrorHandler *errh=0) const
 Finds an element named name.
 
bool element_can_reach (Element *a, Element *b)
 
int visit (Element *e, bool isoutput, int port, RouterVisitor *visitor, bool all_paths=false) const
 Traverse the router configuration from one of e's ports, maximum once per port.
 
int visit_ports (Element *e, bool isoutput, int port, RouterVisitor *visitor) const
 Traverse the router configuration from one of e's ports, passing per each ports.
 
int visit_paths (Element *e, bool isoutput, int port, RouterVisitor *visitor) const
 
int visit_downstream (Element *e, int port, RouterVisitor *visitor) const
 Traverse the router configuration downstream of e[port].
 
int visit_upstream (Element *e, int port, RouterVisitor *visitor) const
 Traverse the router configuration upstream of [port]e.
 
int downstream_elements (Element *e, int port, ElementFilter *filter, Vector< Element * > &result)
 Search for elements downstream from e.
 
int upstream_elements (Element *e, int port, ElementFilter *filter, Vector< Element * > &result)
 Search for elements upstream from e.
 
const char * flow_code_override (int eindex) const
 Returns the overriding flow code for element e, if any.
 
void set_flow_code_override (int eindex, const String &flow_code)
 
void * attachment (const String &aname) const
 
void *& force_attachment (const String &aname)
 
void * set_attachment (const String &aname, void *value)
 
ErrorHandler * chatter_channel (const String &channel_name) const
 
HashMap_ArenaFactory * arena_factory () const
 
ThreadSched * thread_sched () const
 
void set_thread_sched (ThreadSched *scheduler)
 
int home_thread_id (const Element *e) const
 
void set_home_thread_id (const Element *e, int home_thread)
 
bool is_fullpush () const
 Tell if the whole router is in full push mode.
 
void non_fullpush ()
 
String configuration_string () const
 Returns the router's initial configuration string.
 
void unparse (StringAccum &sa, const String &indent=String()) const
 Unparse this router into sa.
 
void unparse_requirements (StringAccum &sa, const String &indent=String()) const
 Unparse the router's requirements into sa.
 
void unparse_declarations (StringAccum &sa, const String &indent=String()) const
 Unparse declarations of the router's elements into sa.
 
void unparse_connections (StringAccum &sa, const String &indent=String()) const
 Unparse the router's connections into sa.
 
String element_ports_string (const Element *e) const
 Return a string representing e's ports.
 
static Element * element (const Router *router, int i)
 Return router's element with index eindex.
 
static const Handler * handler (const Element *e, const String &hname)
 Return element e's handler named hname.
 
static void add_read_handler (const Element *e, const String &hname, ReadHandlerCallback callback, void *user_data, uint32_t flags=0)
 Add an e.hname read handler.
 
static void add_write_handler (const Element *e, const String &hname, WriteHandlerCallback callback, void *user_data, uint32_t flags=0)
 Add an e.hname write handler.
 
static void set_handler (const Element *e, const String &hname, uint32_t flags, HandlerCallback callback, void *read_user_data=0, void *write_user_data=0)
 Add a comprehensive e.hname handler.
 
static int set_handler_flags (const Element *e, const String &hname, uint32_t set_flags, uint32_t clear_flags=0)
 Change the e.hname handler's flags.
 
static int router_handler (int operation, String &data, Element *e, const Handler *handler, ErrorHandler *errh)
 
static int hindex (const Element *e, const String &hname)
 Return the handler index for element e's handler named hname.
 
static const Handler * handler (const Router *router, int hindex)
 Return router's handler with index hindex.
 
static void element_hindexes (const Element *e, Vector< int > &result)
 Return the handler indexes for element e's handlers.
 

Internal Functions

 Router (const String &configuration, Master *master)
 Create a router.
 
 ~Router ()
 Destroy the router.
 
void use ()
 Increment the router's reference count.
 
void unuse ()
 Decrement the router's reference count.
 
void add_requirement (const String &type, const String &value)
 
int add_element (Element *e, const String &name, const String &conf, const String &filename, unsigned lineno)
 
int add_connection (int from_idx, int from_port, int to_idx, int to_port, bool is_context, String context)
 
int add_module_ref (struct module *module)
 
Router * hotswap_router () const
 Returns the currently-installed router this router will eventually replace.
 
void set_hotswap_router (Router *router)
 
ChildrenFuture * get_root_init_future ()
 
int initialize (ErrorHandler *errh)
 
void activate (bool foreground, ErrorHandler *errh)
 
void activate (ErrorHandler *errh)
 
void set_foreground (bool foreground)
 
int new_notifier_signal (const char *name, NotifierSignal &signal)
 Create a new basic signal.
 
String notifier_signal_name (const atomic_uint32_t *signal) const
 
static void static_initialize ()
 
static void static_cleanup ()
 

Detailed Description

A router configuration.

Constructor & Destructor Documentation

◆ Router()

Router::Router ( const String &  configuration,
Master *  master 
)

Create a router.

Parameters
configurationrouter configuration
masterMaster object

Users generally do not call this function directly, instead creating a router object by calling Lexer functions (this function doesn't actually parse the configuration string). The router is registered with the Master object, but not initialized or activated.

◆ ~Router()

Router::~Router ( )

Destroy the router.

Invariant
The reference count must be zero.

Users generally do not destroy Router objects directly, instead calling Router::unuse().

Member Function Documentation

◆ master()

Master * Router::master ( ) const
inline

Return the Master object for this router.

never

◆ initialized()

bool Router::initialized ( ) const
inline

Return true iff the router has been successfully initialized.

◆ handlers_ready()

bool Router::handlers_ready ( ) const
inline

Return true iff the router's handlers have been initialized.

handlers_ready() returns false until each element's Element::add_handlers() method has been called. This happens after Element::configure(), but before Element::initialize().

◆ running()

bool Router::running ( ) const
inline

Return true iff the router is currently running.

A running router has been successfully initialized (so running() implies initialized()), and has not stopped yet.

◆ dying()

bool Router::dying ( ) const
inline

Return true iff the router is in the process of being killed.

◆ runcount()

int32_t Router::runcount ( ) const
inline

Return the router's runcount.

The runcount is an integer that determines whether the router is running. A running router has positive runcount. Decrementing the router's runcount to zero or below will cause the router to stop, although elements like DriverManager can intercept the stop request and continue processing.

Elements request that the router stop its processing by calling adjust_runcount() or please_stop_driver().

◆ adjust_runcount()

void Router::adjust_runcount ( int32_t  delta)

Adjust the runcount by delta.

Parameters
deltaruncount adjustment

Essentially performs the assignment "runcount += delta" with compensation for integer overflow. (For instance, if runcount is INT_MAX and delta is INT_MAX, the resulting runcount will be INT_MAX, not -2.) Uses atomic operations to ensure that runcount adjustments are not lost.

If the adjusted runcount is zero or negative, the router is asked to stop its normal processing. This will happen soon, although not necessarily immediately. Once it stops, the router will search for an element to manage the stop event (see the Script and DriverManager elements). If no such element exists, or the script completes without raising the runcount, the router stops permanently.

◆ set_runcount()

void Router::set_runcount ( int32_t  rc)

Set the runcount.

Parameters
rcnew runcount

Sets the runcount to a specific value. If the new runcount is zero or negative, stops the router; see adjust_runcount().

◆ please_stop_driver()

void Router::please_stop_driver ( )
inline

Request a driver stop by adjusting the runcount by -1.

Note
Equivalent to adjust_runcount(-1).

◆ elements()

const Vector< Element * > & Router::elements ( ) const
inline

Returns a vector containing all the router's elements.

Invariant
elements()[i] == element(i) for all i in range.

◆ nelements()

int Router::nelements ( ) const
inline

Returns the number of elements in the router.

◆ element() [1/2]

Element * Router::element ( int  i) const
inline

Returns the element with index i.

Parameters
ielement index, or -1 for root_element()
Invariant
If element(i) isn't null, then element(i)->eindex() == i.

This function returns the element with index i. If i == -1, returns root_element(). If i is otherwise out of range, returns null.

◆ root_element()

Element * Router::root_element ( ) const
inline

Returns this router's root element.

Every router has a root Element. This element has Element::eindex() -1 and name "". It is not configured or initialized, and doesn't appear in the configuration; it exists only for convenience, when other Click code needs to refer to some arbitrary element at the top level of the compound element hierarchy.

◆ element() [2/2]

Element * Router::element ( const Router *  router,
int  eindex 
)
static

Return router's element with index eindex.

Parameters
routerthe router (may be null)
eindexelement index, or -1 for router->root_element()

This function returns router's element with index eindex. If router is null or eindex is out of range, returns null.

◆ ename()

const String & Router::ename ( int  eindex) const

Returns element index eindex's name.

Parameters
eindexelement index

Returns the empty string if eindex is out of range.

◆ ename_context()

String Router::ename_context ( int  eindex) const

Returns element index eindex's name context.

Parameters
eindexelement index

The result is the context prefix for the element's name. This is the string up to, and including, the last slash in the element's name. Returns the empty string if eindex is out of range.

◆ elandmark()

String Router::elandmark ( int  eindex) const

Returns element index eindex's landmark.

Parameters
eindexelement index

A landmark is a short string specifying where the element was defined. A typical landmark has the form "file:linenumber", as in "file.click:30". Returns the empty string if eindex is out of range.

◆ econfiguration()

const String & Router::econfiguration ( int  eindex) const

Returns element index eindex's configuration string.

Parameters
eindexelement index

Returns the empty string if eindex is out of range.

Note
econfiguration() returns the element's most recently specified static configuration string, which might differ from the element's active configuration string. For the active configuration, call Element::configuration(), which might include post-initialization changes.

◆ set_econfiguration()

void Router::set_econfiguration ( int  eindex,
const String &  conf 
)

Sets element index eindex's configuration string.

Parameters
eindexelement index
confconfiguration string

Does nothing if eindex is out of range.

◆ find() [1/3]

Element * Router::find ( const String &  name,
ErrorHandler *  errh = 0 
) const
inline

Finds an element named name.

Parameters
nameelement name
errhoptional error handler

Returns the unique element named name, if any. If no element named name is found, reports an error to errh and returns null. The error is "<tt>no element named 'name'</tt>". If errh is null, no error is reported.

This function is equivalent to find(const String&, String, ErrorHandler*) with a context argument of the empty string.

◆ find() [2/3]

Element * Router::find ( const String &  name,
String  context,
ErrorHandler *  errh = 0 
) const

Finds an element named name.

Parameters
nameelement name
contextcompound element context
errhoptional error handler

Searches for an element named name in the compound element context specified by context, returning the first element found. For example, if context was "aaa/bbb/ccc/", then find() would search for elements named aaa/bbb/ccc/name, aaa/bbb/name, aaa/name, and finally name, returning the first element found. If nonempty, context should end with a slash.

If no element named name is found, reports an error to errh and returns null. The error is "<tt>no element named 'name'</tt>". If errh is null, no error is reported.

◆ find() [3/3]

Element * Router::find ( const String &  name,
const Element *  context,
ErrorHandler *  errh = 0 
) const

Finds an element named name.

Parameters
nameelement name
contextcompound element context
errhoptional error handler

Searches for an element named name in the compound element context specified by context, returning the first element found. For example, if ename(context) was "aaa/bbb/element", then find(name, context, errh) is equivalent to find(name, "aaa/bbb/", errh), and will search for elements named aaa/bbb/name, aaa/name, and finally name.

If no element named name is found, reports an error to errh and returns null. The error is "<tt>no element named 'name'</tt>". If errh is null, no error is reported.

◆ visit()

int Router::visit ( Element *  first_element,
bool  forward,
int  first_port,
RouterVisitor *  visitor,
bool  all_paths = false 
) const

Traverse the router configuration from one of e's ports, maximum once per port.

Parameters
eelement to start search
forwardtrue to search down from outputs, false to search up from inputs
portport (or -1 to search all ports)
visitorRouterVisitor traversal object
Returns
0 on success, -1 in early router configuration stages

Calls visitor ->visit() on each reachable port starting from a port on e. Follows connections and traverses inside elements from port to port by Element::flow_code(). The visitor can stop a traversal path by returning false from visit().

visitor ->visit() is called on input ports if forward is true and output ports if forward is false. Equivalent to either visit_downstream() or visit_upstream(), depending on forward visit_downstream(), visit_upstream()

◆ visit_ports()

int Router::visit_ports ( Element *  first_element,
bool  forward,
int  first_port,
RouterVisitor *  visitor 
) const

Traverse the router configuration from one of e's ports, passing per each ports.

Parameters
eelement to start search
forwardtrue to search down from outputs, false to search up from inputs
portport (or -1 to search all ports)
visitorRouterVisitor traversal object
Returns
0 on success, -1 in early router configuration stages

Calls visitor ->visit() on each reachable port starting from a port on e. Follows connections and traverses inside elements from port to port by Element::flow_code(). The visitor can stop a traversal path by returning false from visit().

visitor ->visit() is called on input ports if forward is true and output ports if forward is false. Equivalent to either visit_downstream() or visit_upstream(), depending on forward visit_downstream(), visit_upstream()

◆ visit_downstream()

int Router::visit_downstream ( Element *  e,
int  port,
RouterVisitor *  visitor 
) const
inline

Traverse the router configuration downstream of e[port].

Parameters
eelement to start search
portoutput port (or -1 to search all output ports)
visitorRouterVisitor traversal object
Returns
0 on success, -1 in early router configuration stages

Calls visitor ->visit() on each reachable input port starting from the output port e[port]. Follows connections and traverses inside elements from port to port by Element::flow_code(). The visitor can stop a traversal path by returning false from visit().

See also
visit_upstream(), visit()

◆ visit_upstream()

int Router::visit_upstream ( Element *  e,
int  port,
RouterVisitor *  visitor 
) const
inline

Traverse the router configuration upstream of [port]e.

Parameters
eelement to start search
portinput port (or -1 to search all input ports)
visitorRouterVisitor traversal object
Returns
0 on success, -1 in early router configuration stages

Calls visitor ->visit() on each reachable output port starting from the input port [port]e. Follows connections and traverses inside elements from port to port by Element::flow_code(). The visitor can stop a traversal path by returning false from visit().

See also
visit_downstream(), visit()

◆ downstream_elements()

int Router::downstream_elements ( Element *  e,
int  port,
ElementFilter *  filter,
Vector< Element * > &  result 
)

Search for elements downstream from e.

Parameters
eelement to start search
portoutput port (or -1 to search all output ports)
filterElementFilter naming elements that stop the search
resultstores results
Returns
0 on success, -1 in early router configuration stages
Deprecated:
This function is deprecated. Use visit_downstream() instead.

This function searches the router configuration graph, starting from e's output port port and proceeding downstream along element connections, and inside elements from port to port by Element::flow_code(). All found elements are stored in result.

If filter != NULL, then each found port is passed to filter's ElementFilter::check_match() function to check whether to stop the search. For example, if filter is CastElementFilter("Storage"), then the search will stop after any Storage element. The result will then include the Storage elements and any elements in between e and the Storage elements.

See also
upstream_elements()

◆ upstream_elements()

int Router::upstream_elements ( Element *  e,
int  port,
ElementFilter *  filter,
Vector< Element * > &  result 
)

Search for elements upstream from e.

Parameters
eelement to start search
portinput port (or -1 to search all ports)
filterElementFilter naming elements that stop the search
resultstores results
Returns
0 on success, -1 in early router configuration stages
Deprecated:
This function is deprecated. Use visit_upstream() instead.

This function searches the router configuration graph, starting from e's input port port and proceeding upstream along element connections, and inside elements from port to port by Element::flow_code(). All found elements are stored in result.

If filter != NULL, then each found port is passed to filter's ElementFilter::check_match() function to check whether to stop the search. For example, if filter is CastElementFilter("Storage"), then the search will stop after any Storage element. The result will then include the Storage elements and any elements in between e and the Storage elements.

See also
downstream_elements()

◆ flow_code_override()

const char * Router::flow_code_override ( int  eindex) const
inline

Returns the overriding flow code for element e, if any.

Parameters
eindexelement index
Returns
The flow code, or null if none has been set.

◆ handler() [1/2]

const Handler * Router::handler ( const Element *  e,
const String &  hname 
)
static

Return element e's handler named hname.

Parameters
eelement, if any
hnamehandler name
Returns
the Handler, or null if no such handler exists

Searches for element e's handler named hname. Returns NULL if no such handler exists. If e is NULL or equal to some root_element(), then this function searches for a global handler named hname.

The return Handler pointer remains valid until the named handler is changed in some way (add_read_handler(), add_write_handler(), set_handler(), or set_handler_flags()).

◆ add_read_handler()

void Router::add_read_handler ( const Element *  e,
const String &  hname,
ReadHandlerCallback  callback,
void *  user_data,
uint32_t  flags = 0 
)
static

Add an e.hname read handler.

Parameters
eelement, if any
hnamehandler name
callbackread callback
user_datauser data for read callback
flagsadditional flags to set (Handler::flags())

Adds a read handler named hname for element e. If e is NULL or equal to some root_element(), then adds a global read handler. The handler's callback function is callback. When the read handler is triggered, Click will call callback(e, user_data).

Any previous read handler with the same name and element is replaced. Any comprehensive handler function (see set_handler()) is replaced. Any write-only handler (add_write_handler()) remains.

The new handler's flags equal the old flags or'ed with flags. Any special flags in flags are ignored.

To create a read handler with parameters, you must use set_handler().

See also
add_write_handler(), set_handler(), set_handler_flags()

◆ add_write_handler()

void Router::add_write_handler ( const Element *  e,
const String &  hname,
WriteHandlerCallback  callback,
void *  user_data,
uint32_t  flags = 0 
)
static

Add an e.hname write handler.

Parameters
eelement, if any
hnamehandler name
callbackread callback
user_datauser data for write callback
flagsadditional flags to set (Handler::flags())

Adds a write handler named hname for element e. If e is NULL or equal to some root_element(), then adds a global write handler. The handler's callback function is callback. When the write handler is triggered, Click will call callback(data, e, user_data, errh).

Any previous write handler with the same name and element is replaced. Any comprehensive handler function (see set_handler()) is replaced. Any read-only handler (add_read_handler()) remains.

The new handler's flags equal the old flags or'ed with flags. Any special flags in flags are ignored.

See also
add_read_handler(), set_handler(), set_handler_flags()

◆ set_handler()

void Router::set_handler ( const Element *  e,
const String &  hname,
uint32_t  flags,
HandlerCallback  callback,
void *  read_user_data = 0,
void *  write_user_data = 0 
)
static

Add a comprehensive e.hname handler.

Parameters
eelement, if any
hnamehandler name
flagsflags to set (Handler::flags())
callbackcomprehensive handler callback
read_user_dataread user data for callback
write_user_datawrite user data for callback

Sets a handler named hname for element e. If e is NULL or equal to some root_element(), then sets a global handler. The handler's callback function is callback. The resulting handler is a read handler if flags contains Handler::f_read, and a write handler if flags contains Handler::f_write. If the flags contain Handler::f_read_param, then any read handler will accept parameters.

When the handler is triggered, Click will call callback(operation, data, e, h, errh), where:

Any previous handlers with the same name and element are replaced.

See also
add_read_handler(), add_write_handler(), set_handler_flags()

◆ set_handler_flags()

int Router::set_handler_flags ( const Element *  e,
const String &  hname,
uint32_t  set_flags,
uint32_t  clear_flags = 0 
)
static

Change the e.hname handler's flags.

Parameters
eelement, if any
hnamehandler name
set_flagsflags to set (Handler::flags())
clear_flagsflags to clear (Handler::flags())
Returns
0 if the handler existed, -1 otherwise

Changes the handler flags for the handler named hname on element e. If e is NULL or equal to some root_element(), then changes a global handler. The handler's flags are changed by clearing the clear_flags and then setting the set_flags, except that the special flags (Handler::f_special) are unchanged.

See also
add_read_handler(), add_write_handler(), set_handler()

◆ hindex()

int Router::hindex ( const Element *  e,
const String &  hname 
)
static

Return the handler index for element e's handler named hname.

Parameters
eelement, if any
hnamehandler name
Returns
the handler index, or -1 if no such handler exists

Searches for element e's handler named hname. Returns -1 if no such handler exists. If e is NULL or equal to some root_element(), then this function searches for a global handler named hname.

The returned integer is a handler index, which is a number that identifies the handler. An integer >= FIRST_GLOBAL_HANDLER corresponds to a global handler.

◆ handler() [2/2]

const Handler * Router::handler ( const Router *  router,
int  hindex 
)
static

Return router's handler with index hindex.

Parameters
routerthe router
hindexhandler index (Router::hindex())
Returns
the Handler, or null if no such handler exists

Returns the Handler object on router with handler index hindex. If hindex >= FIRST_GLOBAL_HANDLER, then returns a global handler. If hindex is < 0 or corresponds to no existing handler, returns null.

The return Handler pointer remains valid until the named handler is changed in some way (add_read_handler(), add_write_handler(), set_handler(), or set_handler_flags()).

◆ element_hindexes()

void Router::element_hindexes ( const Element *  e,
Vector< int > &  result 
)
static

Return the handler indexes for element e's handlers.

Parameters
eelement, if any
resultcollector for handler indexes

Iterates over all element e's handlers, and appends their handler indexes to result. If e is NULL or equal to some root_element(), then iterates over the global handlers.

◆ is_fullpush()

bool Router::is_fullpush ( ) const
inline

Tell if the whole router is in full push mode.

Precondition
getThreads() has been called on all final elements

If true, all packets of this router are always handled by the same thread (but mutltiple threads can handle different packets). This means that sharing can be disabled.

◆ configuration_string()

String Router::configuration_string ( ) const

Returns the router's initial configuration string.

never

Returns
The configuration string specified to the constructor.

◆ unparse()

void Router::unparse ( StringAccum &  sa,
const String &  indent = String() 
) const

Unparse this router into sa.

Calls unparse_requirements(), unparse_declarations(), and unparse_connections(), in that order. Each line is prefixed by indent.

◆ unparse_requirements()

void Router::unparse_requirements ( StringAccum &  sa,
const String &  indent = String() 
) const

Unparse the router's requirements into sa.

never

Appends at most one require() statement to sa.

◆ unparse_declarations()

void Router::unparse_declarations ( StringAccum &  sa,
const String &  indent = String() 
) const

Unparse declarations of the router's elements into sa.

Appends this router's elements' declarations to sa. If the router is initialized, then each element's configuration string is found by Element::configuration(), which might include post-initialization changes.

◆ unparse_connections()

void Router::unparse_connections ( StringAccum &  sa,
const String &  indent = String() 
) const

Unparse the router's connections into sa.

Appends this router's connections to sa in parseable format.

◆ element_ports_string()

String Router::element_ports_string ( const Element *  e) const

Return a string representing e's ports.

Parameters
eelement

The returned string is suitable for an element's ports handler. It lists the input ports, then the output ports. For example:

1 input
push~   -       InfiniteSource@1 [0], InfiniteSource@4 [0]
1 output
push~   -       [0] Align@3

In the port lines, the first column describes the processing type (a tilde suffix represents an agnostic port); the second column lists any packet statistics available; and the third column lists other ports that are connected to this port.

◆ use()

void Router::use ( )
inline

Increment the router's reference count.

Routers are reference counted objects. A Router is created with one reference, which is held by its Master object. Normally the Router and all its elements will be deleted when the Master drops this reference, but you can preserve the Router for longer by adding a reference yourself.

◆ unuse()

void Router::unuse ( )

Decrement the router's reference count.

Destroys the router if the reference count decrements to zero.

◆ hotswap_router()

Router * Router::hotswap_router ( ) const
inline

Returns the currently-installed router this router will eventually replace.

This function is only meaningful during a router's initialization. If this router was installed with the hotswap option, then hotswap_router() will return the currently-installed router that this router will eventually replace (assuming error-free initialization). Otherwise, hotswap_router() will return 0.

◆ new_notifier_signal()

int Router::new_notifier_signal ( const char *  name,
NotifierSignal &  signal 
)

Create a new basic signal.

Parameters
namesignal name
[out]signalset to new signal

Creates a new basic NotifierSignal and stores it in signal. The signal is initially active.

Note
Users will not generally call this function directly; Notifier::initialize() will call it as required.
Returns
>= 0 on success, < 0 on failure
See also
NotifierSignal

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