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

Public Member Functions

 BaseTable ()
 
 BaseTable (const Resource &resource)
 
virtual quint32 recordCount () const
 
virtual quint32 columnCount () const
 
virtual void recordCount (quint32 r)
 
virtual bool createTable ()
 
virtual bool addColumn (const QString &name, const IDomain &domain)
 
virtual bool addColumn (const QString &name, const QString &domainname)
 
virtual bool addColumn (const ColumnDefinition &def)
 
IlwisTypes ilwisType () const
 
ColumnDefinition columndefinition (const QString &nme) const
 
ColumnDefinition columndefinition (quint32 index) const
 
ColumnDefinitioncolumndefinition (quint32 index)
 
void columndefinition (const ColumnDefinition &coldef)
 
bool prepare ()
 
bool isValid () const
 
bool merge (const IlwisObject *obj, int options)
 
void dataLoaded (bool yesno)
 
bool isDataLoaded () const
 
- Public Member Functions inherited from Ilwis::Table
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 std::vector< quint32 > select (const QString &conditions) const =0
 
- Public Member Functions inherited from Ilwis::IlwisObject
 IlwisObject ()
 
 IlwisObject (const Resource &source)
 
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 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 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 ()
 
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)
 

Protected Member Functions

virtual bool initLoad ()
 
virtual void adjustRange (int index)
 
void copyTo (IlwisObject *obj)
 
quint32 columnIndex (const QString &nme) const
 
void columnCount (int cnt)
 
QVariant checkInput (const QVariant &inputVar, quint32 columnIndex)
 
void initValuesColumn (const ColumnDefinition &def)
 
void initRecord (std::vector< QVariant > &values) const
 
- Protected Member Functions inherited from Ilwis::Table
 Table (const Resource &resource)
 
- Protected Member Functions inherited from Ilwis::IlwisObject
QScopedPointer
< ConnectorInterface > & 
connector (int mode=cmINPUT|cmOUTPUT)
 
const QScopedPointer
< ConnectorInterface > & 
connector (int mode=cmINPUT|cmOUTPUT) const
 
bool setValid (bool yesno)
 
void copyTo (IlwisObject *obj)
 
- Protected Member Functions inherited from Ilwis::Identity
 Identity (const QString &name, qint64 id=i64UNDEF, const QString &cde=sUNDEF, const QString &descr=sUNDEF)
 
void prepare (quint64 base=0)
 
void setId (quint64 newid)
 

Protected Attributes

QHash< QString, ColumnDefinition_columnDefinitionsByName
 
QHash< quint32, ColumnDefinition_columnDefinitionsByIndex
 

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)
 

Constructor & Destructor Documentation

BaseTable::BaseTable ( )

Constructs an empty BaseTable

BaseTable::BaseTable ( const Resource resource)

The constructor for a BaseTable with a a Resource that is registered in the mastercatalog.
This resource must have a name and an Id.
Code and description are optional.

See Also
IlwisObject
Resource
Parameters
resourceThe resource to use

Member Function Documentation

bool BaseTable::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.

Reimplemented in Ilwis::FlatTable, and Ilwis::DatabaseTable.

bool BaseTable::addColumn ( const QString &  name,
const QString &  domainname 
)
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

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 BaseTable::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.

Reimplemented in Ilwis::FlatTable.

quint32 BaseTable::columnCount ( ) const
virtual

returns the number of columns in a table.
cannot be negative.

Returns
columns in the table

Implements Ilwis::Table.

ColumnDefinition BaseTable::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.

ColumnDefinition BaseTable::columndefinition ( quint32  index) const
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.

See Also
ColumnDefinition
Parameters
indexindex 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.

ColumnDefinition & BaseTable::columndefinition ( quint32  index)
virtual

retrieves a reference to the definition of the column.
if there is no collumn at this index nullptr will be returned.

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

Implements Ilwis::Table.

void BaseTable::columndefinition ( const ColumnDefinition coldef)
virtual

sets a new column definition. The new definition must be valid.

See Also
ColumnDefinition
Parameters
coldefthe new ColumnDefinition to be set

Implements Ilwis::Table.

quint32 BaseTable::columnIndex ( const QString &  nme) const
protectedvirtual

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 BaseTable::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.

Reimplemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.

IlwisTypes BaseTable::ilwisType ( ) const
virtual

Gives the IlwisTypes of this object

See Also
IlwisObject
Returns
the IlwisTypes of this IlwisObject

Implements Ilwis::IlwisObject.

Reimplemented in Ilwis::DatabaseTable, and Ilwis::FlatTable.

bool BaseTable::isValid ( ) const
virtual

a BaseTable is valid if it has rows and columns

Returns
true when valid.

Reimplemented from Ilwis::IlwisObject.

Reimplemented in Ilwis::FlatTable, and Ilwis::DatabaseTable.

bool BaseTable::merge ( const IlwisObject obj,
int  options 
)
virtual

Merges this BaseTable with another BaseTable. Requires the given object to be a BaseTable, and the object cannot be null or undefined ofcourse

See Also
TableMerger
Parameters
objthe object this shouls merge with
optionsoptions for the merging, see TableMerger
Returns
true if the merging succeeded

Reimplemented from Ilwis::IlwisObject.

bool BaseTable::prepare ( )
virtual

tries to Prepares this ilwisobject for use

Returns
true when the prepare succeeded

Reimplemented from Ilwis::IlwisObject.

Reimplemented in Ilwis::FlatTable, and Ilwis::DatabaseTable.

quint32 BaseTable::recordCount ( ) const
virtual

return the number of rows in a table.
cannot be negative.

Returns
rows in the table

Implements Ilwis::Table.

void BaseTable::recordCount ( quint32  r)
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.

Parameters
rthe new row number

Implements Ilwis::Table.


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