The ContextCollector serves the task of gathering context information. To do so, it creates an empty Context object and asks the ContextProviderCollection to add information into that object. After that, it forwards the measured value and the Context to the (root of a) ProbeBus hierarchy. When being constructed, the ContextCollector relies on two mandatory parameters:
- A ContextProviderCollection, of which the ContextCollector will make a copy for its internal purposes. (The copying allows to instantiate a number of ContextCollectors with the same instance of the local ContextProviderCollection)
- The unique, identifying name of the ProbeBus into which to forward the measurements (under this name the ContextCollector will look up in the wns::probe::bus::ProbeBusRegistry This procedure is illustrates in the sequence diagram below
-
In this example the MeasurementSource creates the ContextCollector. The creation can be done by any object. The MeasurementSource only needs to know its ContextCollector object to place the put() call.
-
If only the measurement is used when putting the compound is set to an empty compound automatically. A description on gathering context from compounds will follow
-
The ContextProvider may add any number of key, value pairs to the Context