QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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. | |
Encapsulates information about how relationships in a SensorThings API service should be expanded.
Definition at line 185 of file qgssensorthingsutils.h.
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.
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.
Qgis::SensorThingsEntity QgsSensorThingsExpansionDefinition::childEntity | ( | ) | const |
Returns the target child entity which should be expanded.
Definition at line 86 of file qgssensorthingsutils.cpp.
|
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.
QString QgsSensorThingsExpansionDefinition::filter | ( | ) | const |
Returns the the string filter to filter expanded child entities by.
Definition at line 116 of file qgssensorthingsutils.cpp.
|
static |
Returns a QgsSensorThingsExpansionDefinition from a string representation.
Definition at line 146 of file qgssensorthingsutils.cpp.
bool QgsSensorThingsExpansionDefinition::isValid | ( | ) | const |
Returns true
if the definition is valid.
Definition at line 81 of file qgssensorthingsutils.cpp.
int QgsSensorThingsExpansionDefinition::limit | ( | ) | const |
Returns the limit on the number of child features to fetch.
Returns -1 if no limit is defined.
Definition at line 106 of file qgssensorthingsutils.cpp.
bool QgsSensorThingsExpansionDefinition::operator!= | ( | const QgsSensorThingsExpansionDefinition & | other | ) | const |
Definition at line 252 of file qgssensorthingsutils.cpp.
bool QgsSensorThingsExpansionDefinition::operator== | ( | const QgsSensorThingsExpansionDefinition & | other | ) | const |
Definition at line 240 of file qgssensorthingsutils.cpp.
QString QgsSensorThingsExpansionDefinition::orderBy | ( | ) | const |
Returns the field name to order the expanded child entities by.
Definition at line 257 of file qgssensorthingsutils.cpp.
void QgsSensorThingsExpansionDefinition::setChildEntity | ( | Qgis::SensorThingsEntity | entity | ) |
Sets the target child entity which should be expanded.
Definition at line 91 of file qgssensorthingsutils.cpp.
void QgsSensorThingsExpansionDefinition::setFilter | ( | const QString & | filter | ) |
Returns the the string filter to filter expanded child entities by.
Definition at line 121 of file qgssensorthingsutils.cpp.
void QgsSensorThingsExpansionDefinition::setLimit | ( | int | limit | ) |
Sets the limit on the number of child features to fetch.
Set to -1 if no limit is desired.
Definition at line 111 of file qgssensorthingsutils.cpp.
void QgsSensorThingsExpansionDefinition::setOrderBy | ( | const QString & | field | ) |
Sets the field name to order the expanded child entities by.
Definition at line 262 of file qgssensorthingsutils.cpp.
void QgsSensorThingsExpansionDefinition::setSortOrder | ( | Qt::SortOrder | order | ) |
Sets the sort order for the expanded child entities.
Definition at line 101 of file qgssensorthingsutils.cpp.
Qt::SortOrder QgsSensorThingsExpansionDefinition::sortOrder | ( | ) | const |
Returns the sort order for the expanded child entities.
Definition at line 96 of file qgssensorthingsutils.cpp.
QString QgsSensorThingsExpansionDefinition::toString | ( | ) | const |
Returns a string encapsulation of the expansion definition.
Definition at line 126 of file qgssensorthingsutils.cpp.