ScaleOut C++ Native Client API
5.1
|
A ReferenceComparand node holds a string used to identify a field or property within objects persisted to StateServer via a TypedNamedCache::put(), TypedNamedCache::insert(), or TypedNamedCache::update() method. More...
#include <reference_comparand.h>
Public Member Functions | |
ReferenceComparand (std::string const &field_name) | |
Constructor. More... | |
ReferenceComparand (const char *field_name) | |
Constructor. More... | |
Filter | operator== (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for equality. More... | |
Filter | operator== (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for equality the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | operator!= (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for inequality. More... | |
Filter | operator!= (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for inequality the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | operator> (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a greater than condition. More... | |
Filter | operator> (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a greater than condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | operator>= (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a greater than or equal to condition. More... | |
Filter | operator>= (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a greater than or equal to condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | operator< (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a less than condition. More... | |
Filter | operator< (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a less than condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | operator<= (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a less than or equal to condition. More... | |
Filter | operator<= (ReferenceComparand const &field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a less than or equal to condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer. More... | |
Filter | contains (ValueComparand const &value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() (which must be a string-type value) of objects persisted in StateServer with the "immediate" value held by value (which must also be a string-type value) for string containment. More... | |
Filter | contains (ReferenceComparand const &ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() (which must be a string-type value) of objects persisted in StateServer with the the value corresponding to ref's field_name() (which must also be a string-type value) for string containment. More... | |
std::string const & | field_name () const |
Returns the name of this ReferenceComparand's field. More... | |
virtual void | accept (QueryExpression::Visitor &v) const |
Initiates the visitor pattern on this node. More... | |
A ReferenceComparand node holds a string used to identify a field or property within objects persisted to StateServer via a TypedNamedCache::put(), TypedNamedCache::insert(), or TypedNamedCache::update() method.
Type serializers implemented in TypedNamedCache subclasses may (depending on the subclass implementation) serialize metadata containing name, type, and value information when an object is persisted. If so, StateServer can be directed to examine this metadata when a QueryExpression is evaluated and compare this information on the StateServer hosts with immediate values and/or other object fields/properties when executing a NamedCache::query() operation. The ReferenceComparand holds only a field/property name. Translating that name into a query expression operand is dependent on the metadata serializer which is in turn dependent on the TypedNamedCache subclass. A serializer-dependent QueryExpression::Visitor is used to translate the field name into a much more compact expression that the server can use.
ReferenceComparand implements a number of comparison operator overloads that serve as Filter factory methods: By writing an expression that compares a ReferenceOperand with either a ValueOperand or another ReferenceOperand, you create a Filter object. Filters can be subsequently combined with other filters using boolean operator overloads implemented in the Filter class. For example:
Creates a Filter which can be used as the argument to a NamedCache::query(const Filter &, bool) method call which will translate filt into a StateServer expression that compares the "id" field of objects persisted on the server to the literal value 2000.
|
explicit |
Constructor.
Creates a new ReferenceComparand instance initialized with the given field_name.
field_name | the name of a field known to be serialized as object metadata for the object type that the NamedCache::query() will be run against. |
|
explicit |
Constructor.
Creates a new ReferenceComparand instance initialized with the given field_name.
field_name | the name of a field known to be serialized as object metadata for the object type that the NamedCache::query() will be run against. |
|
virtual |
Initiates the visitor pattern on this node.
Calls QueryExpression::Visitor::visit(ReferenceComparand const &) on the supplied visitor, v.
v | An implementation of QueryExpression::Visitor. |
Implements sosscli::ExpressionComparand.
Filter sosscli::ReferenceComparand::contains | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() (which must be a string-type value) of objects persisted in StateServer with the "immediate" value held by value (which must also be a string-type value) for string containment.
value | The "immediate" value to compare. The value must be a string type value. |
Filter sosscli::ReferenceComparand::contains | ( | ReferenceComparand const & | ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() (which must be a string-type value) of objects persisted in StateServer with the the value corresponding to ref's field_name() (which must also be a string-type value) for string containment.
ref | A ReferenceComparand holding the name of another field. The field must hold string values. |
std::string const& sosscli::ReferenceComparand::field_name | ( | ) | const |
Returns the name of this ReferenceComparand's field.
Filter sosscli::ReferenceComparand::operator!= | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for inequality.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator!= | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for inequality the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |
Filter sosscli::ReferenceComparand::operator< | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a less than condition.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator< | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a less than condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |
Filter sosscli::ReferenceComparand::operator<= | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a less than or equal to condition.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator<= | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a less than or equal to condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |
Filter sosscli::ReferenceComparand::operator== | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for equality.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator== | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for equality the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |
Filter sosscli::ReferenceComparand::operator> | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a greater than condition.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator> | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a greater than condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |
Filter sosscli::ReferenceComparand::operator>= | ( | ValueComparand const & | value) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare the field value corresponding to field_name() of objects persisted in StateServer with the "immediate" value held by value for a greater than or equal to condition.
value | The "immediate" value to compare. |
Filter sosscli::ReferenceComparand::operator>= | ( | ReferenceComparand const & | field) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for a greater than or equal to condition the field values corresponding to this ReferenceComparand's field_name() with the value corresponding to field's field_name() for objects persisted in StateServer.
field | A ReferenceComparand holding the name of another field |