The parameterized base class for module options. More...
#include <ogdf/basic/ModuleOption.h>
Public Member Functions | |
| ModuleOption () | |
| Initializes a module option; the initial module is just a 0-pointer. | |
| ~ModuleOption () | |
| void | set (M *pM) |
| Sets the module to pM. | |
| bool | valid () const |
| Returns true iff the option currently stores a module. | |
| M & | get () |
| Returns a reference to the stored module. | |
Private Attributes | |
| M * | m_pModule |
| Pointer to the module. | |
The parameterized base class for module options.
M is type (base class) of corresponding module. Notice that module instances passed to set() must be allocated with new and will be freed by ModuleOption.
Definition at line 74 of file ModuleOption.h.
| ogdf::ModuleOption< M >::ModuleOption | ( | ) | [inline] |
Initializes a module option; the initial module is just a 0-pointer.
Definition at line 80 of file ModuleOption.h.
| ogdf::ModuleOption< M >::~ModuleOption | ( | ) | [inline] |
Definition at line 83 of file ModuleOption.h.
| M& ogdf::ModuleOption< M >::get | ( | ) | [inline] |
Returns a reference to the stored module.
It is required that the option currently stores a module, i.e., valid() is true.
Definition at line 102 of file ModuleOption.h.
| void ogdf::ModuleOption< M >::set | ( | M * | pM | ) | [inline] |
Sets the module to pM.
This function will also free the module currently stored by the option.
Definition at line 89 of file ModuleOption.h.
| bool ogdf::ModuleOption< M >::valid | ( | ) | const [inline] |
Returns true iff the option currently stores a module.
Definition at line 95 of file ModuleOption.h.
M* ogdf::ModuleOption< M >::m_pModule [private] |
Pointer to the module.
Definition at line 76 of file ModuleOption.h.