FDO API Reference Feature Data Objects

DictionaryElement.h

Go to the documentation of this file.
00001 #ifndef FDO_DICTIONARY_ELEMENT_H
00002 #define FDO_DICTIONARY_ELEMENT_H
00003 // 
00004 
00005 //
00006 // Copyright (C) 2004-2006  Autodesk, Inc.
00007 // 
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of version 2.1 of the GNU Lesser
00010 // General Public License as published by the Free Software Foundation.
00011 // 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 //
00021 
00022 #include <Common/Disposable.h>
00023 
00024 /// \brief
00025 /// FdoDictionaryElement is an element in a FdoDictionary. It consists of a
00026 /// name-value pair.
00027 class FdoDictionaryElement : public FdoDisposable
00028 {
00029 
00030 public:
00031 
00032     /// \brief
00033     /// Constructs and initializes a a FdoDictionaryElement
00034     /// 
00035     /// \param name 
00036     /// Input the name of the element (required)
00037     /// \param name 
00038     /// Input the value of the element. Can be blank (L"")
00039     /// 
00040     /// \return
00041     /// Returns FdoDictionaryElement
00042     /// 
00043     FDO_API_COMMON static FdoDictionaryElement* Create(FdoString* name, FdoString* value);
00044 
00045     /// \brief
00046     /// Gets the name of this element
00047     /// 
00048     /// \return
00049     /// Returns the element name
00050     /// 
00051     FDO_API_COMMON virtual FdoString* GetName();
00052 
00053     /// \brief
00054     /// Indicates that this object does not allow its name
00055     /// to change. Not allowing name change allows more efficient 
00056     /// random access to FdoDictionary.
00057     /// 
00058     /// \return
00059     /// Returns false
00060     /// 
00061     FDO_API_COMMON virtual FdoBoolean CanSetName()
00062     {
00063         return false;
00064     }
00065 
00066     /// \brief
00067     /// Gets the value of this dictionary element.
00068     /// 
00069     /// \return
00070     /// Returns the element value
00071     /// 
00072     FDO_API_COMMON virtual FdoString* GetValue();
00073 
00074     /// \brief
00075     /// Sets the value of this dictionary element
00076     /// 
00077     /// \param value 
00078     /// Input the element value
00079     /// 
00080     FDO_API_COMMON virtual void SetValue(FdoString* value);
00081 
00082 protected:
00083 /// \cond DOXYGEN-IGNORE
00084     /// Constructs a default instance of a FdoDictionaryElement.
00085     FDO_API_COMMON FdoDictionaryElement()
00086     {
00087     }
00088 
00089     /// Constructs an instance of a FdoDictionaryElement using the specified arguments.
00090     FDO_API_COMMON FdoDictionaryElement(FdoString* name, FdoString* value);
00091 
00092     FDO_API_COMMON virtual ~FdoDictionaryElement() {}
00093 /// \endcond
00094 
00095 private:
00096 
00097     /// The name of the dictionary element. 
00098     FdoStringP                        mName;
00099 
00100     /// The element value
00101     FdoStringP                        mValue;
00102 };
00103 
00104 /// \brief
00105 /// FdoDictionaryElementP is a FdoPtr on FdoDictionaryElement, provided for convenience.
00106 typedef FdoPtr<FdoDictionaryElement> FdoDictionaryElementP;
00107 
00108 #endif
00109 
00110 

Comments or suggestions? Send us feedback.