FDO API Reference Feature Data Objects

PropertyValueConstraintList.h

Go to the documentation of this file.
00001 #ifndef _PROPERTYVALUECONSTRAINTLIST_H_
00002 #define _PROPERTYVALUECONSTRAINTLIST_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/PropertyValueConstraint.h>
00027 #include <Fdo/Expression/DataValueCollection.h>
00028 
00029 /// \brief
00030 /// FdoPropertyValueConstraintList is used to specify a list of allowed values for a particular property. 
00031 /// It can be used for all data property types except for Boolean, BLOB, or CLOB.
00032 /// This constraint is represented by a list of values of the same type as the corresponding data property. 
00033 /// The list cannot be empty. The list could be a single value. While that may not seem very useful it could serve as a 
00034 /// temporary way to enforce a single value for a property, e.g. for a particular customer, Parcel.State is always 'CA' 
00035 /// In this case, the definer of the property definition probably should also set the default value to be the same, unless it can be null.
00036 /// The list does not need to be ordered. However, a provider may choose to reorder the list so the list that is returned when 
00037 /// a user gets the definition of this constraint for a property may be different than the order that was given when defined.
00038 /// E.g. defined as (12, 8, 24), but returned as (8, 12, 24). If the list has duplicate values, the provider may choose to eliminate 
00039 /// duplicates from the list.
00040 /// If the data property definition allows nulls, a null value is considered as being valid regardless of this list of valid values. 
00041 /// The list of valid values should not include the null value itself, but leave the specification of whether null is allowed to 
00042 /// the null value constraint. If the data property definition includes a non-null default value, then that value should be one 
00043 /// of the values in the list.
00044 /// If both a valid values list constraint and a unique constraint on the same property are included, then the side effect is that 
00045 /// there will be an upper limit of the number of objects of that class that have non-null values for the property.
00046 class FdoPropertyValueConstraintList : public FdoPropertyValueConstraint
00047 {
00048 protected:
00049     /// Constructs a default instance of a FdoPropertyValueConstraintList.
00050     FdoPropertyValueConstraintList();
00051 
00052     virtual ~FdoPropertyValueConstraintList();
00053 
00054     virtual void Dispose()
00055     {
00056         delete this;
00057     }
00058 public:
00059     
00060     /// \brief
00061     /// Constructs an empty instance of an FdoPropertyValueConstraintList.
00062     /// 
00063     /// \return
00064     /// Returns an FdoPropertyValueConstraintList
00065     /// 
00066     FDO_API static FdoPropertyValueConstraintList* Create( );
00067 
00068     /// \brief
00069     /// Returns the list of allowed values for a particular property.
00070     /// 
00071     /// \return
00072     /// Returns na instance of FdoDataValueCollection.
00073     /// 
00074     FDO_API FdoDataValueCollection* GetConstraintList();
00075 
00076     /// \brief
00077     /// Returns FdoPropertyValueConstraintType_Range type.
00078     /// 
00079     /// \return
00080     /// Returns the constraint type
00081     /// 
00082     FDO_API virtual FdoPropertyValueConstraintType GetConstraintType();
00083 
00084 
00085 private:
00086     FdoDataValueCollection* m_constraintList;
00087 
00088 };
00089 #endif
00090 
00091 

Comments or suggestions? Send us feedback.