#include <coherence/net/ViewBuilder.hpp>
Inherits Object.
Public Types | |
typedef spec::Handle | Handle |
ViewBuilder Handle definition. | |
typedef spec::View | View |
ViewBuilder View definition. | |
typedef spec::Holder | Holder |
ViewBuilder Holder definition. | |
typedef TypedHandle < NamedCache > | NamedCacheHandle |
NamedCache Handle definition. | |
Public Member Functions | |
ViewBuilder::Handle | filter (Filter::View vFilter) |
The Filter that will be used to define the entries maintained in this view. | |
ViewBuilder::Handle | listener (MapListener::Handle hListener) |
The MapListener that will receive all events, including those that result from the initial population of the view. | |
ViewBuilder::Handle | map (ValueExtractor::View VMapper) |
The ValueExtractor that this view will use to transform the results from the underlying cache prior to storing them locally. | |
ViewBuilder::Handle | keys () |
The resulting view will only cache keys. | |
ViewBuilder::Handle | values () |
The resulting view with cache both keys and values. | |
NamedCacheHandle | build () |
Construct a view of the NamedCache provided to this builder. | |
Protected Member Functions | |
ViewBuilder (NamedCacheHandle hCache) | |
Construct a new ViewBuilder for the provided NamedCache. | |
ViewBuilder (Supplier::Handle hSupplierCache) | |
Construct a new ViewBuilder for the provided NamedCache. | |
Protected Attributes | |
FinalHolder< Supplier > | f_hSupplierCache |
The Supplier returning a NamedCache from which the view will be created. | |
MemberView< Filter > | m_vFilter |
The Filter that will be used to define the entries maintained in this view. | |
MemberHandle < MapListener > | m_hListener |
The MapListener that will receive all the events from the view, including those corresponding to its initial population. | |
MemberView < ValueExtractor > | m_vMapper |
The ValueExtractor that will be used to transform values retrieved from the underlying cache before storing them locally; if specified, this view will become read-only. | |
bool | m_fCacheValues |
Flag controlling if the view will cache both keys and values or only keys. |
ViewBuilder | ( | NamedCacheHandle | hCache | ) | [protected] |
Construct a new ViewBuilder for the provided NamedCache.
hCache | the NamedCache from which the view will be created |
ViewBuilder | ( | Supplier::Handle | hSupplierCache | ) | [protected] |
Construct a new ViewBuilder for the provided NamedCache.
The Supplier should return a new NamedCache instance upon each invocation.
hSupplierCache | the Supplier returning a NamedCache from which the view will be created |
ViewBuilder::Handle filter | ( | Filter::View | vFilter | ) |
The Filter that will be used to define the entries maintained in this view.
If no Filter is specified, AlwaysFilter::INSTANCE will be used.
vFilter | the Filter that will be used to query the underlying NamedCache |
ViewBuilder::Handle listener | ( | MapListener::Handle | hListener | ) |
The MapListener that will receive all events, including those that result from the initial population of the view.
hListener | the MapListener that will receive all the events from the view, including those corresponding to its initial population. |
ViewBuilder::Handle map | ( | ValueExtractor::View | VMapper | ) |
The ValueExtractor that this view will use to transform the results from the underlying cache prior to storing them locally.
vMapper | the ValueExtractor that will be used to transform values retrieved from the underlying cache before storing them locally; if specified, this view will become read-only |
ViewBuilder::Handle keys | ( | ) |
The resulting view will only cache keys.
NOTE: this is mutually exclusive with values().
ViewBuilder::Handle values | ( | ) |
The resulting view with cache both keys and values.
NOTE: this is mutually exclusive with keys().
NamedCacheHandle build | ( | ) |
Construct a view of the NamedCache provided to this builder.