FDO API Reference | Feature Data Objects |
00001 #ifndef _UNIQUECONSTRAINT_H_ 00002 #define _UNIQUECONSTRAINT_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 #ifdef _WIN32 00023 #pragma once 00024 #endif 00025 00026 #include <FdoStd.h> 00027 #include <Fdo/Schema/DataPropertyDefinitionCollection.h> 00028 00029 /// \brief 00030 /// FdoUniqueConstraint can be used to specify that a property or list of properties taken together 00031 /// have unique values for all objects of that class in a datastore. A unique constraint that is based on a list 00032 /// of two or more properties is called a composite unique constraint. 00033 /// This constraint type applies to all data property types except for Boolean, BLOB, and CLOB. A Boolean property 00034 /// can be included if it is part of a composite unique constraint. 00035 class FdoUniqueConstraint : public FdoIDisposable 00036 { 00037 00038 protected: 00039 /// Constructs a default instance of a FdoUniqueConstraint. 00040 FdoUniqueConstraint(); 00041 00042 virtual ~FdoUniqueConstraint(); 00043 00044 virtual void Dispose() 00045 { 00046 delete this; 00047 } 00048 public: 00049 00050 /// \brief 00051 /// Constructs an empty instance of an FdoUniqueConstraint. 00052 /// 00053 /// \return 00054 /// Returns an FdoUniqueConstraint. 00055 /// 00056 FDO_API static FdoUniqueConstraint* Create( ); 00057 00058 /// \brief 00059 /// Returns the list of properties that define the unique constraint. The caller can modify the list by adding or removing properties 00060 /// 00061 /// \return 00062 /// Returns the collection that holds the properties that defines the constraint. 00063 /// 00064 FDO_API FdoDataPropertyDefinitionCollection* GetProperties(); 00065 00066 private: 00067 00068 FdoDataPropertyDefinitionCollection* m_properties; 00069 }; 00070 00071 /// \ingroup (typedefs) 00072 /// \brief 00073 /// FdoUniqueConstraintP is a FdoPtr on FdoUniqueConstraint, provided for convenience. 00074 typedef FdoPtr<FdoUniqueConstraint> FdoUniqueConstraintP; 00075 00076 #endif 00077 00078
Comments or suggestions? Send us feedback. |