Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Core/PlanServer/Includes/PslDomainImpl.hh

Go to the documentation of this file.
00001 // -*- Mode: C++ -*-
00002 //      CVS: $Id: PslDomainImpl.hh,v 1.6 2005/11/08 18:32:41 rijsman Exp $
00003 //      Tag: $name$
00004 //     Info: $CVSROOT/IDEA-DEV/COPYRIGHT
00005 #ifndef PLANSERVER_DOMAIN_IMPL_HEADER_
00006 #define PLANSERVER_DOMAIN_IMPL_HEADER_
00007 
00008 #include "Utilities.hh"
00009 #include "PslDataTypes.hh"
00010 #include "PslErrors.hh"
00011 
00012 namespace IDEA
00013 {
00014   class PslDatabase;
00015   class PslDomain;
00016   class PslLabelSet;
00017   class PslObject;
00018   class PslObjectClass;
00019 
00027   class PslDomainImpl
00028   {
00029   public:
00033     PslDomainImpl( const PslDataType& type, const std::string& name );
00037     PslDomainImpl( int lower, int upper, const std::string& name );
00041     PslDomainImpl( const std::set<int>& values, const std::string& name );
00045     PslDomainImpl( bool v, const std::string& name );
00049     PslDomainImpl( double lower, double upper, const std::string& name );
00053     PslDomainImpl( std::set<double> values, const std::string& name );
00057     PslDomainImpl( const PslLabelSet* values, const std::string& name );
00061     PslDomainImpl( const PslObjectClass* values, const std::string& name );
00065     virtual ~PslDomainImpl();
00069     const std::string& getName() const;
00073     template<class Type>
00074     Type getMaximum() const
00075     {
00076       PSL_ERROR( PslTypeUnknown );
00077     }
00081     template<class Type>
00082     std::set< Type > getMembers() const
00083     {
00084       PSL_ERROR( PslTypeUnknown );
00085     }
00089     template<class Type>
00090     Type getMinimum() const
00091     {
00092       PSL_ERROR( PslTypeUnknown );
00093     }
00097     template<class Type>
00098     Type getSingleton() const
00099     {
00100       PSL_ERROR( PslTypeUnknown );
00101     }
00105     const PslDataType& getDataType() const;
00109     bool isBoolean() const;
00113     bool isString() const;
00117     bool isEmpty() const;
00121     bool isEnumerated() const;
00125     bool isInteger() const;
00129     bool isNumeric() const;
00133     bool isLabel() const;
00137     bool isObject() const;
00141     bool isReal() const;
00145     bool isSingleton() const;
00149     void print( std::ostream& os ) const;
00150   private:
00154     virtual std::set<int>  getIntMembers() const;
00158     virtual int getIntMaximum() const;
00162     virtual int getIntMinimum() const;
00166     virtual std::set<bool> getBoolMembers() const;
00170     virtual bool getBoolMaximum() const;
00174     virtual bool getBoolMinimum() const;
00178     virtual std::set<double> getRealMembers() const;
00182     virtual double getRealMaximum() const;
00186     virtual double getRealMinimum() const;
00190     virtual std::set<std::string> getLabelMembers() const;
00191 
00192     std::string m_Name;
00193     bool m_Enumerated;
00194     bool m_Numeric;
00195     PslDataType m_DataType;
00196 
00197     union PossibleTypes
00198     {
00199       int u_integer;
00200       bool u_boolean;
00201       double u_real;
00202     };
00203     
00204     typedef std::list< PossibleTypes > PossibleTypesList;
00205 
00206     const PslLabelSet* m_LabelSet;
00207     const PslObjectClass* m_ObjectClass;
00208 
00209     PossibleTypesList m_Values;
00210   };
00211 
00215   template<> std::set<int> PslDomainImpl::getMembers() const;
00219   template<> int PslDomainImpl::getMinimum() const;
00223   template<> int PslDomainImpl::getMaximum() const;
00227   template<> int PslDomainImpl::getSingleton() const;
00231   template<> bool PslDomainImpl::getMinimum() const;
00235   template<> bool PslDomainImpl::getMaximum() const;
00239   template<> bool PslDomainImpl::getSingleton() const;
00243   template<> double PslDomainImpl::getMinimum() const;
00247   template<> double PslDomainImpl::getMaximum() const;
00251   template<> double PslDomainImpl::getSingleton() const;
00255   template<> const PslLabelSet* PslDomainImpl::getSingleton() const;
00259   template<> const PslObjectClass* PslDomainImpl::getSingleton() const;
00263   template<> std::set<std::string> PslDomainImpl::getMembers() const;
00267   template<> std::set<PslObject*> PslDomainImpl::getMembers() const;
00268 }
00269 
00270 #endif // PLANSERVER_DOMAIN_IMPL_HEADER_

Contact information
© IDEA
Generated on Fri Feb 3 17:09:41 2006 for IDEA.