00001 #ifndef _PROPERTYVALUECONSTRAINT_H_ 00002 #define _PROPERTYVALUECONSTRAINT_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/PropertyValueConstraintType.h> 00027 #include <Fdo/Schema/SchemaException.h> 00028 00029 class FdoSchemaMergeContext; 00030 class FdoDataValue; 00031 00032 /// \brief 00033 /// FdoPropertyValueConstraint is an abstract class that derives from FdoIDisposable. 00034 /// FdoPropertyValueConstraint is the base class of FdoPropertyValueConstraintRange 00035 /// and FdoPropertyValueConstraintList. 00036 class FdoPropertyValueConstraint : public FdoIDisposable 00037 { 00038 00039 public: 00040 /// \brief 00041 /// Abstract operation that must be implemented by derived classes to return the constraint type. 00042 /// 00043 /// \return 00044 /// Returns the constraint type 00045 /// 00046 FDO_API virtual FdoPropertyValueConstraintType GetConstraintType() = 0; 00047 00048 /// \cond DOXYGEN-IGNORE 00049 // Public non-API functions for XML and Schema Merge support 00050 00051 // Update this value constraint from the given value constraint. 00052 virtual void Set( FdoPropertyValueConstraint* /*pConstraint*/, FdoString* /*parentName*/, FdoSchemaMergeContext* /*pContext*/ ) 00053 { 00054 } 00055 00056 // \brief 00057 // Compares this value constraint with another one. 00058 // 00059 // \param value 00060 // The Property Value constraint to compare with 00061 // 00062 // \return 00063 // Returns true if this Property Value Constraint is the same as pConstraint 00064 // (all members have the same values). 00065 virtual bool Equals( FdoPropertyValueConstraint* pConstraint ) = 0; 00066 00067 // \brief 00068 // Checks if a constraint domain is contained within another 00069 // 00070 // \param value 00071 // The Property Value constraint to compare with 00072 // 00073 // \return 00074 // Returns true if this constraint's domain is a superset of the domain 00075 // for pConstraint (all values that do not violate pConstraint also do not 00076 // violate this constraint). 00077 virtual bool Contains( FdoPropertyValueConstraint* pConstraint ) = 0; 00078 00079 // \brief 00080 // Checks if the given value violates this constraint. 00081 // 00082 // \param value 00083 // The Property Value 00084 // 00085 // \return 00086 // Returns true if value is ok (it does not violate this constraint). Always 00087 // returns true if the value is null. 00088 // Returns false if the value violates this constraint. 00089 virtual bool Contains( FdoDataValue* pValue ) = 0; 00090 /// \endcond 00091 }; 00092 00093 #endif 00094 00095