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/Modules/PLASMA/PlanServer/Includes/PlasmaVariableImpl.hh

Go to the documentation of this file.
00001 // -*- Mode: C++ -*-
00002 //      CVS: $Id: PlasmaVariableImpl.hh,v 1.19 2005/12/30 22:42:29 rijsman Exp $
00003 //      Tag: $name$
00004 //     Info: $CVSROOT/IDEA-DEV/COPYRIGHT
00005 
00006 #ifndef PLASMA_VARIABLE_IMPL_HEADER_
00007 #define PLASMA_VARIABLE_IMPL_HEADER_
00008 
00009 #include "PslVariableImpl.hh"
00010 
00011 #include "PslDataTypes.hh"
00012 
00013 #include "Utilities.hh"
00014 
00015 #include <ConstrainedVariable.hh>
00016 
00017 namespace IDEA
00018 {
00019   class PslDatabase;
00020 
00028   class PlasmaVariableImpl:
00029     public PslVariableImpl
00030   {
00031   public:
00032     PlasmaVariableImpl( const PslDatabase* db, EUROPA::ConstrainedVariableId variableId );
00033     PlasmaVariableImpl( const PslDatabase* db, const StringSet& labels, const std::string& name );
00034     PlasmaVariableImpl( const PslDatabase* db, const std::set<PslObject*>& objects, const std::string& name );
00035     PlasmaVariableImpl( const PslDatabase* db, const std::set<PslTimeline*>& timelines, const std::string& name );
00036     PlasmaVariableImpl( const PslDatabase* db, int lb, int ub, const std::string& name );
00037     PlasmaVariableImpl( const PslDatabase* db, double lb, double ub, const std::string& name );
00041     PlasmaVariableImpl( const PslDatabase* db, const PslDataType& type, const std::string& name );
00042 
00043     ~PlasmaVariableImpl();
00044 
00045     void commit();
00046 
00047     const std::string getName() const;
00048 
00049     bool hasIntersection( const PslVariable* variable ) const;
00050 
00051     EUROPA::ConstrainedVariableId getVariableId() const;
00055 //     void print( std::ostream& ) const;
00059     const PslDataType getDataType() const;
00063     bool isInterval() const;
00067     bool isEmpty();
00071     bool isDynamic();
00075     bool isSingleton() const;
00079     bool isEnumerated() const;
00083     bool isFinite();
00087     int getSize();
00088     
00089     int getKey() const;
00090 
00091     std::set<int> getIntMembers() const;
00092     std::set<double> getRealMembers() const;
00093     std::set<bool> getBoolMembers() const;
00094     std::set<std::string> getLabelMembers() const;
00095     std::set<std::string> getStringMembers() const;
00096     std::set<const PslObject*> getObjectMembers() const;
00097 
00098     void makeEmpty();
00099     void reset();
00100     void setStatic();
00101 
00102     const PslConstraintImpl* constrainToInt( int value, int authority);
00103     const PslConstraintImpl* constrainToReal( double value, int authority);
00104     const PslConstraintImpl* constrainToBool( bool value, int authority);
00105     const PslConstraintImpl* constrainToLabel( const std::string& value, int authority);
00106     const PslConstraintImpl* constrainToObject( const PslObject* value, int authority);
00107     const PslConstraintImpl* constrainToTimeline( const PslTimeline* value, int authority);
00108 
00109     const PslConstraintImpl* constrainToIntInterval( int min, int max, int authority);
00110     const PslConstraintImpl* constrainToRealInterval( double min, double max, int authority);
00111 
00112     void intersect(const PslVariable* other);
00113     void insertString( const std::string& value );
00114 
00115     int getIntSingleton() const;
00116     double getRealSingleton() const;
00117     bool getBoolSingleton() const;
00118     int getIntMinimum() const;
00119     double getRealMinimum() const;
00120     bool getBoolMinimum() const;
00121     int getIntMaximum() const;
00122     double getRealMaximum() const;
00123     bool getBoolMaximum() const;
00124     const PslObject* getObjectSingleton() const;
00125     const PslTimeline* getTimelineSingleton() const;
00126     const std::string& getLabelSingleton() const;
00127 
00128     bool hasIntMember(int) const;
00129     bool hasRealMember(double) const;
00130     bool hasBoolMember(bool) const;
00131     bool hasLabelMember(const std::string&) const;
00132 
00133     void insertInt(int);
00134     void insertReal(double);
00135     void insertBool(bool);
00136     void insertLabel( const std::string& );
00137 
00138     void removeInt(int);
00139     void removeReal(double);
00140     void removeBool(bool);
00141     void removeLabel( const std::string& );
00142 
00143     void setToIntSingleton(int);
00144     void setToRealSingleton(double);
00145     void setToBoolSingleton(bool);
00146     void setToLabelSingleton( const std::string& );
00147     void setToIntInterval(int min, int max);
00148     void setToRealInterval(double min, double max);
00149   protected:
00150     int getExtendedId() const;
00151   private:
00152     PlasmaVariableImpl();
00153 
00154     void createFullPlasmaVariable(  const PslDatabase* db, const PslDataType& type, const std::string& name );
00155 
00156     EUROPA::ConstrainedVariableId m_Variable;
00157   };
00158 }
00159 
00160 #endif //PLASMA_VARIABLE_IMPL_HEADER_

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