MarkLogic Connect
MarkLogic Connect Client API Collection
Public Member Functions | List of all members
mlclient::ValuesResult Class Reference

Contains details of the overarching /v1/values (i.e. Connection::values) call results. More...

#include <ValuesResult.hpp>

Public Member Functions

MLCLIENT_API ValuesResult (const std::string &optionsName, const std::string &valuesName)
 Creates a values result with the specified options name and values name (from submitted search options) More...
 
MLCLIENT_API ValuesResult (ValuesResult &&other)
 Move constructor. More...
 
MLCLIENT_API ValuesResult (const ValuesResult &other)
 Copy constructor. More...
 
MLCLIENT_API ~ValuesResult ()
 Destructor.
 
MLCLIENT_API void addValue (const ValuesResultValue &value)
 Adds a values result value to this instance. More...
 
MLCLIENT_API const std::vector< ValuesResultValuegetValues () const
 Returns the underlying set of Values from this instance. More...
 
MLCLIENT_API void addAggregate (const ValuesResultAggregate &aggregate)
 
MLCLIENT_API const bool hasAggregates () const
 Whether any aggregate lookups are configured. More...
 
MLCLIENT_API const long getAggregateCount () const
 Returns the number of aggregates configured for lookup. More...
 
MLCLIENT_API const std::vector< ValuesResultAggregate >::const_iterator aggregateBegin () const
 Returns an iterator over the underlying aggregate lookups. More...
 
MLCLIENT_API const std::vector< ValuesResultAggregate >::const_iterator aggregateEnd () const
 Returns an iterator end marker for the underlying set of aggregate lookups. More...
 
MLCLIENT_API void setTimes (const std::string &valuesResolutionTime, const std::string &aggregateResolutionTime, const std::string &totalTime)
 Used to set the total response times by the code actually performing the values lookups. More...
 
MLCLIENT_API void setType (const mlclient::utilities::RangeIndexType &type)
 Sets the underlying range index lexicon type (A MarkLogic XML type) More...
 
MLCLIENT_API const mlclient::utilities::RangeIndexType & getType () const
 Returns the lexicon type. More...
 
MLCLIENT_API const long getStart ()
 Returns the sequence number of the first values result. More...
 
MLCLIENT_API const long getTotal ()
 Returns the total count of values results. More...
 
MLCLIENT_API const std::string & getValuesResolutionTime () const
 Returns the values resolution time for the last values requested, if available. More...
 
MLCLIENT_API const std::string & getAggregateResolutionTime () const
 Returns the aggregate resolution time for the last values requested, if available. More...
 
MLCLIENT_API const std::string & getTotalTime () const
 Returns the total time taken for the last values requested, if available. More...
 
MLCLIENT_API const std::string & getOptionsName () const
 Return the name of the REST API search options used to derive the result. More...
 
MLCLIENT_API const std::string & getValuesName () const
 Return the name of the values, configured within the search options specified, used to derive the result. More...
 

Detailed Description

Contains details of the overarching /v1/values (i.e. Connection::values) call results.

Author
Adam Fowler adam..nosp@m.fowl.nosp@m.er@ma.nosp@m.rklo.nosp@m.gic.c.nosp@m.om
Date
2016-08-12
Since
8.0.2

Constructor & Destructor Documentation

MLCLIENT_API mlclient::ValuesResult::ValuesResult ( const std::string &  optionsName,
const std::string &  valuesName 
)

Creates a values result with the specified options name and values name (from submitted search options)

Parameters
optionsNameThe string name of the options node for this values result
valuesNameThe string name for this particular values result
MLCLIENT_API mlclient::ValuesResult::ValuesResult ( ValuesResult &&  other)

Move constructor.

Parameters
otherThe ValuesResult object to steal the resources from
MLCLIENT_API mlclient::ValuesResult::ValuesResult ( const ValuesResult other)

Copy constructor.

Parameters
otherThe ValuesResult to copy

Member Function Documentation

