File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
17 #include "IException.h"
19 #include <gsl/gsl_math.h>
88 return (gsl_fcmp(v1, v2, -1.0
E-6) < 0);
192 const T &
copy(
const T &src)
const {
238 template <
typename P>
414 template <
typename K,
typename T,
415 template <
class>
class ComparePolicy = SimpleCompare,
416 template <
class>
class RemovalPolicy = NoopRemoval,
417 template <
class>
class CopyPolicy = DefaultCopy
475 for(cItr = cmap.
_list.begin() ; cItr != cmap.
_list.end() ; cItr++) {
476 _list.insert(std::make_pair(cItr->first, cmap.
copy(cItr->second)));
500 for(cItr = cmap.
_list.begin() ; cItr != cmap.
_list.end() ; cItr++) {
501 _list.insert(std::make_pair(cItr->first, cmap.
copy(cItr->second)));
513 return (
_list.size());
542 _list.insert(std::make_pair(
key, value));
553 return (cItr !=
_list.end());
569 if(cItr ==
_list.end()) {
570 QString mess =
"Requested value does not exist!";
573 return (cItr->second);
585 if(cItr ==
_list.end()) {
586 QString mess =
"Requested value does not exist!";
589 return (cItr->second);
606 if(cItr ==
_list.end()) {
610 return (std::distance(
_list.begin(), cItr));
627 for(cItr =
_list.begin(), i = 0 ; cItr !=
_list.end() ; ++cItr, i++) {
631 if(cItr ==
_list.end()) {
632 std::ostringstream mess;
633 mess <<
"Requested index (" << nth <<
") out of range" << std::endl;
636 return (cItr->second);
652 for(cItr =
_list.begin(), i = 0 ; cItr !=
_list.end() ; ++cItr, i++) {
655 if(cItr ==
_list.end()) {
656 std::ostringstream mess;
657 mess <<
"Requested index (" << nth <<
") out of range" << std::endl;
660 return (cItr->second);
673 const K &
key(
int nth)
const {
676 for(cItr =
_list.begin(), i = 0 ; cItr !=
_list.end() ; ++cItr, i++) {
679 if(cItr ==
_list.end()) {
680 std::ostringstream mess;
681 mess <<
"Requested key index (" << nth <<
") out of range" << std::endl;
684 return (cItr->first);
696 if(Itr1 ==
_list.end())
return (0);
699 while(Itr1 != Itr2) {
712 return _list.begin();
730 return _list.begin();
756 for(itr =
_list.begin() ; itr !=
_list.end() ; itr++) {
T copy(const T &src) const
Allocate new object using copy construtor and new pointer.
CollectorIter begin()
Returns the start of the list for iterating purposes.
CollectorConstIter begin() const
Const iterator into list.
Provides a simple comparison between two values.
int index(const K &key) const
Returns the index of the first occuring element in the list.
Provides a case insensitive string comparison.
IString DownCase()
Converts all upper case letters in the object IString into lower case characters.
@ DuplicateKeys
Allow duplication of keys.
T & getNth(int nth)
Returns the nth value in the collection.
(Default) Policy for copying map elements
CollectorMap()
Constructor.
T & get(const K &key)
Returns the value associated with the name provided.
int size() const
Returns the size of the collection.
void destroy(T *element)
Destroys the CollectorMap entry.
int remove(const K &key)
Removes and entry from the list.
CollectorList::iterator CollectorIter
CollectorList iterator type declaration.
CollectorList::const_iterator CollectorConstIter
CollectorList constant iterator type declaration.
int count(const K &key) const
Returns the number of keys found in the list.
P * allocate(const P &obj) const
Allocate new object using copy constructor.
virtual ~CollectorMap()
Destructor handles removal of the elements within the collection.
bool operator()(const K &v1, const K &v2) const
Compares v1 and v2 as floating point values.
const T & get(const K &key) const
Const version returning the value associated with the given name.
const T & copy(const T &src) const
Returns a copy of the input.
CollectorMap(const CollectorMap &cmap)
Copy constructor invokes the copy policy as provided by the users.
bool operator()(const K &v1, const K &v2) const
Returns true if v1 is less than v2.
std::multimap< K, CollectorType, ComparePolicy< K > > CollectorList
A multimap attacking a key to a CollectorType and a ComparePolicy<CollectorType>
bool exists(const K &key) const
Checks the existance of a particular key in the list.
const K & key(int nth) const
Returns the nth key in the collection.
const T & getNth(int nth) const
Returns the nth value in the collection.
bool operator()(const K &v1, const K &v2) const
Compares v1 and v2 as case insensitive strings, and returns true of v1 is less than v2 (as those stri...
KeyPolicy _keyPolicy
Unique or duplicate key constraint.
@ UniqueKeys
Constrain keys to be unique.
KeyPolicy
Enumerated selection of key behaviour.
CollectorList _list
The list.
T CollectorType
Data type.
void destroy(T *element)
Destroys the CollectorMap pointer's CollectorMap.
CollectorConstIter end() const
Const iterator to end of list.
Policy for deleting arrays that CollectorMap owns.
void add(const K &key, const T &value)
Adds the element to the list.
@ Programmer
This error is for when a programmer made an API call that was illegal.
CollectorIter end()
Returns the end of the list.
Collector/container for arbitrary items.
void selfDestruct()
Thourough destruction of list.
CollectorMap & operator=(const CollectorMap &cmap)
Assignment operator for the CollectorMap class object.
const double E
Sets some basic constants for use in ISIS programming.
void destroy(T *element)
Destroys the array of CollectorMaps.
Supplies a NOOP default for removal of a CollectorMap entry.
CollectorMap(const KeyPolicy &keyPolicy)
Allows the user to choose if keys can be duplicated.
Pointer to object policy for copying map elements.
Supplies a policy for deleting pointers that CollectorMap owns.
This is free and unencumbered software released into the public domain.
Provides a robust comparison of double/float values.