Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Member Functions | List of all members
Ilwis::AttributeTable Class Reference
Inheritance diagram for Ilwis::AttributeTable:
Ilwis::Table Ilwis::IlwisObject Ilwis::Identity

Public Member Functions

quint32 rows () const
 
quint32 columns () const
 
QVariantList record (quint32 n) const
 
void record (quint32, const QVariantList &vars, quint32 offset=0)
 
QVariantList column (const QString &nme) const
 
void column (const QString &nme, const QVariantList &vars, quint32 offset=0)
 
QVariant cell (const QString &col, quint32 rec) const
 
void cell (const QString &col, quint32 rec, const QVariant &var)
 
bool createTable ()
 
bool addColumn (const QString &name, const IDomain &domain)
 
bool addColumn (const ColumnDefinition &def)
 
ColumnDefinition columndefinition (const QString &nme) const
 
quint32 columnIndex (const QString &nme) const
 
QVariant cellByKey (quint64 itemId, const QString &col)
 
void setTable (const ITable &tbl, const QString &keyColumn)
 
- Public Member Functions inherited from Ilwis::Table
virtual quint32 recordCount () const =0
 
virtual quint32 columnCount () const =0
 
virtual void recordCount (quint32 r)=0
 
virtual bool addColumn (const QString &name, const QString &domainname)=0
 
virtual ColumnDefinition columndefinition (quint32 index) const =0
 
virtual ColumnDefinitioncolumndefinition (quint32 index)=0
 
virtual void columndefinition (const ColumnDefinition &coldef)=0
 
virtual void newRecord ()=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 std::vector< quint32 > select (const QString &conditions) const =0
 
virtual void dataLoaded (bool yesno)=0
 
virtual bool isDataLoaded () const =0
 
- Public Member Functions inherited from Ilwis::IlwisObject
 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 IlwisObjectclone ()
 
virtual bool merge (const IlwisObject *obj, int options=0)
 
bool isSystemObject () const
 
bool isInternalObject () const
 
- Public Member Functions inherited from Ilwis::Identity
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)
 

Additional Inherited Members

- Public Types inherited from Ilwis::IlwisObject
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 }
 
- Static Public Member Functions inherited from Ilwis::IlwisObject
template<typename T >
static T create (const QString &def)
 
template<typename T >
static T create (quint64 id)
 
static IlwisObjectcreate (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)
 
- Protected Member Functions inherited from Ilwis::Table
 Table (const Resource &resource)
 
- Protected Attributes inherited from Ilwis::IlwisObject
std::mutex _mutex
 
std::mutex _loadforstore
 

Member Function Documentation

bool AttributeTable::addColumn ( const QString &  name,
const IDomain domain 
)
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

See Also
IDomain
Parameters
namethe name of a column must be unique among the columns
domainthe domain of the new column
Returns
true if the column is succesfully added, false if some error occurred. The nature of the error can be found in the issue logger

Implements Ilwis::Table.

bool AttributeTable::addColumn ( const ColumnDefinition def)
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

Parameters
defThe ColumnDefinition of the new column
Returns
true if succesful. Duplicate columns are not allowed

Implements Ilwis::Table.

ColumnDefinition AttributeTable::columndefinition ( const QString &  nme) const
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.

See Also
ColumnDefinition
Parameters
nmename of the column definition to be retrieved
Returns
a column definition or an invalid defintion if a non existing column was retrieved

Implements Ilwis::Table.

quint32 AttributeTable::columnIndex ( const QString &  nme) const
virtual

Translates a String with a column name into a column index

Parameters
nmethe name of the column
Returns
the index of the column with the given name and iundef illegaal

Implements Ilwis::Table.

bool AttributeTable::createTable ( )
virtual

Creates a table based on the definitions in the columndefinition members. Will load the data in the specified amount of collumns and rows

Returns
true if succesfull

Implements Ilwis::Table.

QVariantList AttributeTable::record ( quint32  n) const
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

Parameters
nthe row/record number of the record
Returns
A filled variantlist or an empty list if an error occurred. The nature of the error can be found in the issue logger

Implements Ilwis::Table.


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