00001 00002 // 00003 // Copyright (c) 2004 Model-based Embedded and Robotic Systems Group 00004 // All Rights Reserved Massachusetts Institute of Technology 00005 // 00006 // This software is provided as is. Model-based Embedded and Robotic Systems 00007 // (MERS) group does not assume any responsibility. 00008 // 00009 // Organization: Model-based Embedded and Robotic Systems Group 00010 // Massachusetts Institute of Technology 00011 // 00013 //# CHECKED MJP 08-07-2002 00014 00015 #ifndef __BFIGConstraintUnit__ 00016 #define __BFIGConstraintUnit__ 00017 00018 #ifdef _MSC_VER 00019 #pragma warning(disable:4786) 00020 #endif 00021 00022 #include <cstdlib> 00023 #include <iostream> 00024 00025 #include <Mers/Utils/Lang/String.h> 00026 00027 namespace Mers { 00028 namespace Generators { 00029 namespace BFIG { 00030 00031 class BFIGAssignment; 00032 class BFIGVariable; 00033 00037 class BFIGConstraintUnit 00038 { 00039 friend std::ostream& operator<<(std::ostream&, BFIGConstraintUnit const &); 00040 00041 public: 00042 ~BFIGConstraintUnit(); 00043 BFIGConstraintUnit(BFIGAssignment const * a, bool parityBit); 00044 BFIGConstraintUnit(BFIGConstraintUnit const & cu); 00045 00046 BFIGAssignment const * getAssignment() const; 00047 BFIGVariable const * getVariable() const; 00048 // exported from the Variable / Assignment: 00049 unsigned int getValue() const; 00050 Mers::Utils::Lang::String getValueString() const; 00051 unsigned int getValueInt() const; 00052 unsigned int getName() const; 00053 Mers::Utils::Lang::String getNameString() const; 00054 unsigned int getNameInt() const; 00055 bool getParity() const; 00056 Mers::Utils::Lang::String getDescription() const; 00057 00058 //bool isSatisfiedCurrent() const; 00059 //bool maybeSatisfiedCurrent() const; 00060 //bool uncertain() const; 00061 BFIGConstraintUnit negated() const; 00062 00063 //---------------------------------------------------- 00064 // TYPE DEFINITIONS & OVERLOADED OPERATORS 00065 //---------------------------------------------------- 00066 //bool operator==(BFIGConstraintUnit const * c) const; 00067 bool operator==(BFIGConstraintUnit const & c) const; 00068 bool operator<(BFIGConstraintUnit const & c) const; 00069 00070 BFIGConstraintUnit const & operator=(BFIGConstraintUnit const &c); 00071 00072 private: 00073 BFIGConstraintUnit(); 00074 00075 BFIGAssignment const * constraintAssignment; 00076 bool parity; 00077 00078 }; 00079 } 00080 } 00081 } 00082 00083 #endif // __BFIGConstraintUnit__ 00084
1.5.0