SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::feature::Schema Class Reference

An ordered list of FieldDef, with name lookup. More...

#include <featuretypes.h>

Collaboration diagram for openswmmvis::feature::Schema:

Public Member Functions

 Schema ()=default
 
int count () const
 
bool isEmpty () const
 
const QVector< FieldDef > & fields () const
 
int indexOf (const QString &name) const
 
bool contains (const QString &name) const
 
const FieldDeffield (const QString &name) const
 
FieldDef at (int i) const
 
QStringList names () const
 
bool append (const FieldDef &f)
 
bool remove (const QString &name)
 
bool replace (const QString &name, const FieldDef &f)
 
void clear ()
 
QVariantMap defaultAttributes () const
 
QVariantMap conform (const QVariantMap &attrs) const
 
QJsonObject toJson () const
 
bool operator== (const Schema &o) const
 
bool operator!= (const Schema &o) const
 

Static Public Member Functions

static Schema fromJson (const QJsonObject &o)
 

Detailed Description

An ordered list of FieldDef, with name lookup.

Field order is the column order in the attribute table and the row order in the property panel, so it is preserved exactly as authored.

Constructor & Destructor Documentation

◆ Schema()

openswmmvis::feature::Schema::Schema ( )
default

Member Function Documentation

◆ append()

bool openswmmvis::feature::Schema::append ( const FieldDef f)

Append f. Fails (returns false) when the name is empty or already present — name collisions are a user error the schema editor reports, not something to silently rename.

Here is the call graph for this function:

◆ at()

FieldDef openswmmvis::feature::Schema::at ( int  i) const
Here is the caller graph for this function:

◆ clear()

void openswmmvis::feature::Schema::clear ( )
inline

◆ conform()

QVariantMap openswmmvis::feature::Schema::conform ( const QVariantMap &  attrs) const

Drop keys not in the schema and coerce the rest to their declared types. Called before every write so a stale attribute map from an undo record cannot reintroduce a removed column.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

bool openswmmvis::feature::Schema::contains ( const QString &  name) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ count()

int openswmmvis::feature::Schema::count ( ) const
inline
Here is the caller graph for this function:

◆ defaultAttributes()

QVariantMap openswmmvis::feature::Schema::defaultAttributes ( ) const

A QVariantMap with every field at its default (or a type-appropriate empty value), for a newly drawn feature.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ field()

const FieldDef * openswmmvis::feature::Schema::field ( const QString &  name) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fields()

const QVector< FieldDef > & openswmmvis::feature::Schema::fields ( ) const
inline
Here is the caller graph for this function:

◆ fromJson()

Schema openswmmvis::feature::Schema::fromJson ( const QJsonObject &  o)
static
Here is the call graph for this function:

◆ indexOf()

int openswmmvis::feature::Schema::indexOf ( const QString &  name) const
Here is the caller graph for this function:

◆ isEmpty()

bool openswmmvis::feature::Schema::isEmpty ( ) const
inline

◆ names()

QStringList openswmmvis::feature::Schema::names ( ) const

◆ operator!=()

bool openswmmvis::feature::Schema::operator!= ( const Schema o) const
inline

◆ operator==()

bool openswmmvis::feature::Schema::operator== ( const Schema o) const
inline

◆ remove()

bool openswmmvis::feature::Schema::remove ( const QString &  name)
Here is the call graph for this function:

◆ replace()

bool openswmmvis::feature::Schema::replace ( const QString &  name,
const FieldDef f 
)
Here is the call graph for this function:

◆ toJson()

QJsonObject openswmmvis::feature::Schema::toJson ( ) const

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