|
Isis 3 Programmer Reference
|
10 #include <QSharedPointer>
14 #include <boost/foreach.hpp>
17 #include "IException.h"
18 #include "PvlContainer.h"
19 #include "PvlFlatMap.h"
20 #include "PvlKeyword.h"
21 #include "PvlObject.h"
69 m_discard( other.m_discard ) {
83 m_discard( other.m_discard ) {
84 if ( deepcopy ) {
m_data.detach(); }
115 return (
m_data->m_name );
125 m_data->m_name = identity;
126 add(
"Identity", identity);
143 return (
name().toLower() == other.
name().toLower() );
156 return (
m_data->m_keys.exists(keywordName) );
170 return (
m_data->m_keys.count(keywordName) );
188 return (
m_data->m_keys.isNull(keywordName, index) );
199 return (
m_data->m_keys );
225 return (
m_data->m_keys.get(keywordName, index) );
252 const int &index)
const {
253 QString keywordValue(defaultValue);
254 if ( !
isNull(keywordName, index) ) {
255 keywordValue =
value(keywordName, index);
257 return (keywordValue);
271 if (
m_data->m_keys.exists(keywordName) ) {
272 return (
m_data->m_keys.keyword(keywordName) );
286 void Resource::add(
const QString &keywordName,
const QString &keywordValue) {
287 m_data->m_keys.add(keywordName, keywordValue);
328 m_data->m_keys.append(keywordName, keywordValue);
342 return (
m_data->m_keys.erase(keywordName) );
379 return ( !
m_data->m_geom.isNull() );
391 return ( !
m_data->m_geom->isEmpty() );
404 return (
m_data->m_geom );
453 return (
m_data->m_assets.contains(assetName.toLower()) );
464 m_data->m_assets.insert(assetName.toLower(), assetValue);
478 return (
m_data->m_assets.remove(assetName.toLower()) );
488 int n =
m_data->m_assets.size();
507 "Requested asset " + assetName +
" does not exist.",
510 return (
m_data->m_assets.value(assetName.toLower()) );
569 while ( key !=
m_data->m_keys.end() ) {
570 object.addKeyword(key.value());
bool m_discard
A flag to indicate whether the Resource is inactive.
void activate()
Activate a resource.
bool isActive() const
Accessor method to determine whether this Resource is to be discarded.
const PvlFlatMap & keys() const
Accessor method for the PVL keywords associated with this Resource.
void addAsset(const QString &assetName, QVariant &assetValue)
Inserts an asset with the given name and value into this Resource's VariantList.
Contains Pvl Groups and Pvl Objects.
bool exists(const QString &keywordName) const
Determines whether a PVL keyword with the given name is in this Resource.
A single keyword-value pair.
QExplicitlySharedDataPointer< ResourceData > m_data
Explicitly managed pointer to Resource data.
void discard()
Discard a resource.
Provides a flat map of PvlKeywords.
int count(const QString &keywordName) const
Counts the number of values the PVL keyword with the given name has, if it exists in this Resource.
QMap< QString, PvlKeyword >::const_iterator ConstPvlFlatMapIterator
A const iterator for the underling QMap that PvlFlatMap is built on.
virtual Resource * clone(const QString &name, const bool &withAssets=false) const
Clone this resource for additional specialized use.
bool isDiscarded() const
Accessor method to determine whether this Resource is to be discarded.
QString value(const QString &keywordName, const int &keywordIndex=0) const
Gets the value of the PVL keyword with the given name at the given index.
virtual ~Resource()
Destroys the Resource object.
bool hasGeometry() const
This method is used to determine whether the GIS geometry has been set for this Resource.
void setName(const QString &identity)
A mutator to set the Resource's name.
bool isEqual(const Resource &other) const
Checks for equality of another Resource.
int removeAsset(const QString &assetName)
Removes all of the assets in this Resource that are mapped to the given name.
Encapsulation class provides support for GEOS-C API.
int clearAssets()
Clears the assets from this Resource's VariantList.
QString name() const
Accessor for a string containing the Resource's name.
void add(const QString &keywordName, const QString &keywordValue)
Adds a PVL keyword with the given name and value to this Resource.
QVariant asset(const QString &assetName) const
Retrieves the value of the asset in this Resource that is mapped to the given name.
Resource()
Default constructor for a Resource object.
QSharedPointer< GisGeometry > SharedGisGeometry
Definition for a SharedGisGeometry, a shared pointer to a GisGeometry.
Shared Resource data pointer.
This class provides a resource of PVL keywords for Strategy classes.
PvlKeyword keyword(const QString &keywordName) const
Gets the PvlKeyword object with the given name, if it exists in this Resource.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Namespace for the standard library.
void append(const QString &keywordName, const QString &keywordValue)
Appends the given value to the PVL keyword with the given name.
int erase(const QString &keywordName)
Removes all of the PVL keywords in this Resource that are associated with the given name.
Contains more than one keyword-value pair.
bool hasAsset(const QString &assetName) const
This method is used to determine whether an asset with the given name is in this Resource.
SharedGisGeometry geometry() const
Accessor method for this Resource's GIS geometry.
bool isNull(const QString &keywordName, const int keywordIndex=0) const
Determines whether the PVL keyword with the given name at the given index is null.
virtual Resource * copy() const
Copy this resource for distinct management of its status.
This is free and unencumbered software released into the public domain.
virtual PvlObject toPvl(const QString &pvlName="Resource") const
Transfer all keywords in map to a PvlObject.
bool hasValidGeometry() const
This method is used to determine whether a valid GIS geometry has been set for this Resource.