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 | List of all members
Ilwis::Domain Class Referenceabstract

#include <domain.h>

Inheritance diagram for Ilwis::Domain:
Ilwis::IlwisObject Ilwis::Identity Ilwis::ColorDomain Ilwis::CoordinateDomain Ilwis::ItemDomain< D > Ilwis::NumericDomain Ilwis::TextDomain Ilwis::ValueDomain

Public Types

enum  Containement { cSELF =1, cPARENT =2, cDECLARED =3, cNONE =0 }
 
- 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 }
 

Public Member Functions

 Domain ()
 
 Domain (const Resource &resource)
 
bool isStrict () const
 
void setStrict (bool yesno)
 
virtual IlwisTypes valueType () const =0
 
virtual QVariant impliedValue (const QVariant &v) const
 
IDomain parent () const
 
virtual void setParent (const IDomain &dm)
 
virtual Containement contains (const QVariant &value) const =0
 
virtual bool isCompatibleWith (const IDomain &dom) const =0
 
template<typename T = Range>
QSharedPointer< T > range2range () const
 
virtual void range (Range *rng)=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)
 

Static Public Member Functions

static IlwisTypes ilwType (const QVariant &v)
 
static IlwisTypes ilwType (const QString &impliedValue)
 
- 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

void addChildDomain (quint64 idchild)
 
bool removeChildDomain (quint64 idchild)
 
virtual QSharedPointer< RangegetRange () const =0
 
- 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

std::map< quint64, quint32 > _childDomains
 
- Protected Attributes inherited from Ilwis::IlwisObject
std::mutex _mutex
 
std::mutex _loadforstore
 

Detailed Description

The domain class defines the semantics of the values used in Ilwis maps or tables. Domains range from numeric, to thematic and time datatypes. Basically every datatype used in Ilwis is tied to a domain. Domains can be hierarchically organized meaning that A domain maybe a generalization of other domains. The purpose of this is to be able to use subsets of domains in general cases. For example the landcover classification system Corine is fairly large and subsetting seems (in relevant cases) reasonable. If the subset would have no relation to the whole thematic domain (Corine) it would be impossible to reuse it in cases were a corine domain is expected. The strict flag limits this behavior. For the behaviour of the individual domain types see the relevant class.

Member Enumeration Documentation

Enumerates the possible containment cases: cSELF,cPARENT,cDECLARED and cNONE

  • cSELF means containment within the domain asked
  • cPARENT means containment within the parent of this domain
  • cDECLARED means //todo
  • cNONE means no containment at all in relation to this domain

Constructor & Destructor Documentation

Domain::Domain ( )

Creates an empty new strict Domain

Domain::Domain ( const Resource resource)

Creates a new strict Domain based on a Resource

Parameters
resourceThe resource to be used for this domain

Member Function Documentation

virtual Containement Ilwis::Domain::contains ( const QVariant &  value) const
pure virtual

Checks if this Domain contains a certain value

Parameters
valuethe value to check
Returns
depends on the implementation of the subclass

Implemented in Ilwis::ItemDomain< D >, Ilwis::NumericDomain, Ilwis::CoordinateDomain, Ilwis::TextDomain, and Ilwis::ColorDomain.

IlwisTypes Domain::ilwType ( const QVariant &  v)
static

translates the type of a variant to a compatible ilwis type

recognises:

  • itUINT8
  • itUINT16
  • itUINT32
  • itINT8
  • itINT16
  • itINT32
  • itINT64
  • itBOOL
  • itDOUBLE
Parameters
thevariant to be translated
See Also
IlwisObject
Returns
the corresponding ilwis type. This maybe unknown if the variant contains a type that is not part of the base system of Ilwis
IlwisTypes Domain::ilwType ( const QString &  impliedValue)
static

Translates a String to a compatible ilwis type

recognises:

  • itUINT8
  • itDOUBLE
  • itINT32
  • itINT64
  • itSTRING
  • itTIME
  • itDATE
  • itDATETIME
Parameters
valuethe string to be translated
See Also
IlwisObject
Returns
the corresponding ilwis type. This maybe unknown if the variant contains a type that is not part of the base system of Ilwis
virtual QVariant Ilwis::Domain::impliedValue ( const QVariant &  v) const
inlinevirtual

translates a qvariant into a qstring based on the domain

Reimplemented in Ilwis::ItemDomain< D >, Ilwis::CoordinateDomain, Ilwis::NumericDomain, Ilwis::TextDomain, and Ilwis::ColorDomain.

virtual bool Ilwis::Domain::isCompatibleWith ( const IDomain dom) const
pure virtual

Checks if the Domain is compatible with another domain
See the relevant subclass for more info

Parameters
domanother domain
Returns
true if the Domains are compatible

Implemented in Ilwis::ItemDomain< D >, Ilwis::NumericDomain, Ilwis::TextDomain, Ilwis::CoordinateDomain, and Ilwis::ColorDomain.

bool Ilwis::Domain::isStrict ( ) const

return the strict status of the domain. When a domain is set to strict it will only compare domain properties
to domain types that are identical to itself. Parent domain properties are ignored. For example if a operation only accepts
a strict numeric domain min1to1, it will refuse a generic numeric domain as that may contain other (possible illegal) values.

Returns
the strict state.
IDomain Domain::parent ( ) const

returns the parent domain of the domain. This maybe an invalid domain when no parent is set. The child domain specializes (ad/or adds)
some properties of the parent domain to create a more limited behavior. When not strict the parent domain can be used to
compare properties. For example the default percentage domain has a value range of 0-100 but it is not strict. Other numeric domains maybe freely
compared to this one as the parent domain ( the generic numeric domain) will accept all values.

Returns
the parent domain; it may be invalid
virtual void Ilwis::Domain::range ( Range rng)
pure virtual

sets a new range on this domain, for requirements on the parameter and ensures on the function see the relevant subclass

Parameters
rngthe new range

Implemented in Ilwis::ItemDomain< D >, Ilwis::CoordinateDomain, Ilwis::TextDomain, Ilwis::NumericDomain, and Ilwis::ColorDomain.

void Domain::setParent ( const IDomain dm)
virtual

sets the parent domain of the domain. This maybe an invalid domain when no parent is set. The child domain specializes (ad/or adds)
some properties of the parent domain to create a more limited behavior. When not strict the parent domain can be used to
compare properties. For example the default percentage domain has a value range of 0-100 but it is not strict. Other numeric domains maybe freely
compared to this one as the parent domain ( the generic numeric domain) will accept all values.

Parameters
dmsets the parent domain; it may be set to invalid

Reimplemented in Ilwis::ItemDomain< D >, Ilwis::NumericDomain, and Ilwis::TextDomain.

void Ilwis::Domain::setStrict ( bool  yesno)

sets the strict status of the domain. When a domain is set to strict it will only compare domain properties
to domain types that are identical to itself. Parent domain properties are ignored. For example if a operation only accepts
a strict numeric domain min1to1, it will refuse a generic numeric domain as that may contain other (possible illegal) values.

Parameters
thenew state

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