MLCLIENT_API void mlclient::ValuesResult::addAggregate ( const ValuesResultAggregate aggregate)
Parameters
Addsan aggregate configuration to the set to lookup by this class
Note
The current REST API only supports submitting one aggregate request per call. This may be resolved in future versions. That change will be fully abstracted by this class' internals.
Parameters
aggregateThe aggregate configuration to lookup
MLCLIENT_API void mlclient::ValuesResult::addValue ( const ValuesResultValue value)

Adds a values result value to this instance.

Parameters
valuethe result value to add
MLCLIENT_API const std::vector<ValuesResultAggregate>::const_iterator mlclient::ValuesResult::aggregateBegin ( ) const

Returns an iterator over the underlying aggregate lookups.

Returns
The iterator over the list of aggregate lookups
MLCLIENT_API const std::vector<ValuesResultAggregate>::const_iterator mlclient::ValuesResult::aggregateEnd ( ) const

Returns an iterator end marker for the underlying set of aggregate lookups.

Returns
The iterator end marker
MLCLIENT_API const long mlclient::ValuesResult::getAggregateCount ( ) const

Returns the number of aggregates configured for lookup.

Returns
The number of aggregate lookups configured
MLCLIENT_API const std::string& mlclient::ValuesResult::getAggregateResolutionTime ( ) const

Returns the aggregate resolution time for the last values requested, if available.

Defaults to zero. Uses xsd:duration string format as per the REST API

Returns
xsd:duration string description of the time to resolve the aggregate
MLCLIENT_API const std::string& mlclient::ValuesResult::getOptionsName ( ) const

Return the name of the REST API search options used to derive the result.

Returns
The options name string
MLCLIENT_API const long mlclient::ValuesResult::getStart ( )

Returns the sequence number of the first values result.

Note
Only relevant if skip=N is used in options configuration. MarkLogic uses 1 based numbers. Thus the first record is at position 1, not position 0
Returns
The first result's sequence number (lowest is 1)
MLCLIENT_API const long mlclient::ValuesResult::getTotal ( )

Returns the total count of values results.

Returns
The total number of values results returned.
MLCLIENT_API const std::string& mlclient::ValuesResult::getTotalTime ( ) const

Returns the total time taken for the last values requested, if available.

Defaults to zero. Uses xsd:duration string format as per the REST API

Returns
xsd:duration string description of the total time taken (includes both values and aggregate times)
MLCLIENT_API const mlclient::utilities::RangeIndexType& mlclient::ValuesResult::getType ( ) const

Returns the lexicon type.

Returns
The lexicon type
MLCLIENT_API const std::vector<ValuesResultValue> mlclient::ValuesResult::getValues ( ) const

Returns the underlying set of Values from this instance.

Returns
The result set
MLCLIENT_API const std::string& mlclient::ValuesResult::getValuesName ( ) const

Return the name of the values, configured within the search options specified, used to derive the result.

Returns
The values name string, as configured within the specified search options
MLCLIENT_API const std::string& mlclient::ValuesResult::getValuesResolutionTime ( ) const

Returns the values resolution time for the last values requested, if available.

Defaults to zero. Uses xsd:duration string format as per the REST API

Returns
xsd:duration string description of the time to resolve the values
MLCLIENT_API const bool mlclient::ValuesResult::hasAggregates ( ) const

Whether any aggregate lookups are configured.

Returns
True if one or more aggregate lookups are configured
MLCLIENT_API void mlclient::ValuesResult::setTimes ( const std::string &  valuesResolutionTime,
const std::string &  aggregateResolutionTime,
const std::string &  totalTime 
)

Used to set the total response times by the code actually performing the values lookups.

Parameters
valuesResolutionTimeThe xs:duration string
aggregateResolutionTimeThe xs:duration string
totalTimeThe xs:duration string
MLCLIENT_API void mlclient::ValuesResult::setType ( const mlclient::utilities::RangeIndexType &  type)

Sets the underlying range index lexicon type (A MarkLogic XML type)

Parameters
typeThe lexicon type for lookup

The documentation for this class was generated from the following file: