|
ScaleOut C++ Native Client API
5.1
|
A ValueComparand node holds a literal value to be compared with a field or property within objects persisted to StateServer via a TypedNamedCache::put(), TypedNamedCache::insert(), or TypedNamedCache::update() method. More...
#include <value_comparand.h>
Public Member Functions | |
| ValueComparand (std::string const &value) | |
| Constructor. More... | |
| ValueComparand (char const *value) | |
| Constructor. More... | |
| ValueComparand (wchar_t const *value) | |
| Constructor. More... | |
| ValueComparand (std::wstring const &value) | |
| Constructor. More... | |
| ValueComparand (uint8_t const *value, size_t length) | |
| Constructor. More... | |
| ValueComparand (std::vector< uint8_t > const &value) | |
| Constructor. More... | |
| ValueComparand (sosscli::internal::TypeSignature const &value) | |
| Constructor. More... | |
| ValueComparand (int32_t value) | |
| Constructor. More... | |
| ValueComparand (uint32_t value) | |
| Constructor. More... | |
| ValueComparand (int64_t value) | |
| Constructor. More... | |
| ValueComparand (uint64_t value) | |
| Constructor. More... | |
| ValueComparand (double value) | |
| Constructor. More... | |
| ValueComparand (float value) | |
| Constructor. More... | |
| ValueComparand (bool value) | |
| Constructor. More... | |
| Filter | operator== (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare for equality this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref. More... | |
| Filter | operator!= (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare for inequality this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref. More... | |
| Filter | operator> (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a greater than condition. More... | |
| Filter | operator>= (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a greater than or equal to condition. More... | |
| Filter | operator< (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a less than condition. More... | |
| Filter | operator<= (ReferenceComparand const &field_ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a less than or equal to condition. More... | |
| Filter | contains (ReferenceComparand const &ref) |
| Creates a Filter object based on a QueryExpression that causes StateServer to compare for string containment the value corresponding to this ValueComparand (which must be a string-type value) with the value of the field corresponding to ref's ReferenceComparand::field_name() (which must also be a string-type value) in objects persisted in StateServer. More... | |
| int | type_code () const |
| Returns an opaque "type code" which is interpreted by StateServer as the data type of this ValueComparand. More... | |
| bool | is_string_type () const |
Returns true if this ValueComparand holds a string value suitable for use with string contains comparisons. More... | |
| virtual void | accept (QueryExpression::Visitor &v) const |
| Initiates the visitor pattern on this node. More... | |
| void | allocate_value (sosscli::internal::IndexValueWriter &writer) const |
| Allocate space for this ValueComparand in the supplied writer. More... | |
| void | allocate_value_as (sosscli::internal::IndexValueWriter &writer, int type_code) const |
| Allocate space for this ValueComparand in the supplied writer after conversion of the value to the type specified by type_code. More... | |
| int | write_value (sosscli::internal::IndexValueWriter &writer) const |
| Write the value of this ValueComparand to the supplied writer. More... | |
| int | write_value_as (sosscli::internal::IndexValueWriter &writer, int type_code) const |
| Convert the value held by this ValueComparand to type indicated by type_code and write the converted value to the supplied writer. More... | |
Static Public Member Functions | |
| static ValueComparand | null () |
Returns a ValueComparand representing a NULL value. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, ValueComparand const &p) |
| Write a string representation of the this ValueComparand's value to the output stream. More... | |
A ValueComparand node holds a literal value to be compared with a field or property within objects persisted to StateServer via a TypedNamedCache::put(), TypedNamedCache::insert(), or TypedNamedCache::update() method.
ValueComparand implements a number of comparison operator overloads that serve as Filter factory methods: By writing an expression that compares a ValueOperand with a 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, the following:
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 literal value 2000 to the value of the "id" field of objects persisted on the server.
| sosscli::ValueComparand::ValueComparand | ( | std::string const & | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | char const * | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | wchar_t const * | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | std::wstring const & | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | uint8_t const * | value, |
| size_t | length | ||
| ) |
Constructor.
Initialize a new ValueComparand instance with array value.
| value | The value to be held by the new ValueComparand instance. |
| length | The length of the array value |
| sosscli::ValueComparand::ValueComparand | ( | std::vector< uint8_t > const & | value) |
Constructor.
Initialize a new ValueComparand instance with a vector of bytes, value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | sosscli::internal::TypeSignature const & | value) |
Constructor.
Initialize a new ValueComparand instance with a TypeSignature value.
| value | The sosscli::internal::TypeSignature value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | int32_t | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | uint32_t | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | int64_t | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | uint64_t | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | double | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | float | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
| sosscli::ValueComparand::ValueComparand | ( | bool | value) |
Constructor.
Initialize a new ValueComparand instance with value.
| value | The value to be held by the new ValueComparand instance. |
|
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.
| void sosscli::ValueComparand::allocate_value | ( | sosscli::internal::IndexValueWriter & | writer) | const |
Allocate space for this ValueComparand in the supplied writer.
| writer | The sosscli::internal::IndexValueWriter in which space should be reserved. |
| void sosscli::ValueComparand::allocate_value_as | ( | sosscli::internal::IndexValueWriter & | writer, |
| int | type_code | ||
| ) | const |
Allocate space for this ValueComparand in the supplied writer after conversion of the value to the type specified by type_code.
| writer | The sosscli::internal::IndexValueWriter in which space should be reserved. |
| type_code | The StateServer type code to which the value held by this ValueComparand should be converted. |
| std::invalid_argument | If the requested type conversion is not possible. |
| Filter sosscli::ValueComparand::contains | ( | ReferenceComparand const & | ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for string containment the value corresponding to this ValueComparand (which must be a string-type value) with the value of the field corresponding to ref's ReferenceComparand::field_name() (which must also be a string-type value) in objects persisted in StateServer.
| ref | A ReferenceComparand holding the name of another field. The field must hold string values. |
| bool sosscli::ValueComparand::is_string_type | ( | ) | const |
Returns true if this ValueComparand holds a string value suitable for use with string contains comparisons.
|
static |
Returns a ValueComparand representing a NULL value.
In addition to null-valued strings and byte arrays, StateServer supports the notion of "nullable" value types. Depending on the serializer in use, nullable value types may be used to represent optional or not-present values in the serialized representation of an object on StateServer.
| Filter sosscli::ValueComparand::operator!= | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for inequality this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref.
| field_ref | The reference holding the field name of the values to compare. |
| Filter sosscli::ValueComparand::operator< | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a less than condition.
| field_ref | The reference holding the field name of the values to compare. |
| Filter sosscli::ValueComparand::operator<= | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a less than or equal to condition.
| field_ref | The reference holding the field name of the values to compare. |
| Filter sosscli::ValueComparand::operator== | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare for equality this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref.
| field_ref | The reference holding the field name of the values to compare. |
| Filter sosscli::ValueComparand::operator> | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a greater than condition.
| field_ref | The reference holding the field name of the values to compare. |
| Filter sosscli::ValueComparand::operator>= | ( | ReferenceComparand const & | field_ref) |
Creates a Filter object based on a QueryExpression that causes StateServer to compare this ValueComparand with the field values of objects persisted in StateServer corresponding to ReferenceComparand::field_name() of field_ref for a greater than or equal to condition.
| field_ref | The reference holding the field name of the values to compare. |
| int sosscli::ValueComparand::type_code | ( | ) | const |
Returns an opaque "type code" which is interpreted by StateServer as the data type of this ValueComparand.
| int sosscli::ValueComparand::write_value | ( | sosscli::internal::IndexValueWriter & | writer) | const |
Write the value of this ValueComparand to the supplied writer.
| writer | The sosscli::internal::IndexValueWriter into which this ValueComparand's value should be written. |
| int sosscli::ValueComparand::write_value_as | ( | sosscli::internal::IndexValueWriter & | writer, |
| int | type_code | ||
| ) | const |
Convert the value held by this ValueComparand to type indicated by type_code and write the converted value to the supplied writer.
| writer | The sosscli::internal::IndexValueWriter into which this ValueComparand's converted value should be written. |
| type_code | The StateServer type code to which the value held by this ValueComparand should be converted. |
| std::invalid_argument | If the requested type conversion is not possible. |
|
friend |
Write a string representation of the this ValueComparand's value to the output stream.
| o | The std::ostream to write to. |
| p | The ValueComparand to write. |