QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsSensorThingsExpansionDefinition Class Reference

Encapsulates information about how relationships in a SensorThings API service should be expanded. More...

#include <qgssensorthingsutils.h>

Public Member Functions

 QgsSensorThingsExpansionDefinition (Qgis::SensorThingsEntity childEntity=Qgis::SensorThingsEntity::Invalid, const QString &orderBy=QString(), Qt::SortOrder sortOrder=Qt::SortOrder::AscendingOrder, int limit=QgsSensorThingsUtils::DEFAULT_EXPANSION_LIMIT, const QString &filter=QString())
 Constructor for QgsSensorThingsExpansionDefinition, targeting the specified child entity type.
 
QString asQueryString (Qgis::SensorThingsEntity parentEntityType, const QStringList &additionalOptions=QStringList()) const
 Returns the expansion as a valid SensorThings API query string, eg "$expand=Observations($orderby=phenomenonTime desc;$top=10)".
 
Qgis::SensorThingsEntity childEntity () const
 Returns the target child entity which should be expanded.
 
QString filter () const
 Returns the the string filter to filter expanded child entities by.
 
bool isValid () const
 Returns true if the definition is valid.
 
int limit () const
 Returns the limit on the number of child features to fetch.
 
bool operator!= (const QgsSensorThingsExpansionDefinition &other) const
 
bool operator== (const QgsSensorThingsExpansionDefinition &other) const
 
QString orderBy () const
 Returns the field name to order the expanded child entities by.
 
void setChildEntity (Qgis::SensorThingsEntity entity)
 Sets the target child entity which should be expanded.
 
void setFilter (const QString &filter)
 Returns the the string filter to filter expanded child entities by.
 
void setLimit (int limit)
 Sets the limit on the number of child features to fetch.
 
void setOrderBy (const QString &field)
 Sets the field name to order the expanded child entities by.
 
void setSortOrder (Qt::SortOrder order)
 Sets the sort order for the expanded child entities.
 
Qt::SortOrder sortOrder () const
 Returns the sort order for the expanded child entities.
 
QString toString () const
 Returns a string encapsulation of the expansion definition.
 

Static Public Member Functions

static QgsSensorThingsExpansionDefinition defaultDefinitionForEntity (Qgis::SensorThingsEntity entity)
 Returns an expansion definition for the specified entity type, populated with reasonable defaults which make sense for that entity type.
 
static QgsSensorThingsExpansionDefinition fromString (const QString &string)
 Returns a QgsSensorThingsExpansionDefinition from a string representation.
 

Detailed Description

Encapsulates information about how relationships in a SensorThings API service should be expanded.

Since
QGIS 3.38

Definition at line 185 of file qgssensorthingsutils.h.

Constructor & Destructor Documentation

◆ QgsSensorThingsExpansionDefinition()

QgsSensorThingsExpansionDefinition::QgsSensorThingsExpansionDefinition ( Qgis::SensorThingsEntity  childEntity = Qgis::SensorThingsEntity::Invalid,
const QString &  orderBy = QString(),
Qt::SortOrder  sortOrder = Qt::SortOrder::AscendingOrder,
int  limit = QgsSensorThingsUtils::DEFAULT_EXPANSION_LIMIT,
const QString &  filter = QString() 
)

Constructor for QgsSensorThingsExpansionDefinition, targeting the specified child entity type.

Definition at line 35 of file qgssensorthingsutils.cpp.

Member Function Documentation

◆ asQueryString()

QString QgsSensorThingsExpansionDefinition::asQueryString ( Qgis::SensorThingsEntity  parentEntityType,
const QStringList &  additionalOptions = QStringList() 
) const

Returns the expansion as a valid SensorThings API query string, eg "$expand=Observations($orderby=phenomenonTime desc;$top=10)".

The parent entity type for the expansion must be specified.

Optionally a list of additional query options can be specified for the expansion.

Definition at line 188 of file qgssensorthingsutils.cpp.

◆ childEntity()

Qgis::SensorThingsEntity QgsSensorThingsExpansionDefinition::childEntity ( ) const

