- Main Page
- Related Pages
- Modules
- Classes
- Files

# ObjectPropertyDefinition.h

Go to the documentation of this file.

    00001 #ifndef _OBJECTPROPERTYDEFINITION_H_
    00002 #define _OBJECTPROPERTYDEFINITION_H_
    00003
    00004 //
    00005 // Copyright (C) 2004-2006  Autodesk, Inc.
    00006 //
    00007 // This library is free software; you can redistribute it and/or
    00008 // modify it under the terms of version 2.1 of the GNU Lesser
    00009 // General Public License as published by the Free Software Foundation.
    00010 //
    00011 // This library is distributed in the hope that it will be useful,
    00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014 // Lesser General Public License for more details.
    00015 //
    00016 // You should have received a copy of the GNU Lesser General Public
    00017 // License along with this library; if not, write to the Free Software
    00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    00019 //
    00020
    00021 #ifdef _WIN32
    00022 #pragma once
    00023 #endif
    00024
    00025 #include <FdoStd.h>
    00026 #include <Fdo/Schema/PropertyDefinition.h>
    00027 #include <Fdo/Schema/ObjectType.h>
    00028 #include <Fdo/Schema/ClassDefinition.h>
    00029 #include <Fdo/Schema/PropertyType.h>
    00030 #include <Fdo/Schema/OrderType.h>
    00031 #include <Fdo/Schema/DataPropertyDefinition.h>
    00032
    00033 /// \brief
    00034 /// The FdoObjectPropertyDefinition class derives from FdoPropertyDefinition and represents
    00035 /// containment of an object or a collection of objects within another class.
    00036 /// The class of the contained object must already be defined in the feature
    00037 /// schema and cannot be abstract.
    00038 class FdoObjectPropertyDefinition : public FdoPropertyDefinition
    00039 {
    00040 protected:
    00041     /// Constructs a default instance of an FdoObjectPropertyDefinition.
    00042     FDO_API FdoObjectPropertyDefinition();
    00043
    00044     /// Constructs an instance of an FdoObjectPropertyDefinition using the specified
    00045     /// arguments.
    00046     FDO_API FdoObjectPropertyDefinition(FdoString* name, FdoString* description, bool system = false);
    00047
    00048 /// \cond DOXYGEN-IGNORE
    00049     virtual ~FdoObjectPropertyDefinition();
    00050
    00051     virtual void Dispose();
    00052 /// \endcond
    00053
    00054 public:
    00055     /// \brief
    00056     /// Constructs a default instance of an FdoObjectPropertyDefinition.
    00057     ///
    00058     /// \return
    00059     /// Returns FdoObjectPropertyDefinition
    00060     ///
    00061     FDO_API static FdoObjectPropertyDefinition* Create();
    00062
    00063     /// \brief
    00064     /// Constructs an instance of an FdoObjectPropertyDefinition using the specified
    00065     /// arguments.
    00066     ///
    00067     /// \param name
    00068     /// Input name
    00069     /// \param description
    00070     /// Input description
    00071     /// \param system
    00072     /// Input true if this is a system generated property, otherwise false.
    00073     /// \note
    00074     /// A client would never set system to true, only a provider.
    00075     ///
    00076     /// \return
    00077     /// Returns FdoObjectPropertyDefinition
    00078     ///
    00079     FDO_API static FdoObjectPropertyDefinition* Create(FdoString* name, FdoString* description, bool system = false);
    00080
    00081     /// \brief
    00082     /// Gets the concrete property type.
    00083     ///
    00084     /// \return
    00085     /// Returns the concrete property type
    00086     ///
    00087     FDO_API virtual FdoPropertyType GetPropertyType();
    00088
    00089     /// \brief
    00090     /// Gets a reference to the FdoClassDefinition that defines the type of this
    00091     /// property.
    00092     ///
    00093     /// \return
    00094     /// Returns class definition
    00095     ///
    00096     FDO_API FdoClassDefinition* GetClass();
    00097
    00098     /// \brief
    00099     /// Sets a reference to the FdoClassDefinition that defines the type of this
    00100     /// property.
    00101     ///
    00102     /// \param value
    00103     /// Input class definition
    00104     ///
    00105     /// \return
    00106     /// Returns nothing
    00107     ///
    00108     FDO_API void SetClass(FdoClassDefinition* value);
    00109
    00110     /// \brief
    00111     /// Gets a reference to an FdoDataPropertyDefinition to use for uniquely identifying
    00112     /// instances of the contained class within a single parent object instance.
    00113     /// This value is only used for the FdoObjectType_Collection and FdoObjectType_OrderedCollection object
    00114     /// property types. The FdoDataPropertyDefinition must belong to the FdoClassDefinition that
    00115     /// defines the type of this property.
    00116     ///
    00117     /// \return
    00118     /// Returns data property definition
    00119     ///
    00120     FDO_API FdoDataPropertyDefinition* GetIdentityProperty();
    00121
    00122     /// \brief
    00123     /// Sets a reference to an FdoDataPropertyDefinition to use for uniquely identifying
    00124     /// instances of the contained class within a single parent object instance.
    00125     /// This value is only used for the FdoObjectType_Collection and FdoObjectType_OrderedCollection object
    00126     /// property types. The FdoDataPropertyDefinition must belong to the FdoClassDefinition that
    00127     /// defines the type of this property.
    00128     ///
    00129     /// \param value
    00130     /// Input data property definition
    00131     ///
    00132     /// \return
    00133     /// Returns nothing
    00134     ///
    00135     FDO_API void SetIdentityProperty(FdoDataPropertyDefinition* value);
    00136
    00137     /// \brief
    00138     /// Gets the type of this object property (value, collection, or ordered
    00139     /// collection).
    00140     ///
    00141     /// \return
    00142     /// Returns the type of this object property
    00143     ///
    00144     FDO_API FdoObjectType GetObjectType();
    00145
    00146     /// \brief
    00147     /// Sets the type of this object property (value, collection, or ordered
    00148     /// collection).
    00149     ///
    00150     /// \param value
    00151     /// Input the type of this object property
    00152     ///
    00153     /// \return
    00154     /// Returns nothing
    00155     ///
    00156     FDO_API void SetObjectType(FdoObjectType value);
    00157
    00158     /// \brief
    00159     /// Gets the order type of this object property (ascending or descending).
    00160     /// This property is only applicable if the property type is set to
    00161     /// FdoObjectType_OrderedCollection.
    00162     ///
    00163     /// \return
    00164     /// Returns the order type
    00165     ///
    00166     FDO_API FdoOrderType GetOrderType();
    00167
    00168     /// \brief
    00169     /// Sets the order type of this object property (ascending or descending).
    00170     /// This property is only applicable if the property type is set to
    00171     /// FdoObjectType_OrderedCollection.
    00172     ///
    00173     /// \param value
    00174     /// Input the order type
    00175     ///
    00176     /// \return
    00177     /// Returns nothing
    00178     ///
    00179     FDO_API void SetOrderType(FdoOrderType value);
    00180
    00181 /// \cond DOXYGEN-IGNORE
    00182     // Public non-API functions for XML and Schema Merge support
    00183
    00184     // Update this property from the given property.
    00185     virtual void Set( FdoPropertyDefinition* pProperty, FdoSchemaMergeContext* pContext );
    00186
    00187     // Checks referenced elements.
    00188     // Adds errors to the given merge context if the object property class or any
    00189     // identity property are marked for delete.
    00190     virtual void CheckReferences( FdoSchemaMergeContext* pContext );
    00191
    00192     /// Initialize this property from its XML attributes
    00193     virtual void InitFromXml(FdoString* propertyTypeName, FdoSchemaXmlContext* pContext, FdoXmlAttributeCollection* attrs);
    00194
    00195     /// Serialize this property to XML.
    00196     virtual void _writeXml( FdoSchemaXmlContext* pContext );
    00197
    00198 private:
    00199     FdoClassDefinition*         m_class;
    00200     FdoObjectType               m_objectType;
    00201     FdoOrderType                m_orderType;
    00202     FdoDataPropertyDefinition*  m_identityProperty;
    00203
    00204 protected:
    00205     /// FdoFeatureSchema::RejectChanges() support
    00206     virtual void    _StartChanges();
    00207     virtual void    _BeginChangeProcessing();
    00208     virtual void    _AcceptChanges();
    00209     virtual void    _RejectChanges();
    00210     virtual void    _EndChangeProcessing();
    00211     FdoClassDefinition*         m_classCHANGED;
    00212     FdoObjectType               m_objectTypeCHANGED;
    00213     FdoOrderType                m_orderTypeCHANGED;
    00214     FdoDataPropertyDefinition*  m_identityPropertyCHANGED;
    00215 /// \endcond
    00216 };
    00217
    00218 /// \ingroup (typedefs)
    00219 /// \brief
    00220 /// FdoObjectPropertyP is a FdoPtr on FdoObjectPropertyDefinition, provided for convenience.
    00221 typedef FdoPtr<FdoObjectPropertyDefinition> FdoObjectPropertyP;
    00222
    00223
    00224 #endif
    00225
    00226

Please send us your comment about this page