#include <rgrl_object.h>
Inheritance diagram for rgrl_object:

Most rgrl classes should be a subclas of rgrl_object.
Definition at line 37 of file rgrl_object.h.
Public Member Functions | |
| rgrl_object () | |
| rgrl_object (const rgrl_object &that) | |
| copy constructor. | |
| const rgrl_object & | operator= (const rgrl_object &rhs) |
| assignment operator. | |
| virtual | ~rgrl_object () |
| virtual bool | is_type (const vcl_type_info &type) const |
| void | set_debug_flag (unsigned int debugFlag) const |
| Set the value of the debug flag. A non-zero value turns debugging on. | |
| unsigned int | debug_flag () const |
| Get the value of the debug flag. | |
| void | set_warning (bool) const |
| Set the flag for warning messages. | |
| bool | warning () const |
| Get the warning flag. | |
| unsigned int | add_observer (rgrl_event_sptr event, rgrl_command_sptr) |
| Allow people to add/remove/invoke observers (callbacks) to any rgrl object. | |
| rgrl_command_sptr | get_command (unsigned int tag) |
| Get the command associated with the given tag. | |
| void | invoke_event (const rgrl_event &) |
| Call execute(. | |
| void | invoke_event (const rgrl_event &) const |
| Call execute(. | |
| void | remove_observer (unsigned int tag) |
| Remove the observer with this tag value. | |
| bool | has_observer (const rgrl_event &event) const |
| Return true if an observer is registered for this event. | |
| void | ref () |
| void | unref () |
| int | get_references () const |
| bool | is_referenced () const |
Static Public Member Functions | |
| static const vcl_type_info & | type_id () |
Private Types | |
| typedef vcl_map< unsigned, rgrl_object_observer > | observer_map |
Private Attributes | |
| unsigned int | debug_flag_ |
| bool | warning_ |
| observer_map | observers_ |
| unsigned int | observer_count_ |
typedef vcl_map< unsigned, rgrl_object_observer > rgrl_object::observer_map [private] |
Definition at line 120 of file rgrl_object.h.
| rgrl_object::rgrl_object | ( | ) |
Definition at line 6 of file rgrl_object.cxx.
| rgrl_object::rgrl_object | ( | const rgrl_object & | that | ) | [inline] |
| rgrl_object::~rgrl_object | ( | ) | [virtual] |
Definition at line 13 of file rgrl_object.cxx.
| const rgrl_object& rgrl_object::operator= | ( | const rgrl_object & | rhs | ) | [inline] |
| static const vcl_type_info& rgrl_object::type_id | ( | ) | [inline, static] |
| virtual bool rgrl_object::is_type | ( | const vcl_type_info & | type | ) | const [inline, virtual] |
| void rgrl_object::set_debug_flag | ( | unsigned int | debugFlag | ) | const |
Set the value of the debug flag. A non-zero value turns debugging on.
Definition at line 19 of file rgrl_object.cxx.
| unsigned int rgrl_object::debug_flag | ( | ) | const |
| void rgrl_object::set_warning | ( | bool | ) | const |
| bool rgrl_object::warning | ( | ) | const |
| unsigned int rgrl_object::add_observer | ( | rgrl_event_sptr | event, | |
| rgrl_command_sptr | ||||
| ) |
Allow people to add/remove/invoke observers (callbacks) to any rgrl object.
This is an implementation of the subject/observer design pattern. An observer is added by specifying an event to respond to and an rgrl_ommand to execute. It returns an unsigned long tag which can be used later to remove the event or retrieve the command.
Definition at line 47 of file rgrl_object.cxx.
| rgrl_command_sptr rgrl_object::get_command | ( | unsigned int | tag | ) |
| void rgrl_object::invoke_event | ( | const rgrl_event & | ) |
Call execute(.
) on all the rgrl_commands observing this event id.
Definition at line 69 of file rgrl_object.cxx.
| void rgrl_object::invoke_event | ( | const rgrl_event & | ) | const |
Call execute(.
) on all the rgrl_commands observing this event id.
The actions triggered by this call doesn't modify this object.
Definition at line 83 of file rgrl_object.cxx.
| void rgrl_object::remove_observer | ( | unsigned int | tag | ) |
| bool rgrl_object::has_observer | ( | const rgrl_event & | event | ) | const |
Return true if an observer is registered for this event.
Definition at line 107 of file rgrl_object.cxx.
unsigned int rgrl_object::debug_flag_ [mutable, private] |
Definition at line 116 of file rgrl_object.h.
bool rgrl_object::warning_ [mutable, private] |
Definition at line 117 of file rgrl_object.h.
observer_map rgrl_object::observers_ [private] |
Definition at line 121 of file rgrl_object.h.
unsigned int rgrl_object::observer_count_ [private] |
Definition at line 122 of file rgrl_object.h.
1.5.1