11#include <QExplicitlySharedDataPointer>
18#include "GisGeometry.h"
19#include "PvlFlatMap.h"
65 void setName(
const QString &identity);
68 bool exists(
const QString &keywordName)
const;
69 int count(
const QString &keywordName)
const;
70 bool isNull(
const QString &keywordName,
const int keywordIndex = 0)
const;
73 QString
value(
const QString &keywordName,
const int &keywordIndex = 0)
const;
74 QString
value(
const QString &keywordName,
const QString &defValue,
75 const int &keywordIndex = 0)
const;
78 void add(
const QString &keywordName,
const QString &keywordValue);
81 void append(
const QString &keywordName,
const QString &keywordValue);
83 int erase(
const QString &keywordName);
97 bool hasAsset(
const QString &assetName)
const;
98 void addAsset(
const QString &assetName, QVariant &assetValue);
99 QVariant
asset(
const QString &assetName)
const;
105 const bool &withAssets=
false)
const;
107 virtual PvlObject toPvl(
const QString &pvlName =
"Resource")
const;
159 QExplicitlySharedDataPointer<ResourceData>
m_data;
Encapsulation class provides support for GEOS-C API.
Contains more than one keyword-value pair.
Provides a flat map of PvlKeywords.
A single keyword-value pair.
Contains Pvl Groups and Pvl Objects.
Shared Resource data pointer.
VariantList m_assets
The list of assets associated with this Resource.
QString m_name
Name of the Resource.
SharedGisGeometry m_geom
A shared pointer to the GIS geometry object associated with this Resource.
PvlFlatMap m_keys
The list of keywords associated with this Resource.
This class provides a resource of PVL keywords for Strategy classes.
int erase(const QString &keywordName)
Removes all of the PVL keywords in this Resource that are associated with the given name.
bool hasAsset(const QString &assetName) const
This method is used to determine whether an asset with the given name is in this Resource.
void addAsset(const QString &assetName, QVariant &assetValue)
Inserts an asset with the given name and value into this Resource's VariantList.
bool isDiscarded() const
Accessor method to determine whether this Resource is to be discarded.
int removeAsset(const QString &assetName)
Removes all of the assets in this Resource that are mapped to the given name.
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.
int clearAssets()
Clears the assets from this Resource's VariantList.
SharedGisGeometry geometry() const
Accessor method for this Resource's GIS geometry.
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.
bool exists(const QString &keywordName) const
Determines whether a PVL keyword with the given name is in this Resource.
QMap< QString, QVariant > VariantList
Defintion for VariantList, a map between a string and a variant type variable.
bool m_discard
A flag to indicate whether the Resource is inactive.
void activate()
Activate a resource.
const PvlFlatMap & keys() const
Accessor method for the PVL keywords associated with this Resource.
bool isActive() const
Accessor method to determine whether this Resource is to be discarded.
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.
virtual Resource * copy() const
Copy this resource for distinct management of its status.
Resource()
Default constructor for a Resource object.
QString name() const
Accessor for a string containing the Resource's name.
QVariant asset(const QString &assetName) const
Retrieves the value of the asset in this Resource that is mapped to the given name.
QExplicitlySharedDataPointer< ResourceData > m_data
Explicitly managed pointer to Resource data.
virtual ~Resource()
Destroys the Resource object.
bool hasValidGeometry() const
This method is used to determine whether a valid GIS geometry has been set for this Resource.
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.
void add(const QString &keywordName, const QString &keywordValue)
Adds a PVL keyword with the given name and value to this Resource.
PvlKeyword keyword(const QString &keywordName) const
Gets the PvlKeyword object with the given name, if it exists in this Resource.
void append(const QString &keywordName, const QString &keywordValue)
Appends the given value to the PVL keyword with the given name.
bool isEqual(const Resource &other) const
Checks for equality of another Resource.
virtual Resource * clone(const QString &name, const bool &withAssets=false) const
Clone this resource for additional specialized use.
virtual PvlObject toPvl(const QString &pvlName="Resource") const
Transfer all keywords in map to a PvlObject.
void discard()
Discard a resource.
This is free and unencumbered software released into the public domain.
QList< SharedResource > ResourceList
Defintion of a ResourceList, a list of SharedResource types.
QSharedPointer< Resource > SharedResource
Defintion of a SharedResource, a shared pointer to a Resource object.