FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoNamedCollection< OBJ, EXC > Class Template Reference

#include <NamedCollection.h>

Inherits FdoCollection< OBJ, EXC >< OBJ, EXC >.

Inheritance diagram for FdoNamedCollection< OBJ, EXC >:

[legend]
List of all members.

Detailed Description

template<class OBJ, class EXC>
class FdoNamedCollection< OBJ, EXC >

FdoNamedCollection is a template for collections keyed by element name. The OBJ class must provide a GetName() function that returns the element name as a FdoString* and a CanSetName() function that returns true if the class allows modification of the name (implements SetName()) and false if it does not. This class also provides fast access by name for large collections. When CanSetName() returns true, the access by name is a bit less efficient since linear searches need to be done in some cases. The reason for this is that after an object changes name, it is no longer in the right position in this collection's name map.

Definition at line 46 of file NamedCollection.h.


Public Member Functions

virtual FdoInt32 Add (OBJ *value)
 Adds the specified item to the end of the collection. Returns the index of the newly added item.
virtual void Clear ()
 Removes all items from the collection.
virtual bool Contains (FdoString *name) const
 Returns true if the collection contains the specified item, false otherwise.
virtual bool Contains (const OBJ *value) const
 Returns true if the collection contains the specified item, false otherwise.
virtual OBJ * FindItem (const wchar_t *name) const
 Finds the item in the collection with the specified name.
virtual OBJ * GetItem (const wchar_t *name) const
 Gets the item in the collection with the specified name. Throws an exception if the item is not found.
virtual OBJ * GetItem (FdoInt32 index) const
 Gets the item in the collection at the specified index. Throws an invalid argument exception if the index is out of range.
virtual FdoInt32 IndexOf (FdoString *name) const
 Returns the index of the specified item (by name) in the collection or -1 if the item does not exist.
virtual FdoInt32 IndexOf (const OBJ *value) const
 Returns the index of the specified item in the collection or -1 if the item does not exist.
virtual void Insert (FdoInt32 item, OBJ *value)
 Inserts the specified item at the specified index within the collection. Items following the insertion point are moved down to accommodate the new item. Throws an invalid argument exception if the specified index is out of range.
virtual void Remove (const OBJ *value)
 Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.
virtual void RemoveAt (FdoInt32 index)
 Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.
virtual void SetItem (FdoInt32 index, OBJ *value)
 Sets the item in the collection at the specified index to the specified value. Throws an invalid argument exception if the index is out of range.

Protected Member Functions

void CheckDuplicate (OBJ *item, FdoInt32 index)
int Compare (FdoString *str1, FdoString *str2) const
 DOXYGEN-IGNORE
 FdoNamedCollection (bool caseSensitive=true)
virtual ~FdoNamedCollection (void)

Constructor & Destructor Documentation

template<class OBJ, class EXC>
FdoNamedCollection< OBJ, EXC >::FdoNamedCollection bool  caseSensitive = true  )  [inline, protected]
 

Definition at line 376 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual FdoNamedCollection< OBJ, EXC >::~FdoNamedCollection void   )  [inline, protected, virtual]
 

Definition at line 382 of file NamedCollection.h.


Member Function Documentation

template<class OBJ, class EXC>
virtual FdoInt32 FdoNamedCollection< OBJ, EXC >::Add OBJ *  value  )  [inline, virtual]
 

Adds the specified item to the end of the collection. Returns the index of the newly added item.

Parameters:
value Input value
Returns:
Returns the index of the newly added item

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoDataPropertyDefinitionCollection, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 184 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::Add(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::Add().

template<class OBJ, class EXC>
void FdoNamedCollection< OBJ, EXC >::CheckDuplicate OBJ *  item,
FdoInt32  index
[inline, protected]
 

Definition at line 402 of file NamedCollection.h.

Referenced by FdoNamedCollection< ElementMap, FdoException >::Add(), FdoNamedCollection< ElementMap, FdoException >::Insert(), and FdoNamedCollection< ElementMap, FdoException >::SetItem().

template<class OBJ, class EXC>
virtual void FdoNamedCollection< OBJ, EXC >::Clear  )  [inline, virtual]
 

Removes all items from the collection.

Returns:
Returns nothing

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 229 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::_RejectChanges(), FdoSchemaCollection< FdoDataPropertyDefinition >::Clear(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::Clear().

template<class OBJ, class EXC>
int FdoNamedCollection< OBJ, EXC >::Compare FdoString str1,
FdoString str2
const [inline, protected]
 

DOXYGEN-IGNORE

Definition at line 389 of file NamedCollection.h.

Referenced by FdoNamedCollection< ElementMap, FdoException >::Contains(), FdoNamedCollection< ElementMap, FdoException >::FindItem(), and FdoNamedCollection< ElementMap, FdoException >::IndexOf().

template<class OBJ, class EXC>
virtual bool FdoNamedCollection< OBJ, EXC >::Contains FdoString name  )  const [inline, virtual]
 

Returns true if the collection contains the specified item, false otherwise.

Parameters:
name Input the item name
Returns:
Returns true if the collection contains the specified item, false otherwise

Definition at line 324 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual bool FdoNamedCollection< OBJ, EXC >::Contains const OBJ *  value  )  const [inline, virtual]
 

Returns true if the collection contains the specified item, false otherwise.

Parameters:
value Input value
Returns:
Returns true if the collection contains the specified item, false otherwise

Reimplemented from FdoCollection< OBJ, EXC >.

Definition at line 288 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual OBJ* FdoNamedCollection< OBJ, EXC >::FindItem const wchar_t *  name  )  const [inline, virtual]
 

