Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <domain.h>
Public Types | |
enum | Containement { cSELF =1, cPARENT =2, cDECLARED =3, cNONE =0 } |
![]() | |
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 |
![]() | |
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) |
Static Public Member Functions | |
static IlwisTypes | ilwType (const QVariant &v) |
static IlwisTypes | ilwType (const QString &impliedValue) |
![]() | |
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) |
Protected Member Functions | |
void | addChildDomain (quint64 idchild) |
bool | removeChildDomain (quint64 idchild) |
virtual QSharedPointer< Range > | getRange () const =0 |
![]() | |
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) |
Protected Attributes | |
std::map< quint64, quint32 > | _childDomains |
![]() | |
std::mutex | _mutex |
std::mutex | _loadforstore |
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.
Enumerates the possible containment cases: cSELF,cPARENT,cDECLARED and cNONE
Domain::Domain | ( | ) |
Creates an empty new strict Domain
Domain::Domain | ( | const Resource & | resource | ) |
|
pure virtual |
Checks if this Domain contains a certain value
value | the value to check |
Implemented in Ilwis::ItemDomain< D >, Ilwis::NumericDomain, Ilwis::CoordinateDomain, Ilwis::TextDomain, and Ilwis::ColorDomain.
|
static |
translates the type of a variant to a compatible ilwis type
recognises:
the | variant to be translated |
|
static |
Translates a String to a compatible ilwis type
recognises:
value | the string to be translated |
|
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.
|
pure virtual |
Checks if the Domain is compatible with another domain
See the relevant subclass for more info
dom | another domain |
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.
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.
|
pure virtual |
sets a new range on this domain, for requirements on the parameter and ensures on the function see the relevant subclass
rng | the new range |
Implemented in Ilwis::ItemDomain< D >, Ilwis::CoordinateDomain, Ilwis::TextDomain, Ilwis::NumericDomain, and Ilwis::ColorDomain.
|
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.
dm | sets 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.
the | new state |