Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <table.h>
Public Member Functions | |
virtual quint32 | recordCount () const =0 |
virtual quint32 | columnCount () const =0 |
virtual void | recordCount (quint32 r)=0 |
virtual bool | createTable ()=0 |
virtual bool | addColumn (const QString &name, const IDomain &domain)=0 |
virtual bool | addColumn (const QString &name, const QString &domainname)=0 |
virtual bool | addColumn (const ColumnDefinition &def)=0 |
virtual ColumnDefinition | columndefinition (const QString &nme) const =0 |
virtual ColumnDefinition | columndefinition (quint32 index) const =0 |
virtual ColumnDefinition & | columndefinition (quint32 index)=0 |
virtual void | columndefinition (const ColumnDefinition &coldef)=0 |
virtual void | newRecord ()=0 |
virtual std::vector< QVariant > | record (quint32 n) const =0 |
virtual void | record (quint32 rec, const std::vector< QVariant > &vars, quint32 offset=0)=0 |
virtual std::vector< QVariant > | column (const QString &nme, quint32 start=0, quint32 stop=2e9) const =0 |
virtual std::vector< QVariant > | column (quint32 index, quint32 start=0, quint32 stop=2e9) const =0 |
virtual void | column (const QString &nme, const std::vector< QVariant > &vars, quint32 offset=0)=0 |
virtual void | column (const quint32 index, const std::vector< QVariant > &vars, quint32 offset=0)=0 |
virtual QVariant | cell (const QString &col, quint32 rec, bool asRaw=true) const =0 |
virtual QVariant | cell (const quint32 index, quint32 rec, bool asRaw=true) const =0 |
virtual void | setCell (const QString &col, quint32 rec, const QVariant &var)=0 |
virtual void | setCell (quint32 col, quint32 rec, const QVariant &var)=0 |
virtual quint32 | columnIndex (const QString &nme) const =0 |
virtual std::vector< quint32 > | select (const QString &conditions) const =0 |
virtual void | dataLoaded (bool yesno)=0 |
virtual bool | isDataLoaded () const =0 |
![]() | |
IlwisObject () | |
IlwisObject (const Resource &source) | |
virtual bool | prepare () |
void | setName (const QString &nm) |
void | setCode (const QString &cd) |
QDateTime | modifiedTime () const |
returns the moment when the object was last modified More... | |
void | setModifiedTime (const Time &time) |
sets the last modified time of the object More... | |
Time | createTime () const |
void | setCreateTime (const Time &time) |
virtual QString | toString () |
translates the defintion of an object to a string representation More... | |
virtual void | setConnector (ConnectorInterface *connector, int mode=cmINPUT|cmOUTPUT) |
connects an ilwisobject to an input or output source More... | |
virtual bool | isEqual (const Ilwis::IlwisObject *obj) const |
isEqual compares the properties of ilwisobjects to test for equality. More... | |
virtual bool | isValid () const |
isValid Tests the validity of an ilwisobject. More... | |
virtual bool | isReadOnly () const |
isReadOnly tells if the source/target of the ilwisobject maybe modifiable. More... | |
virtual void | setReadOnly (bool yesno) |
virtual bool | hasChanged () const |
virtual void | changed (bool yesno) |
virtual IlwisTypes | ilwisType () const =0 |
virtual bool | prepare (const QString &def) |
prepare More... | |
bool | fromInternal (const QSqlRecord &rec) |
bool | isAnonymous () const |
virtual Resource | source (int mode=cmINPUT) const |
source the location of the source that represents the physical read origin of this object More... | |
virtual bool | store (int mode=smMETADATA|smBINARYDATA) |
target the location of the source that represents the physical write target of this object More... | |
void | connectTo (const QUrl &url, const QString &format, const QString &fnamespace, ConnectorMode cmode) |
virtual IlwisObject * | clone () |
virtual bool | merge (const IlwisObject *obj, int options=0) |
bool | isSystemObject () const |
bool | isInternalObject () const |
![]() | |
QString | code () const |
code returns the code of the identity. If no code is attached it will return sUNDEF ("?"). More... | |
quint64 | id () const |
id returns a unsigned 64-bit number unique for the objects using the identity More... | |
virtual QString | name () const |
name returns the name of an object. All objects have names though names need not to be unique More... | |
void | setName (const QString &n) |
setName sets the name of an object. All objects have names though names need not to be unique More... | |
virtual QString | description () const |
void | setDescription (const QString &desc) |
Protected Member Functions | |
Table (const Resource &resource) | |
![]() | |
QScopedPointer < ConnectorInterface > & | connector (int mode=cmINPUT|cmOUTPUT) |
const QScopedPointer < ConnectorInterface > & | connector (int mode=cmINPUT|cmOUTPUT) const |
bool | setValid (bool yesno) |
void | copyTo (IlwisObject *obj) |
![]() | |
Identity (const QString &name, qint64 id=i64UNDEF, const QString &cde=sUNDEF, const QString &descr=sUNDEF) | |
void | prepare (quint64 base=0) |
void | setId (quint64 newid) |
Additional Inherited Members | |
![]() | |
enum | ConnectorMode { cmINPUT =1, cmOUTPUT =2, cmEXTENDED =4 } |
The ConnectorMode enum Describes the state of the instance of the connector. More... | |
enum | StoreMode { smMETADATA =1, smBINARYDATA =2 } |
![]() | |
template<typename T > | |
static T | create (const QString &def) |
template<typename T > | |
static T | create (quint64 id) |
static IlwisObject * | create (const Resource &source, const PrepareOptions &options=PrepareOptions()) |
static IlwisTypes | findType (const QString &source) |
findType More... | |
static QString | type2Name (IlwisTypes t) |
static IlwisTypes | name2Type (const QString &name) |
static void | addTypeFunction (IlwisTypeFunction) |
addTypeFunction More... | |
static IlwisTypes | name2ExtendedType (const QString &dname) |
![]() | |
std::mutex | _mutex |
std::mutex | _loadforstore |
Generic interface for tabular data in Ilwis. In Ilwis a table is a structure with rows and columns in 2D. There are two main implementations of the table
|
pure virtual |
adds a column to the current set of columns of this table
the name string must be unique and the domain must be valid.
if this collumn creates a duplicate nothing will happen.
the collumn will be filled with appropriate defaults depending on the domain
name | the name of a column must be unique among the columns |
domain | the domain of the new column |
Implemented in Ilwis::FlatTable, Ilwis::BaseTable, Ilwis::DatabaseTable, and Ilwis::AttributeTable.
|
pure virtual |
adds a column to the current set of columns of this table.
duplicate columns wil be skipped
The new collumn contents will be set to appropriate defaults depending on the domain
The name string must be unique in the set of collumns and the domainname must be valid
name | the name of a column must be unique among the columns |
domain | the domain of the new column |
Implemented in Ilwis::BaseTable.
|
pure virtual |
adds a column to the column definitions.
ColumnDefinition must be valid.
The new column contents will be set to appropriate defaults depending on the domain
def | The ColumnDefinition of the new column |
Implemented in Ilwis::FlatTable, Ilwis::BaseTable, and Ilwis::AttributeTable.
|
pure virtual |
returns the value of a single record/field combination ( a cell).
Disabling asRaw (setting it to false) has negative effects on performance.
col | column name |
rec | record number |
asRaw | when set to false it will return the String value on Thematic and Identifier domains |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
returns the value of a single record/field combination ( a cell).
Disabling asRaw (setting it to false) has negative effects on performance.
index | column index |
asRaw | when set to false it will return the String value on Thematic and Identifier domains |
rec | record number |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
returns the content of a column with a name in a vector. Will return an empty vector if there is no collumn with that name
nme | name of the column to be returned |
start | The index at which it should start returning values(within the collumn) |
stop | The index at which it should stop returning values(within the collumn) |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
returns the content of a column at a index in a vector. Will return an empty vector if there is no column with that name
index | the index of the column to be returned |
start | The index at which it should start returning values(within the collumn) |
stop | The index at which it should stop returning values(within the collumn) |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
sets a column with values from variantlist. The list doesnt need to contain all the rows in a column but may contain a subset.
Note that the rows are in consecutive order.
nme | name of the column to be set |
vars | values of the rows |
offset | starting row form where the values are set. If the number of values to be added goes beyond the size of the table, new records will be added |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
sets a column with values from variantlist. The list doesnt need to contain all the rows in a column but may contain a subset.
Note that the rows are in consecutive order.
index | index of the column to be set |
vars | values of the rows |
offset | starting row form where the values are set. If the number of values to be added goes beyond the size of the table, new records will be added |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
returns the number of columns in a table.
cannot be negative.
Implemented in Ilwis::BaseTable.
|
pure virtual |
retrieves the definition of the column with the given name.
if there is no collumn with that name an invalid ColumnDefinition will be returned.
nme | name of the column definition to be retrieved |
Implemented in Ilwis::BaseTable, and Ilwis::AttributeTable.
|
pure virtual |
retrieves the definition of the column at the given index.
if there is no collumn at this index an invalid ColumnDefinition will be returned.
index | index of the column definition to be retrieved |
Implemented in Ilwis::BaseTable.
|
pure virtual |
retrieves a reference to the definition of the column.
if there is no collumn at this index nullptr will be returned.
index | index of the ColumnDefinition to be retrieved |
Implemented in Ilwis::BaseTable.
|
pure virtual |
sets a new column definition. The new definition must be valid.
coldef | the new ColumnDefinition to be set |
Implemented in Ilwis::BaseTable.
|
pure virtual |
Translates a String with a column name into a column index
nme | the name of the column |
Implemented in Ilwis::BaseTable, and Ilwis::AttributeTable.
|
pure virtual |
Creates a table based on the definitions in the columndefinition members. Will load the data in the specified amount of collumns and rows
Implemented in Ilwis::BaseTable, Ilwis::DatabaseTable, Ilwis::FlatTable, and Ilwis::AttributeTable.
|
pure virtual |
Adds a new record to this table It will be filled with appropriate default values depending on the domain(s)
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
retrieves a record from a table. A record contains all the fields for one row. This method is implemented in the derivatives
of table as how records are organized is quite different between the derivatives
n | the row/record number of the record |
Implemented in Ilwis::DatabaseTable, Ilwis::FlatTable, and Ilwis::AttributeTable.
|
pure virtual |
sets a record with values from variantlist. The list doesnt need to contain all the fields in a record but may contain a subset.
Note that the fields are in consecutive order. It is up to the programmer that the order of fields in the list match the order of fields in the table
rec | record that has to be updated. If the record number is beyond the last record or the record is iUNDEF, the record will appended to the end |
vars | the list values to be set |
offset | starting point of the field to be set |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
return the number of rows in a table.
cannot be negative.
Implemented in Ilwis::BaseTable.
|
pure virtual |
sets the number of rows in a table. If the number of rows is bigger than the current number of rows is the extra records will be filled with appropriate defaults depending on the domain.
if the number is smaller the excess records will be deleted.
Negative values are not allowed.
r | the new row number |
Implemented in Ilwis::BaseTable.
|
pure virtual |
Selects the indices of all collumns that meet the conditions specified in the conditions String
so for example: if conditions is
it will return all indices at which collumns 1 and 2 meet the requirements
This function is still under development, only the most basic expressions are implemented at this time
conditions |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
Sets the value of a single cell
col | column name of the cell to be set |
rec | record number of the cell to be set |
var | the new value of the cell |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.
|
pure virtual |
Sets the value of a single cell
col | index of the column of the cell to be set |
rec | record number of the cell to be set |
var | the new value of the cell |
Implemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.