Finds the item in the collection with the specified name.

Parameters:
name Input item name
Returns:
Returns the item in the collection with the specified name. Returns NULL if the item was not found.

Definition at line 96 of file NamedCollection.h.

Referenced by FdoNamedCollection< ElementMap, FdoException >::CheckDuplicate(), FdoNamedCollection< ElementMap, FdoException >::Contains(), and FdoNamedCollection< ElementMap, FdoException >::GetItem().

template<class OBJ, class EXC>
virtual OBJ* FdoNamedCollection< OBJ, EXC >::GetItem const wchar_t *  name  )  const [inline, virtual]
 

Gets the item in the collection with the specified name. Throws an exception if the item is not found.

Parameters:
name Input item name
Returns:
Returns the item in the collection with the specified name

Definition at line 72 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual OBJ* FdoNamedCollection< OBJ, EXC >::GetItem FdoInt32  index  )  const [inline, virtual]
 

Gets the item in the collection at the specified index. Throws an invalid argument exception if the index is out of range.

Parameters:
index Input index
Returns:
Returns the item in the collection at the specified index

Reimplemented from FdoCollection< OBJ, EXC >.

Definition at line 58 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::_AcceptChanges(), FdoSchemaCollection< FdoDataPropertyDefinition >::_BeginChangeProcessing(), FdoSchemaCollection< FdoDataPropertyDefinition >::_EndChangeProcessing(), FdoSchemaCollection< FdoDataPropertyDefinition >::_RejectChanges(), FdoSchemaCollection< FdoDataPropertyDefinition >::_StartChanges(), FdoNamedCollection< ElementMap, FdoException >::CheckDuplicate(), FdoSchemaCollection< FdoDataPropertyDefinition >::Clear(), FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::Clear(), FdoNamedCollection< ElementMap, FdoException >::Contains(), FdoNamedCollection< ElementMap, FdoException >::FindItem(), FdoNamedCollection< ElementMap, FdoException >::IndexOf(), FdoSchemaCollection< FdoDataPropertyDefinition >::RemoveAt(), FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::RemoveAt(), FdoSchemaCollection< FdoDataPropertyDefinition >::SetItem(), FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::SetItem(), FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::~FdoPhysicalElementMappingCollection(), and FdoSchemaCollection< FdoDataPropertyDefinition >::~FdoSchemaCollection().

template<class OBJ, class EXC>
virtual FdoInt32 FdoNamedCollection< OBJ, EXC >::IndexOf FdoString name  )  const [inline, virtual]
 

Returns the index of the specified item (by name) in the collection or -1 if the item does not exist.

Parameters:
name Input the item name
Returns:
Returns the index of the specified item in the collection or -1 if the item does not exist

Definition at line 357 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual FdoInt32 FdoNamedCollection< OBJ, EXC >::IndexOf const OBJ *  value  )  const [inline, virtual]
 

Returns the index of the specified item in the collection or -1 if the item does not exist.

Parameters:
value Input value
Returns:
Returns the index of the specified item in the collection or -1 if the item does not exist

Reimplemented from FdoCollection< OBJ, EXC >.

Definition at line 343 of file NamedCollection.h.

template<class OBJ, class EXC>
virtual void FdoNamedCollection< OBJ, EXC >::Insert FdoInt32  item,
OBJ *  value
[inline, virtual]
 

Inserts the specified item at the specified index within the collection. Items following the insertion point are moved down to accommodate the new item. Throws an invalid argument exception if the specified index is out of range.

Parameters:
item Input item
value Input value
Returns:
Returns nothing

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoDataPropertyDefinitionCollection, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 210 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::Insert(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::Insert().

template<class OBJ, class EXC>
virtual void FdoNamedCollection< OBJ, EXC >::Remove const OBJ *  value  )  [inline, virtual]
 

Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.

Parameters:
value Input value
Returns:
Returns nothing

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 250 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::Remove(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::Remove().

template<class OBJ, class EXC>
virtual void FdoNamedCollection< OBJ, EXC >::RemoveAt FdoInt32  index  )  [inline, virtual]
 

Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.

Parameters:
index Input index
Returns:
Returns nothing

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoPropertyDefinitionCollection, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 269 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::RemoveAt(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::RemoveAt().

template<class OBJ, class EXC>
virtual void FdoNamedCollection< OBJ, EXC >::SetItem FdoInt32  index,
OBJ *  value
[inline, virtual]
 

Sets the item in the collection at the specified index to the specified value. Throws an invalid argument exception if the index is out of range.

Parameters:
index Input index
value Input value
Returns:
Returns nothing

Reimplemented from FdoCollection< OBJ, EXC >.

Reimplemented in FdoPhysicalElementMappingCollection< OBJ >, FdoDataPropertyDefinitionCollection, FdoSchemaCollection< OBJ >, FdoPhysicalElementMappingCollection< FdoXmlClassMapping >, FdoPhysicalElementMappingCollection< FdoXmlElementMapping >, FdoSchemaCollection< FdoClassDefinition >, FdoSchemaCollection< FdoFeatureSchema >, FdoSchemaCollection< FdoFeatureClass >, FdoSchemaCollection< FdoPropertyDefinition >, and FdoSchemaCollection< FdoDataPropertyDefinition >.

Definition at line 159 of file NamedCollection.h.

Referenced by FdoSchemaCollection< FdoDataPropertyDefinition >::SetItem(), and FdoPhysicalElementMappingCollection< FdoXmlElementMapping >::SetItem().


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.