Adobe Source Libraries 2.0.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
Description
A Controller is a one-way channel for information to travel from outside a model/view/controller system into the system. It is intended to send notifications into the system of events outside the system. A controller is not allowed to display anything about the system to which it belongs – that is the responsibility of a View [1].
Refinement Of
Associated Type(s)
The only type associated with the controller is the data structure that view is intended to represent. This is the value_type of the controller, and is used when setting the view to a new value of that type. In order to set a value within a model, a notification callback must be bound to the controller from the model.
Value Type typename controller_model_type<Controller>::type The value type for the data for which the controller is sending notifications
Notation
TA type that is a model of View
tObject of type T
Definitions
Valid Expressions
NameExpressionType requirementsReturn type
Monitormonitor(t, p);See monitor function documentation for requirements onpvoid
Expression Semantics
NameExpressionPreconditionSemanticsPostcondition
Complexity Guarantee(s)
Invariants
Type(s) Modeling this Concept
  • Any device that sends information from outside a system into the system itself. An example might be an audio microphone or a checkbox when it is selected (however, its visual updating is a View property, not part of its functionality as a controller).
Notes
  • [1]
It is legal for any one implementation to model both a Controller and a View at the same time.
See Also
Example
void my_notification_proc(const typename controller_model_type<Controller>::type& x)
{
std::cout << "the value of the controller changed to " << x << std::endl;
}
Controller t;
using adobe::monitor;
monitor(t, &my_notification_proc);