15 template <
typename FirstType,
typename SecondType>
48 virtual void setFirst(
const FirstType& f);
54 virtual void setSecond(
const SecondType& s);
74 namespace DtBufferSerialize
78 template <
typename FirstType,
typename SecondType>
84 template <
typename FirstType,
typename SecondType>
91 template <
typename FirstType,
typename SecondType>
96 template <
typename KeyType,
typename ValType>
101 typedef typename std::map<KeyType, ValType>::iterator
iterator;
151 virtual void setFromMap(
const std::map<KeyType, ValType> sourceMap);
157 virtual const std::map<KeyType, ValType>&
convertToMap()
const;
180 std::pair<iterator, bool>
insert(
const KeyType& key,
const ValType& val);
235 DtString(ValType::theXmlType()) +
"-map");
236 return xmlType.c_str();
266 namespace DtBufferSerialize
270 template <
typename KeyType,
typename ValType>
276 template <
typename KeyType,
typename ValType>
283 template <
typename KeyType,
typename ValType>
287 #include "vrfutil/rwTemplatedMap.inl"
DtRwTemplatedPair & operator=(const DtRwTemplatedPair &orig)
Assignment.
virtual void setSecondName(const DtString &n)
The RW name of the second item in this pair.
Definition: rwTemplatedMap.h:65
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
void erase(iterator pos)
Removes an existing item from the map.
Definition: rwTemplatedMap.h:185
virtual const SecondType & second() const
Accessor for second.
Definition: rwTemplatedMap.h:51
virtual const DtString & valueName() const
The RW name of the values in this map.
Definition: rwTemplatedMap.h:228
virtual void setSecond(const SecondType &s)
Mutator for second.
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
virtual void setFirstName(const DtString &n)
The RW name of the first item in this pair.
Definition: rwTemplatedMap.h:59
virtual void setKeyName(const DtString &keyName)
The RW name of the keys in this map.
Definition: rwTemplatedMap.h:217
static const char * theXmlType()
Definition: rwTemplatedMap.h:232
virtual void setFirst(const FirstType &f)
Mutator for first.
std::map< KeyType, ValType >::iterator iterator
Definition: rwTemplatedMap.h:101
std::map< KeyType, ValType > myMap
Definition: rwTemplatedMap.h:256
A Readable, Writable version of DtList. This class cannot be used directly, but must be inherited to ...
Definition: rwList.h:26
virtual const_iterator end() const
Returns an iterator to the element following the last element in the map.
Definition: rwTemplatedMap.h:174
virtual void postGetSelf()
After getting self, update internal map to match our RwList.
std::pair< iterator, bool > insert(const RwPairType &item)
Insert a new item into the map.
static const char * ListReaderWriterType()
virtual iterator end()
Returns an iterator to the element following the last element in the map.
Definition: rwTemplatedMap.h:173
virtual DtString prettyPrint() const
Routine to return a human readable form of the reader/writer variable. Not all reader/writer classes ...
virtual const_iterator lower_bound(const KeyType &key) const
Finds the first element that is not less than the key.
Definition: rwTemplatedMap.h:198
DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
This method must be overridden by a subclass. Within this method, new instances of the DtReaderWriter...
Definition: readerWriter.h:85
DtString myXmlType
Definition: rwTemplatedMap.h:254
virtual void clear()
Clears all elements from the map.
Definition: rwTemplatedMap.h:160
virtual iterator find(const KeyType &key)
Finds the element with the key equivalent to the key.
Definition: rwTemplatedMap.h:191
Definition: readerWriterRegistry.h:39
const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwTemplatedMap.h:239
DtString myElementName
The name to write out for each element. By default this is "item" but, when reading this from a file...
Definition: rwTemplatedMap.h:260
virtual void prePutSelf()
Before putting self, update RwList to match our internal map.
Definition: rwTemplatedMap.h:16
virtual iterator begin()
Returns an iterator to the first element in the map.
Definition: rwTemplatedMap.h:167
virtual void setValueName(const DtString &valName)
The RW name of the values in this map.
Definition: rwTemplatedMap.h:229
virtual void removeAndDeleteAll()
Removes and deletes all entries in the rwlist.
bool operator==(const DtRwTemplatedPair &) const
Equality.
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
virtual void swap(DtRwTemplatedMapPtr &other)
Swaps the contents of this map with the other map.
Definition: rwTemplatedMap.h:97
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
virtual const DtString & keyName() const
The RW name of the keys in this map.
Definition: rwTemplatedMap.h:216
virtual ~DtRwTemplatedPair()
Destructor.
Definition: rwTemplatedMap.h:36
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
virtual const_iterator upper_bound(const KeyType &key) const
Finds the first element that is greater than the key.
Definition: rwTemplatedMap.h:204
bool operator==(const DtRwTemplatedMapPtr &) const
Equivalence operators.
void erase(const KeyType &key)
Removes an existing item from the map.
Definition: rwTemplatedMap.h:186
DtRwTemplatedMapPtr()
default constructor
DtString myKeyName
Definition: rwTemplatedMap.h:262
virtual void setFromMap(const std::map< KeyType, ValType > sourceMap)
Clears the contents of this map, and sets new contents from the values in the std::map.
virtual DtString firstName() const
The RW name of the first item in this pair.
Definition: rwTemplatedMap.h:58
FirstType myFirst
Definition: rwTemplatedMap.h:70
virtual const DtString & elementName() const
Accessor/mutator for myElementName.
Definition: rwTemplatedMap.h:222
virtual const FirstType & first() const
Accessor for first.
Definition: rwTemplatedMap.h:45
DtRwTemplatedMapPtr & operator=(const DtRwTemplatedMapPtr &orig)
Assignment operator.
virtual const_iterator find(const KeyType &key) const
Finds the element with the key equivalent to the key.
Definition: rwTemplatedMap.h:192
virtual iterator upper_bound(const KeyType &key)
Finds the first element that is greater than the key.
Definition: rwTemplatedMap.h:203
virtual const_iterator begin() const
Returns an iterator to the first element in the map.
Definition: rwTemplatedMap.h:168
virtual const std::map< KeyType, ValType > & convertToMap() const
The current contents of this map as a std::map.
SecondType mySecond
Definition: rwTemplatedMap.h:71
virtual unsigned size() const
Returns the size of the map.
Definition: rwTemplatedMap.h:163
DtRwTemplatedPair< KeyType, ValType > RwPairType
Definition: rwTemplatedMap.h:100
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
DtRwTemplatedPair()
Constructors.
std::map< KeyType, ValType >::const_iterator const_iterator
Definition: rwTemplatedMap.h:102
virtual ~DtRwTemplatedMapPtr()
Destructor.
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual DtString secondName() const
The RW name of the second item in this pair.
Definition: rwTemplatedMap.h:64
virtual iterator lower_bound(const KeyType &key)
Finds the first element that is not less than the key.
Definition: rwTemplatedMap.h:197
bool operator!=(const DtRwTemplatedMapPtr &) const
Equivalence operators.
virtual void setElementName(const DtString &e)
Accessor/mutator for myElementName.
Definition: rwTemplatedMap.h:223
DtString myValueName
Definition: rwTemplatedMap.h:263