FDO .NET API Reference Feature Data Objects

mgDictionary.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  Autodesk, Inc.
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016 *
00017 */
00018 
00019 #pragma once
00020 
00021 #include <Runtime\Disposable.h>
00022 
00023 class FdoDictionary;
00024 
00025 BEGIN_NAMESPACE_OSGEO_COMMON
00026 public __gc class DictionaryElement;
00027 
00028 /// \ingroup (OSGeoFDOCommon)
00029 /// \brief
00030 /// DictionaryElementCollection is a collection of DictionaryElement objects(name-value pairs).
00031 [System::Reflection::DefaultMemberAttribute("RealTypeItem")]
00032 public __sealed __gc class DictionaryElementCollection : 
00033     public NAMESPACE_OSGEO_RUNTIME::Disposable, public System::Collections::IList
00034 {
00035 /// \cond DOXYGEN-IGNORE
00036 private:
00037     /// \brief
00038     ///     A Nested class defined to provide enumeration of Dictionary elements
00039     ///
00040     ///     Enumerators can be used to read the data in the collection, 
00041     ///     but they cannot be used to modify the underlying collection.
00042     ///
00043     ///     An enumerator remains valid as long as the collection remains unchanged. 
00044     ///     If changes are made to the collection, such as adding, modifying, or deleting 
00045     ///     elements, the enumerator is irrecoverably invalidated and the next call to 
00046     ///     MoveNext or Reset throws an InvalidOperationException. If the collection is 
00047     ///     modified between MoveNext and Current, Current returns the element that it is 
00048     ///     set to, even if the enumerator is already invalidated.
00049     ///
00050     ///     The enumerator does not have exclusive access to the collection; therefore, 
00051     ///     enumerating through a collection is intrinsically not a thread-safe procedure. 
00052     ///     Even when a collection is synchronized, other threads can still modify the 
00053     ///     collection, which causes the enumerator to throw an exception. To guarantee 
00054     ///     thread safety during enumeration, you can either lock the collection during 
00055     ///     the entire enumeration or catch the exceptions resulting from changes made 
00056     ///     by other threads.
00057     /// 
00058     __gc class Enumerator : public System::Collections::IEnumerator 
00059     {
00060     private:
00061         DictionaryElementCollection* m_pCol;
00062         System::Int32 m_nIdx;
00063 
00064     public:
00065         /// \brief
00066         ///     Constructs a new dictionary Enumerator
00067         /// 
00068         /// \param elements 
00069         ///     Input The Dictionary collection to enumerate.
00070         /// 
00071         Enumerator(DictionaryElementCollection* elements) : m_pCol(elements), m_nIdx(-1) 
00072         {
00073         }
00074 
00075         /// \brief
00076         ///     Retrieves the current dictionay element at the enumerator location
00077         /// 
00078         /// \return
00079         ///     Retuns the current dictionary element referenced by the enumerator
00080         /// 
00081         __property System::Object* get_Current();
00082         
00083         /// \brief
00084         ///     Initially, the enumerator is positioned before the first element in the collection. 
00085         ///     At this position, calling the Current property throws an exception. 
00086         ///     Therefore, you must call the MoveNext method to advance the enumerator 
00087         ///     to the first element of the collection before reading the value of Current.
00088         //      If MoveNext passes the end of the collection, the enumerator is positioned 
00089         ///     after the last element in the collection and MoveNext returns false. 
00090         ///     When the enumerator is at this position, subsequent calls to MoveNext also return false. 
00091         ///     If the last call to MoveNext returned false, calling Current throws an exception. 
00092         //      To set Current to the first element of the collection again, you can call Reset 
00093         ///     followed by MoveNext.
00094         /// 
00095         /// \return
00096         ///     Retuns true if the enumerator is able to move to a valid dictionary element
00097         ///     otherwise false.
00098         /// 
00099         System::Boolean MoveNext();
00100         
00101         /// \brief
00102         ///     Initially, the enumerator is positioned before the first element in the collection. 
00103         ///     The Reset method brings the enumerator back to this position. 
00104         /// 
00105         System::Void Reset();
00106     };
00107 
00108 public private:
00109     inline FdoDictionary* GetImpObj();
00110 
00111 private:
00112     // System::Collections::ICollection interface properties
00113     __property System::Object* System::Collections::ICollection::get_SyncRoot();
00114     __property System::Boolean System::Collections::ICollection::get_IsSynchronized();
00115 
00116     // System::Collections::ICollection interface methods
00117     System::Void System::Collections::ICollection::CopyTo(System::Array* array,System::Int32 index);
00118 
00119     // System::Collections::IList interface properties
00120     __property System::Boolean System::Collections::IList::get_IsFixedSize();
00121     __property System::Boolean System::Collections::IList::get_IsReadOnly();
00122     __property Object* System::Collections::IList::get_Item(System::Int32 index);
00123     __property System::Void  System::Collections::IList::set_Item(System::Int32 index, Object* value);
00124 
00125     // System::Collections::IList interface methods
00126     System::Int32 System::Collections::IList::Add(Object* value);
00127     System::Boolean System::Collections::IList::Contains(Object* value);
00128     System::Int32 System::Collections::IList::IndexOf(Object* value);
00129     System::Void System::Collections::IList::Insert(System::Int32 index, Object* value);
00130     System::Void System::Collections::IList::Remove(Object* value);
00131 
00132 /// \endcond
00133 
00134 public:
00135     /// \brief
00136     ///     Constructs a new empty dictionary element collection
00137     /// 
00138     DictionaryElementCollection();
00139 
00140     /// \brief
00141     ///     Constructs a dictionary object based on an unmanaged instance of the object
00142     /// 
00143     /// \param unmanaged 
00144     ///     Input A Pointer to the unmanaged collection.
00145     /// 
00146     /// \param autoDelete 
00147     ///     Input Indicates if the constructed object should be automatically deleted 
00148     ///     once it no longer referenced.
00149     /// 
00150     DictionaryElementCollection(System::IntPtr unmanaged, System::Boolean autoDelete);
00151 
00152     /// \brief
00153     ///    Gets the count of items in collection.
00154     /// 
00155     /// \return
00156     ///     Returns the number of items in the collection.
00157     /// 
00158     __property System::Int32 get_Count(System::Void);
00159 
00160     /// \brief
00161     ///    Gets an enumerator that can iterate through a collection.
00162     /// 
00163     /// \return
00164     ///     Returns an enumerator on the dictionary.
00165     /// 
00166     __sealed System::Collections::IEnumerator* GetEnumerator(System::Void);
00167 
00168     /// \brief
00169     ///     Removes the index-th DictionaryElement from this collection.
00170     /// 
00171     /// \param index 
00172     ///     Input index of the element to remove.
00173     /// 
00174     System::Void RemoveAt(System::Int32 index);
00175 
00176     /// \brief
00177     ///     Removes all elements from the collection.
00178     /// 
00179     System::Void  Clear();
00180 
00181     /// \brief
00182     ///     Adds a DictionaryElement object into the collection.
00183     /// 
00184     /// \param value 
00185     ///     Input the DictionaryElement object to add.
00186     /// 
00187     /// \return
00188     ///     Returns the position into which the new element was inserted.
00189     /// 
00190     System::Int32 Add(DictionaryElement* value);
00191 
00192     /// \brief
00193     ///     Determines the index of a specific DictionaryElement object.
00194     /// 
00195     /// \param value 
00196     ///     Input the DictionaryElement object to locate in the collection.
00197     /// 
00198     /// \return
00199     ///     The index of value if found in the collection; otherwise, -1.
00200     /// 
00201     System::Int32 IndexOf(DictionaryElement* value);
00202     
00203     /// \brief
00204     ///     Determines the index of a specific DictionaryElement object.
00205     /// 
00206     /// \param name 
00207     ///     Input the name of the DictionaryElement object to locate in the collection.
00208     /// 
00209     /// \return
00210     ///     The index of value if found in the collection; otherwise, -1.
00211     /// 
00212     System::Int32 IndexOf(String* name);
00213 
00214     /// \brief
00215     ///     Inserts a DictionaryElement object into the collection at the specified position.
00216     /// 
00217     /// \param index 
00218     ///     Input the zero-based index at which value should be inserted.
00219     ///
00220     /// \param value 
00221     ///     Input the DictionaryElement object to insert.
00222     /// 
00223     System::Void Insert(System::Int32 index, DictionaryElement* value);
00224 
00225     /// \brief
00226     ///     Removes the first occurrence of a specific DictionaryElement object.
00227     /// 
00228     /// \param value 
00229     ///     Input the DictionaryElement object to remove from the collection.
00230     /// 
00231     System::Void Remove(DictionaryElement* value);
00232 
00233     /// \brief
00234     ///     Determines whether the collection contains a specific DictionaryElement object.
00235     /// 
00236     /// \param value 
00237     ///     Input The DictionaryElement object to find in the collection.
00238     /// 
00239     /// \return
00240     ///     Returns true if the value is found in the collection; otherwise, false.
00241     /// 
00242     System::Boolean Contains(DictionaryElement* value);
00243 
00244     /// \brief
00245     ///     Determines whether the collection contains a specific DictionaryElement object.
00246     /// 
00247     /// \param name 
00248     ///     Input The name of the DictionaryElement object to find in the collection.
00249     /// 
00250     /// \return
00251     ///     Returns true if the value is found in the collection; otherwise, false.
00252     /// 
00253     System::Boolean Contains(String* name);
00254 
00255     /// \brief
00256     ///     Copies the elements of the collection to an array.
00257     /// 
00258     /// \param array 
00259     ///     Output the one-dimensional Array that is the destination of the elements copied from this collection.
00260     ///
00261     /// \param index 
00262     ///     Input an integer that represents the index in array at which copying begins.
00263     /// 
00264     System::Void CopyTo(DictionaryElement* array[],System::Int32 index);
00265 
00266     /// \brief
00267     ///     Gets a DictionaryElement in the collection.
00268     /// 
00269     /// \param index 
00270     ///     Input index of the DictionaryElement to retrieve.
00271     /// 
00272     /// \return
00273     ///     Returns the requested dictionary element.
00274     /// 
00275     __property DictionaryElement* get_RealTypeItem(System::Int32 index);
00276 
00277     /// \brief
00278     ///     Gets a named DictionaryElement in the collection.
00279     /// 
00280     /// \param index 
00281     ///     Input name of the DictionaryElement to retrieve.
00282     /// 
00283     /// \return
00284     ///     Returns the requested dictionary element.
00285     /// 
00286     __property DictionaryElement* get_RealTypeItem(System::String* index);
00287 
00288     /// \brief
00289     ///     Sets a DictionaryElement in the collection.
00290     /// 
00291     /// \param index 
00292     ///     Input The index of the DictionaryElement to set.
00293     /// 
00294     /// \param value
00295     ///     The dictionary element to set at the specified index
00296     /// 
00297     __property System::Void  set_RealTypeItem(System::Int32 index, DictionaryElement* value);
00298 
00299     /// \brief
00300     ///     Gets a DictionaryElement in the collection.
00301     /// 
00302     /// \param index 
00303     ///     Input index of the DictionaryElement to retrieve.
00304     /// 
00305     /// \return
00306     ///     Returns the requested dictionary element.
00307     /// 
00308     __property DictionaryElement* get_Item(System::Int32 index);
00309 
00310     /// \brief
00311     ///     Sets a DictionaryElement in the collection.
00312     /// 
00313     /// \param index 
00314     ///     Input The index of the DictionaryElement to set.
00315     /// 
00316     /// \param value
00317     ///     The dictionary element to set at the specified index
00318     /// 
00319     __property System::Void  set_Item(System::Int32 index, DictionaryElement* value);
00320 
00321 /// \cond DOXYGEN-IGNORE
00322 protected:
00323     System::Void ReleaseUnmanagedObject();
00324 /// \endcond
00325 };
00326 
00327 END_NAMESPACE_OSGEO_COMMON
00328 
00329 

Comments or suggestions? Send us feedback.