Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Ilwis::IlwisObject Class Referenceabstract

A class that is the baseclass for all Geospatial data classes and their directly supporting classes. More...

#include <ilwisobject.h>

Inheritance diagram for Ilwis::IlwisObject:
Ilwis::Identity Ilwis::Catalog Ilwis::CoordinateSystem Ilwis::Coverage Ilwis::Domain Ilwis::Ellipsoid Ilwis::GeoReference Ilwis::OperationMetaData Ilwis::Projection Ilwis::Table

Public Types

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 }
 

Public Member Functions

 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)
 

Static Public Member Functions

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

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

std::mutex _mutex
 
std::mutex _loadforstore
 

Friends

class IlwisObjectFactory
 
void addFactory (IlwisObjectFactory *)
 

Detailed Description

A class that is the baseclass for all Geospatial data classes and their directly supporting classes.

The class should only be used for instances that must be singletons in the system. That is, there may exist only one instance of it. The purpose of the class is to ensure automatic consistency of data in the system. Changes to one reference to the object are automatically reflected in the others because they are the same object.

A IlwisObject has a IlwisTypes, which can be any of the following, or a combination thereof:

Member Enumeration Documentation

The ConnectorMode enum Describes the state of the instance of the connector.

*connector maybe for input/output or both. This enum describes how a connector can be used.

this enum describes how certain data should be stored, as metadata or as binary data

Constructor & Destructor Documentation

IlwisObject::IlwisObject ( )

Standard constructor for an ilwisobject

IlwisObject::IlwisObject ( const Resource source)

Constructor for an ilwis object using a Resource the resource will be used to fill the identity field of this object

See Also
Resource
Parameters
sourcethe resource to be used

Member Function Documentation

void IlwisObject::addTypeFunction ( IlwisTypeFunction  func)
static

addTypeFunction

??

void IlwisObject::changed ( bool  yesno)
virtual

Sets the changed flag, needs to be set when something within this object gets changed

Parameters
yesnothe new value of the changed flag
void IlwisObject::connectTo ( const QUrl &  url,
const QString &  format,
const QString &  fnamespace,
ConnectorMode  cmode 
)

connectTo allocates a connector of a certain format to the ilwisobject.

Parameters
urlthe source/target were the connector connects to. The url maybe empty, internally an url will be created based on the format, name and working catalog
formatthe format identifying the source/target format. The name of the format is registered (plus namespace) by the connector plugin that realizes this format
fnamespacean additional identifier for selecting the correct connector. format names maybe identical from different connectors. The combination namespace-format is unique accross the system
cmodethe mode of the connector to be created
IlwisObject * IlwisObject::create ( const Resource source,
const PrepareOptions options = PrepareOptions() 
)
static

Creates a new IlwisObject from the given Resource will fail if the resource is somehow invalid

Parameters
sourcethe Resource
Returns
a new ilwisObject when succesful, or 0 when it fails
Time IlwisObject::createTime ( ) const

returns the create time of this object

Returns
Time
IlwisTypes IlwisObject::findType ( const QString &  source)
static

findType

??

Parameters
source
Returns
bool IlwisObject::fromInternal ( const QSqlRecord &  rec)

fills the name description code and connector field from a database record also sets the changed flag. will not succeed if this object is readonly

Parameters
recthe databaserecord (QSqlRecord)
Returns
true when succeeded
bool IlwisObject::hasChanged ( ) const
virtual

Checks if this object has been changed, requires the changed flag to be set during the actual change, so might not always be fully acurate

Returns
true when the object has changed
virtual IlwisTypes Ilwis::IlwisObject::ilwisType ( ) const
pure virtual
bool IlwisObject::isAnonymous ( ) const

checks the name of this object for the ANONYMOUS_PREFIX, this prefix must be at position 0 to generate a positive result

Returns
true when this object is ANONYMOUS
bool IlwisObject::isEqual ( const Ilwis::IlwisObject obj) const
virtual

isEqual compares the properties of ilwisobjects to test for equality.

*It also will test the id's in which case the equality is guarenteed. The method is virtual so it will be re-implemented at each derivative.

Parameters
objan ilwisobject to be compared with
Returns
true when the objects are equal

