Fawkes API Fawkes Development Version
|
One-to-Many dependency constraint. More...
#include <>>
Public Member Functions | |
OneToManyDependency () | |
Constructor. More... | |
virtual | ~OneToManyDependency () |
Destructor. More... | |
virtual void | add (Provider *p) |
Add provider object. More... | |
virtual void | add (Dependant *d) |
Add dependant object. More... | |
virtual void | remove (Provider *p) |
Remove provider object. More... | |
virtual void | remove (Dependant *d) |
Remove a depending object. More... | |
virtual bool | can_add (Provider *p) |
Check if provider can be added. More... | |
virtual bool | can_add (Dependant *d) |
Check if dependant can be added. More... | |
virtual bool | can_remove (Provider *p) |
Check if provider can be removed. More... | |
virtual bool | can_remove (Dependant *d) |
Check if dependant can be removed. More... | |
virtual Provider * | provider () |
Get provider. More... | |
virtual std::list< Dependant * > & | dependants () |
Get dependants. More... | |
One-to-Many dependency constraint.
This dependency constraint models a 1-to-n relationship. There is one object called provider, that any number of other objects (dependants) rely on.
The provider is unique and only one provider may exist at any one time. There may be an arbitrary number of dependants. Dependants may only be added if there is already a provider.
Dependants can always be removed. The provider can only be removed if there are no more dependants.
Definition at line 50 of file dependency_onetomany.h.
fawkes::OneToManyDependency< Provider, Dependant >::OneToManyDependency |
Constructor.
Definition at line 76 of file dependency_onetomany.h.
|
virtual |
Destructor.
Definition at line 84 of file dependency_onetomany.h.
|
virtual |
Add dependant object.
This will add the dependant to this dependency or throw an exception if there is no provider.
d | dependant object to add |
DependencyViolationException | thrown, if no provider has been set |
Definition at line 114 of file dependency_onetomany.h.
|
virtual |
Add provider object.
This will add the provider to this dependency or throw an exception if there is already a provider.
p | provider object to add |
DependencyViolationException | thrown, if a second provider is added |
Definition at line 97 of file dependency_onetomany.h.
|
virtual |
Check if dependant can be added.
d | dependant object to add |
Definition at line 169 of file dependency_onetomany.h.
|
virtual |
Check if provider can be added.
p | provider object to add |
Definition at line 158 of file dependency_onetomany.h.
|
virtual |
Check if dependant can be removed.
d | depending object to remove |
Definition at line 191 of file dependency_onetomany.h.
|
virtual |
Check if provider can be removed.
p | provider object to remove |
Definition at line 180 of file dependency_onetomany.h.
|
virtual |
|
virtual |
Get provider.
Definition at line 201 of file dependency_onetomany.h.
|
virtual |
Remove a depending object.
d | depending object to remove |
Definition at line 145 of file dependency_onetomany.h.
|
virtual |
Remove provider object.
p | provider object to remove |
DependencyViolationException | thrown, if the provider should be removed while there is still at least one dependant. |
Definition at line 130 of file dependency_onetomany.h.