#include <coherence/util/extractor/CompositeUpdater.hpp>
Inherits Object, ValueUpdater, and PortableObject.
Public Types | ||||||||||||||||
| typedef spec::Handle | Handle | |||||||||||||||
| CompositeUpdater Handle definition. | ||||||||||||||||
| typedef spec::View | View | |||||||||||||||
| CompositeUpdater View definition. | ||||||||||||||||
| typedef spec::Holder | Holder | |||||||||||||||
| CompositeUpdater Holder definition. | ||||||||||||||||
Public Member Functions | ||||||||||||||||
| virtual void | update (Object::Handle hTarget, Object::Holder ohValue) const | |||||||||||||||
| Update the state of the passed target object using the passed value.
| ||||||||||||||||
| virtual void | readExternal (PofReader::Handle hIn) | |||||||||||||||
| virtual void | writeExternal (PofWriter::Handle hOut) const | |||||||||||||||
|
virtual TypedHandle < const String > | toString () const | |||||||||||||||
| Output a human-readable description of this Object to the given stream. Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents and is generally how toString() will be implemented.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::View vs = COH_TO_STRING(vKey << " = " << vValue); The COH_TO_STRING macro is also the most common way to implement the toString method. For example:
virtual TypedHandle<const String> Person::toString() const { return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN); }
| ||||||||||||||||
| virtual ValueExtractor::View | getExtractor () const | |||||||||||||||
| Retrieve the ValueExtractor part. | ||||||||||||||||
| virtual ValueUpdater::View | getUpdater () const | |||||||||||||||
| Retrieve the ValueUpdator part. | ||||||||||||||||
Protected Member Functions | ||||||||||||||||
| CompositeUpdater () | ||||||||||||||||
| Construct an empty CompositeUpdater (necessary for the PortableObject interface). | ||||||||||||||||
| CompositeUpdater (String::View vsName) | ||||||||||||||||
| Construct a CompositeUpdater for a specified method name sequence. | ||||||||||||||||
| CompositeUpdater (ValueExtractor::View vExtractor, ValueUpdater::View vUpdater) | ||||||||||||||||
| Construct a CompositeUpdater based on the specified extractor and updater. | ||||||||||||||||
Protected Attributes | ||||||||||||||||
|
FinalView < ValueExtractor > | f_vExtractor | |||||||||||||||
| The ValueExtractor part. | ||||||||||||||||
| FinalView< ValueUpdater > | f_vUpdater | |||||||||||||||
| The ValueUpdaterr part. | ||||||||||||||||
| CompositeUpdater | ( | String::View | vsName | ) | [protected] |
Construct a CompositeUpdater for a specified method name sequence.
For example: "getAddress. setZip" method name will indicate that the "getAddress()" method should be used to extract an Address object, which will then be used by the "setZip(String)" call.
| vsName | a dot-delimited sequence of N method names which results in a CompositeUpdater that is based on an chain of (N-1) ReflectionExtractor objects and a single ReflectionUpdater. |
| CompositeUpdater | ( | ValueExtractor::View | vExtractor, | |
| ValueUpdater::View | vUpdater | |||
| ) | [protected] |
Construct a CompositeUpdater based on the specified extractor and updater.
Note: the extractor and updater here are not symmetrical in nature: the extractor is used to "drill-down" to the target object, while the updater will operate on that extracted object.
| vExtractor | the ValueExtractor | |
| vUpdater | the ValueUpdater |
| virtual ValueExtractor::View getExtractor | ( | ) | const [virtual] |
| virtual ValueUpdater::View getUpdater | ( | ) | const [virtual] |