Returns the target child entity which should be expanded.

See also
setChildEntity()

Definition at line 86 of file qgssensorthingsutils.cpp.

◆ defaultDefinitionForEntity()

QgsSensorThingsExpansionDefinition QgsSensorThingsExpansionDefinition::defaultDefinitionForEntity ( Qgis::SensorThingsEntity  entity)
static

Returns an expansion definition for the specified entity type, populated with reasonable defaults which make sense for that entity type.

Definition at line 45 of file qgssensorthingsutils.cpp.

◆ filter()

QString QgsSensorThingsExpansionDefinition::filter ( ) const

Returns the the string filter to filter expanded child entities by.

See also
setFilter()

Definition at line 116 of file qgssensorthingsutils.cpp.

◆ fromString()

QgsSensorThingsExpansionDefinition QgsSensorThingsExpansionDefinition::fromString ( const QString &  string)
static

Returns a QgsSensorThingsExpansionDefinition from a string representation.

See also
toString()

Definition at line 146 of file qgssensorthingsutils.cpp.

◆ isValid()

bool QgsSensorThingsExpansionDefinition::isValid ( ) const

Returns true if the definition is valid.

Definition at line 81 of file qgssensorthingsutils.cpp.

◆ limit()

int QgsSensorThingsExpansionDefinition::limit ( ) const

Returns the limit on the number of child features to fetch.

Returns -1 if no limit is defined.

See also
setLimit()

Definition at line 106 of file qgssensorthingsutils.cpp.

◆ operator!=()

bool QgsSensorThingsExpansionDefinition::operator!= ( const QgsSensorThingsExpansionDefinition other) const

Definition at line 252 of file qgssensorthingsutils.cpp.

◆ operator==()

bool QgsSensorThingsExpansionDefinition::operator== ( const QgsSensorThingsExpansionDefinition other) const

Definition at line 240 of file qgssensorthingsutils.cpp.

◆ orderBy()

QString QgsSensorThingsExpansionDefinition::orderBy ( ) const

Returns the field name to order the expanded child entities by.

See also
sortOrder()
setOrderBy()

Definition at line 257 of file qgssensorthingsutils.cpp.

◆ setChildEntity()

void QgsSensorThingsExpansionDefinition::setChildEntity ( Qgis::SensorThingsEntity  entity)

Sets the target child entity which should be expanded.

See also
childEntity()

Definition at line 91 of file qgssensorthingsutils.cpp.

◆ setFilter()

void QgsSensorThingsExpansionDefinition::setFilter ( const QString &  filter)

Returns the the string filter to filter expanded child entities by.

See also
filter()

Definition at line 121 of file qgssensorthingsutils.cpp.

◆ setLimit()

void QgsSensorThingsExpansionDefinition::setLimit ( int  limit)

Sets the limit on the number of child features to fetch.

Set to -1 if no limit is desired.

See also
limit()

Definition at line 111 of file qgssensorthingsutils.cpp.

◆ setOrderBy()

void QgsSensorThingsExpansionDefinition::setOrderBy ( const QString &  field)

Sets the field name to order the expanded child entities by.

See also
orderBy()
setSortOrder()

Definition at line 262 of file qgssensorthingsutils.cpp.

◆ setSortOrder()

void QgsSensorThingsExpansionDefinition::setSortOrder ( Qt::SortOrder  order)

Sets the sort order for the expanded child entities.

See also
setOrderBy()
sortOrder()

Definition at line 101 of file qgssensorthingsutils.cpp.

◆ sortOrder()

Qt::SortOrder QgsSensorThingsExpansionDefinition::sortOrder ( ) const

Returns the sort order for the expanded child entities.

See also
orderBy()
setSortOrder()

Definition at line 96 of file qgssensorthingsutils.cpp.

◆ toString()

QString QgsSensorThingsExpansionDefinition::toString ( ) const

Returns a string encapsulation of the expansion definition.

See also
fromString()

Definition at line 126 of file qgssensorthingsutils.cpp.


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