Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <itemdomain.h>
Public Member Functions | |
ItemDomain () | |
ItemDomain (const Resource &resource) | |
ItemDomain (Range *rng) | |
Domain::Containement | contains (const QVariant &val) const |
bool | isCompatibleWith (const IDomain &dom) const |
QVariant | impliedValue (const QVariant &v) const |
SPDomainItem | item (quint32 index) const |
SPDomainItem | item (const QString &nam) const |
void | addItem (DomainItem *thing) |
void | removeItem (const QString &nme) |
void | range (Range *rng) |
void | setRange (const ItemRange &range) |
quint32 | count () const |
QString | theme () const |
void | setTheme (const QString &theme) |
void | setParent (const IDomain &dm) |
IlwisTypes | ilwisType () const |
IlwisTypes | valueType () const |
ItemIterator< D > | begin () const |
ItemIterator< D > | end () const |
bool | isValid () const |
![]() | |
Domain () | |
Domain (const Resource &resource) | |
bool | isStrict () const |
void | setStrict (bool yesno) |
IDomain | parent () const |
template<typename T = Range> | |
QSharedPointer< T > | range2range () const |
![]() | |
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 | 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 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) |
Protected Member Functions | |
SPRange | getRange () const |
![]() | |
void | addChildDomain (quint64 idchild) |
bool | removeChildDomain (quint64 idchild) |
![]() | |
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) |
Friends | |
template<typename T > | |
class | ItemIterator |
Additional Inherited Members | |
![]() | |
enum | Containement { cSELF =1, cPARENT =2, cDECLARED =3, cNONE =0 } |
![]() | |
static IlwisTypes | ilwType (const QVariant &v) |
static IlwisTypes | ilwType (const QString &impliedValue) |
![]() | |
std::map< quint64, quint32 > | _childDomains |
An item domain is a domain that contains discrete items (duh). The items determine the value type of the domain. Item domains with different value types are not compatible. We have the following value (and thus Item) types
The differences between the first three are rather subtle. They are all just labels. First of all, identifiers have no attached meaning. They are labels, they identify something. As such, a street sign has no attached meaning apart from the fact that it marks a location. From the name itself you don’t get extra information. The difference between named and indexed easier. Named are unique names (in the domain), indexed are prefixes plus a number. Thematic items are also labels but they have meaning. Their name implies the value they represent. As such, these items may have metadata associated with them further defining the item. The difference is quite subtle but it has effects. For example, because a thematic item has meaning it makes sense to have a standard (UI) presentation for it. This makes no sense for an identifier item as the name implies nothing. Numeric items are ordered items that have numeric sub-ranges. For example 0-100,100-200,300-400. Time Interval Items are ordered sets of time intervals. For example 20090301-20090311, 20090312-20090322,20090323-20090402. They are very similar to numerical items . Item domains have a property called “theme”. In a way this is a poor man’s parent domain. In cases where it is not feasible or practical to define a whole parent domain (e.g. insufficient knowledge) one can make item domains compatible by giving them the same theme. At a string based representation level of the items they become comparable but not on the programmatic level below that (see later). What is meant by this? All items in an item domain have a string representation(name). If item domains have the same theme you may assume that names in the domain are pointing to things of the same type/identity. But always remember that this is a shallow equality. The domains don’t have knowledge of each other, their internal representation is different. Only parent domains enforce that also the internal representation is equal. All child domains have by definition have the same theme.
|
inline |
Creates an empty ItemDomain of type D
|
inline |
Creates an itemdomain from a Resource
resource | The resource to be used by this ItemDomain |
|
inline |
Adds an item of the templated type to the range. If no range is yet defined, one will be created
the | item to be added. Note that ownership of the item is transferred to the range. no delete allowed |
|
inline |
Create an ItemIterator over this domain This ItemIterators current position is at the start
|
inlinevirtual |
Checks if the value is contained in either this domain or the parentdomain.
val | The value to be checked |
Implements Ilwis::Domain.
|
inline |
Query for the amount of items in the ItemRange of this ItemDomain
|
inline |
Create an ItemIterator over this domain This ItemIterators current position is at the end
|
inlinevirtual |
Gives the IlwisTypes of this object
Implements Ilwis::IlwisObject.
|
inlinevirtual |
returns a string representation of the item pointed to by the index
0 | based index, if the index is invalid sUNDEF will be returned |
Reimplemented from Ilwis::Domain.
|
inlinevirtual |
Checks if this itemdomain is compatible with another domain, will not be compatible if the other domain is:
dom | the domain to be tested |
Implements Ilwis::Domain.
|
inlinevirtual |
Check if this is a valid domain A ItemDomain is valid when the range is not null
Reimplemented from Ilwis::IlwisObject.
|
inline |
returns a pointer to the domain item pointed to by the index
0 | based index, if the index is invalid 0 will be returned |
|
inline |
returns a pointer to the item that is identified by the string name
a | name that must be in the range of the domain. If not a 0 pointer will be returned |
|
inlinevirtual |
Tries to set a new range on this ItemDomain Will fail if the range doesnt fit
rng | the new range |
Implements Ilwis::Domain.
|
inline |
removes an item from the range
the | item to be removed |
|
inlinevirtual |
Changes the parent IDomain of this ItemDomain. If the new IDomain is invalid and this ItemDomain has a parent, the parent will be removed and a raw ItemDomain remains If the new domain does not meet the requirements but is valid nothing will happen
dm | The new Domain |
Reimplemented from Ilwis::Domain.
|
inline |
Sets a new range on this ItemDomain, if the excisting range / parent range / child range contain the new range
range | The new ItemRange |
|
inline |
Changes the Theme of this ItemDomain
theme | The new Theme of this Itemdomain |
|
inline |
Query for the theme of this ItemDomain