Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
A class that is the baseclass for all Geospatial data classes and their directly supporting classes. More...
#include <ilwisobject.h>
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 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 | |
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 | |
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::mutex | _mutex |
std::mutex | _loadforstore |
Friends | |
class | IlwisObjectFactory |
void | addFactory (IlwisObjectFactory *) |
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:
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
IlwisObject::IlwisObject | ( | ) |
Standard constructor for an ilwisobject
IlwisObject::IlwisObject | ( | const Resource & | source | ) |
|
static |
addTypeFunction
??
|
virtual |
Sets the changed flag, needs to be set when something within this object gets changed
yesno | the 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.
url | the 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 |
format | the format identifying the source/target format. The name of the format is registered (plus namespace) by the connector plugin that realizes this format |
fnamespace | an additional identifier for selecting the correct connector. format names maybe identical from different connectors. The combination namespace-format is unique accross the system |
cmode | the mode of the connector to be created |
|
static |
Creates a new IlwisObject from the given Resource will fail if the resource is somehow invalid
source | the Resource |
|
static |
findType
??
source |
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
rec | the databaserecord (QSqlRecord) |
|
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
|
pure virtual |
Gives the IlwisTypes of this object
Implemented in Ilwis::ItemDomain< D >, Ilwis::FeatureCoverage, Ilwis::DatabaseTable, Ilwis::Catalog, Ilwis::FlatTable, Ilwis::NumericDomain, Ilwis::CoordinateDomain, Ilwis::GeoReference, Ilwis::BaseTable, Ilwis::RasterCoverage, Ilwis::OperationMetaData, Ilwis::TextDomain, Ilwis::Projection, Ilwis::Ellipsoid, Ilwis::ConventionalCoordinateSystem, and Ilwis::ColorDomain.
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
|
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.
obj | an ilwisobject to be compared with |
Reimplemented in Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.
|
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.
|
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
Reimplemented in Ilwis::ItemDomain< D >, Ilwis::BaseTable, Ilwis::Catalog, Ilwis::FlatTable, Ilwis::GeoReference, Ilwis::DatabaseTable, Ilwis::Projection, Ilwis::ConventionalCoordinateSystem, and Ilwis::Ellipsoid.
|
virtual |
Tries to merge 2 IlwisObjects together, template function does not work for standard IlwisObject, see the correspondending subclass for details
obj | the object this should merge with |
options | merging options |
Reimplemented in Ilwis::BaseTable.
QDateTime IlwisObject::modifiedTime | ( | ) | const |
returns the moment when the object was last modified
|
static |
converts a string with a name into a IlwisTypes if the name is invalid it will return itUNKOWN
name | a string with the name of an IlwisTypes |
|
virtual |
tries to Prepares this ilwisobject for use
Reimplemented in Ilwis::Coverage, Ilwis::FeatureCoverage, Ilwis::BaseTable, Ilwis::Catalog, Ilwis::FlatTable, Ilwis::DatabaseTable, Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.
|
virtual |
prepare
??
def |
Reimplemented in Ilwis::Projection, and Ilwis::ConventionalCoordinateSystem.
|
virtual |
Changes the code of this IlwisObject, can only happen when this object is not readonly, and the identity is not null
cd | the new code |
Reimplemented from Ilwis::Identity.
|
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).
connector | the connector to be used |
input | defines the nature of the connector. |
void IlwisObject::setCreateTime | ( | const Time & | time | ) |
Changes the create time of this object
time |
void IlwisObject::setModifiedTime | ( | const Time & | time | ) |
sets the last modified time of the object
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
nm | the new name |
|
virtual |
Changes the readonly state of this object. in order to do this it will both change the connectors readonly state and the objects
yesno | the new readonly state |
|
virtual |
source the location of the source that represents the physical read origin of this object
Reimplemented in Ilwis::Coverage, and Ilwis::RasterCoverage.
|
virtual |
target the location of the source that represents the physical write target of this object
|
virtual |
translates the defintion of an object to a string representation
|
static |
creates a String with the name of the given IlwisTypes will return undefined if the given IlwisTypes is invalid
the | IlwisTypes in need of naming |