Reimplemented in Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.

bool IlwisObject::isReadOnly ( ) const
virtual

isReadOnly tells if the source/target of the ilwisobject maybe modifiable.

This method returns the combination of the connectors readonly state and the objects readonly state. The connectors readonly state points usualy to a physical or other lower level readonly state. while the objects readonly state points to a logical state.

Returns
readonly or not
bool IlwisObject::isValid ( ) const
virtual

isValid Tests the validity of an ilwisobject.

*Ilwisobjects are valid when all their properties are valid. Usualy this is determined during the 'loadXXX' methods that fill the properties of an object

Returns
valid or not

Reimplemented in Ilwis::ItemDomain< D >, Ilwis::BaseTable, Ilwis::Catalog, Ilwis::FlatTable, Ilwis::GeoReference, Ilwis::DatabaseTable, Ilwis::Projection, Ilwis::ConventionalCoordinateSystem, and Ilwis::Ellipsoid.

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

Tries to merge 2 IlwisObjects together, template function does not work for standard IlwisObject, see the correspondending subclass for details

Parameters
objthe object this should merge with
optionsmerging options
Returns
true when succesful

Reimplemented in Ilwis::BaseTable.

QDateTime IlwisObject::modifiedTime ( ) const

returns the moment when the object was last modified

Returns
QDateTime
IlwisTypes IlwisObject::name2Type ( const QString &  name)
static

converts a string with a name into a IlwisTypes if the name is invalid it will return itUNKOWN

Parameters
namea string with the name of an IlwisTypes
Returns
the correspondending IlwisTypes
bool IlwisObject::prepare ( )
virtual

tries to Prepares this ilwisobject for use

Returns
true when the prepare succeeded

Reimplemented in Ilwis::Coverage, Ilwis::FeatureCoverage, Ilwis::BaseTable, Ilwis::Catalog, Ilwis::FlatTable, Ilwis::DatabaseTable, Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.

bool IlwisObject::prepare ( const QString &  def)
virtual

prepare

??

Parameters
def
Returns

Reimplemented in Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.

void IlwisObject::setCode ( const QString &  cd)
virtual

Changes the code of this IlwisObject, can only happen when this object is not readonly, and the identity is not null

Parameters
cdthe new code

Reimplemented from Ilwis::Identity.

void IlwisObject::setConnector ( ConnectorInterface connector,
int  mode = cmINPUT | cmOUTPUT 
)
virtual

connects an ilwisobject to an input or output source

IlwisObjects are agnostic to where their data comes from. The connector isolates them from that. An object might have two connectors : one for input, one for output. Mostely though there is only one that can be used for both input and output ( if the connector allows it).

Parameters
connectorthe connector to be used
inputdefines the nature of the connector.
void IlwisObject::setCreateTime ( const Time time)

Changes the create time of this object

Parameters
time
void IlwisObject::setModifiedTime ( const Time time)

sets the last modified time of the object

Parameters
time
void IlwisObject::setName ( const QString &  nm)

Changes the name of this object, new name cannot be null. neither can you change the name if the IlwisObject is readonly

Parameters
nmthe new name
void IlwisObject::setReadOnly ( bool  yesno)
virtual

Changes the readonly state of this object. in order to do this it will both change the connectors readonly state and the objects

Parameters
yesnothe new readonly state
Resource IlwisObject::source ( int  mode = cmINPUT) const
virtual

source the location of the source that represents the physical read origin of this object

Returns
url that is sufficient to find the source

Reimplemented in Ilwis::Coverage, and Ilwis::RasterCoverage.

bool IlwisObject::store ( int  mode = smMETADATA | smBINARYDATA)
virtual

target the location of the source that represents the physical write target of this object

Returns
url that is sufficient to find the target
QString IlwisObject::toString ( )
virtual

translates the defintion of an object to a string representation

Returns
QString
QString IlwisObject::type2Name ( IlwisTypes  t)
static

creates a String with the name of the given IlwisTypes will return undefined if the given IlwisTypes is invalid

See Also
IlwisObject
Parameters
theIlwisTypes in need of naming
Returns
A string with the name of the IlwisTypes

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