Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Member Functions | Friends | List of all members
Ilwis::MasterCatalog Class Reference

#include <mastercatalog.h>

Public Member Functions

 MasterCatalog ()
 
bool prepare ()
 
bool addContainer (const QUrl &location)
 
bool addItems (const std::vector< Ilwis::Resource > &items)
 
bool removeItems (const QList< Resource > &items)
 
quint64 url2id (const QUrl &url, IlwisTypes tp) const
 
Resource name2Resource (const QString &name, IlwisTypes tp=itUNKNOWN) const
 
Resource id2Resource (quint64 iid) const
 
quint64 name2id (const QString &name, IlwisTypes tp=itUNKNOWN) const
 
IlwisTypes id2type (quint64 id) const
 
quint64 createId () const
 
void registerObject (ESPIlwisObject &data)
 
bool isRegistered (quint64 id) const
 
bool unregister (quint64)
 
std::vector< Resourceselect (const QUrl &resource, const QString &selection) const
 
QUrl name2url (const QString &name, IlwisTypes tp=itUNKNOWN) const
 
ESPIlwisObject get (const QUrl &resource, IlwisTypes type) const
 
ESPIlwisObject get (quint64 id) const
 
bool contains (const QUrl &url, IlwisTypes type) const
 
bool usesContainers (const QUrl &scheme) const
 
void addContainerException (const QString &scheme)
 

Friends

KERNELSHARED_EXPORT MasterCatalogmastercatalog ()
 

Detailed Description

Master catalog holds references to all discovered data files, operations and to all instantiated ilwis objects The master catalog is basically a database and all information about resources that ilwis can handle can be found in this database. The fields in the database are a reflection of the fields in the resource class and the variable set of properties each resource can have. Main function of the mastercatalog is

Constructor & Destructor Documentation

MasterCatalog::MasterCatalog ( )

Constructs a new MasterCatalog

Member Function Documentation

bool MasterCatalog::addContainer ( const QUrl &  location)

Adds a container with Resources to the MasterCatalog (think about a folder)

Parameters
locationthe url to the container
Returns
true if the adding of the container was succesfull
bool MasterCatalog::addItems ( const std::vector< Ilwis::Resource > &  items)

Adds a list of Resources to the MasterCatalog

Parameters
itemsthe Resources that should be added
Returns
true when succesful
bool MasterCatalog::contains ( const QUrl &  url,
IlwisTypes  type 
) const

Checks whether a certain url + IlwisType combination is in the MasterCatalog

Parameters
urlthe url
typethe ilwistype
Returns
true when the combination is in the MasterCatalog
quint64 Ilwis::MasterCatalog::createId ( ) const

Generates a new unique id, which is not yet used by any resource

Returns
an new id
ESPIlwisObject MasterCatalog::get ( const QUrl &  resource,
IlwisTypes  type 
) const

Retrieves an ilwisobject from the MasterCatalog based on the url en the ilwisttype

Parameters
resourcethe url to the resource that should be gotten
typethe type of the resource
Returns
an ESPIlwisObject based on the url
ESPIlwisObject MasterCatalog::get ( quint64  id) const

Retrieve an item from the mastercatalog with its id

Parameters
idthe id of the required item
Returns
an ESPIlwisObject with the correct id
Resource MasterCatalog::id2Resource ( quint64  iid) const

Translates an id that is in the MasterCatalog to correct Resource

Parameters
iidthe id that has to be translated,must be in the MasterCatalog
Returns
The Resource of the given id
IlwisTypes MasterCatalog::id2type ( quint64  id) const

Translates an id from the MasterCatalog to the correct IlwisType

Parameters
idthe id that needs translation
Returns
the IlwisType of the given id
bool MasterCatalog::isRegistered ( quint64  id) const

Checks whether a certain id is registered with an Resource in the MasterCatalog

Parameters
idthe id that should be checked
Returns
true when the given id is in use
quint64 MasterCatalog::name2id ( const QString &  name,
IlwisTypes  tp = itUNKNOWN 
) const

Translates a name that is in the MasterCatalog to the corret id

this look up might fail, even though the conditions are met

Parameters
namethe name that has to be translated, must be in the MasterCatalog
tpthe IlwisType that belongs to the name, defaults to itUNKOWN
Returns
The id of the given name
Resource MasterCatalog::name2Resource ( const QString &  name,
IlwisTypes  tp = itUNKNOWN 
) const

Translates a name that is in the MasterCatalog to the corret Resource

this look up might fail, even though the conditions are met

Parameters
namethe name that has to be translated, must be in the MasterCatalog
tpthe IlwisType that belongs to the name, defaults to itUNKOWN
Returns
The Resource of the given name
QUrl MasterCatalog::name2url ( const QString &  name,
IlwisTypes  tp = itUNKNOWN 
) const

Translates a name from the MasterCatalog to the correct url

this look up might fail, even though the conditions are met

Parameters
namethe name that has to be translated, must be in the MasterCatalog
tptp the IlwisType that belongs to the name, defaults to itUNKOWN
Returns
the url of the given name
bool MasterCatalog::prepare ( )

prepares the mastercatalog for use by loading all the settings

Returns
true when succesful
void MasterCatalog::registerObject ( ESPIlwisObject &  data)

Registers an new object in the MasterCatalog

Parameters
datathe data that forms the new object
bool MasterCatalog::removeItems ( const QList< Resource > &  items)

Removes a list of Resources from the MasterCatalog

Parameters
itemsThe Resources that should be removed from the MasterCatalog
Returns
true if succesful
std::vector< Resource > MasterCatalog::select ( const QUrl &  resource,
const QString &  selection 
) const

Selects multiple records from the MasterCatalog selection language not yet finished

Parameters
resource
selection
Returns
a list of the selected resources
bool MasterCatalog::unregister ( quint64  id)

unregisters the given id and removes the related object from the MasterCatalog

Returns
true when succesful
quint64 MasterCatalog::url2id ( const QUrl &  url,
IlwisTypes  tp 
) const

Translates an url that is in the MasterCatalog to the correct id

Parameters
urlthe url that has to be translated, must be in the MasterCatalog
tpthe ilwisType that belongs to the url
Returns
the id of the given url

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