[wadalabfont-kit] / jis2prim / Assumption.h  

Diff of /jis2prim/Assumption.h

Parent Directory | Revision Log

version 1.3, Tue Aug 6 06:30:43 2002 UTC version 1.4, Tue Aug 20 11:10:36 2002 UTC
Line 28 
Line 28 
   int angle;    int angle;
   int hint;    int hint;
  public:   public:
   SimpleAssumption(PtypeMask pm, JointType jt,double xx,double yy, int a,int h)    SimpleAssumption(PtypeMask pm, JointType jt,double xx,double yy, int a,int h);
     :pmask(pm), jtype(jt), x(xx), y(yy), angle(a), hint(h){}  
 };  };
 class AndAssumption{  class AndAssumption{
   friend std::ostream& operator<<(std::ostream &os,const AndAssumption &aa);    friend std::ostream& operator<<(std::ostream &os,const AndAssumption &aa);
  protected:   protected:
   std::vector<SimpleAssumption> saList;    std::vector<SimpleAssumption> saList;
  public:   public:
   AndAssumption& add(const SimpleAssumption &sa){    AndAssumption& add(const SimpleAssumption &sa);
     saList.push_back(sa);  
     return *this;  
   }  
 };  };
 class Assumption{  class Assumption{
   friend std::ostream& operator<<(std::ostream &os,const Assumption &as);    friend std::ostream& operator<<(std::ostream &os,const Assumption &as);
  private:   private:
   std::vector<AndAssumption> aaList;    std::vector<AndAssumption> aaList;
  public:   public:
   Assumption& add(const AndAssumption &sa){    Assumption& add(const AndAssumption &sa);
     aaList.push_back(sa);    Assumption& add(const SimpleAssumption &sa);
     return *this;  
   }  
   Assumption& add(const SimpleAssumption &sa){  
     aaList.push_back(AndAssumption().add(sa));  
     return *this;  
   }  
 };  };
 std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa){  std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa);
   os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)  std::ostream& operator<<(std::ostream &os,const AndAssumption &aa);
      << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle  std::ostream& operator<<(std::ostream &os,const Assumption &a);
      << ",hint=" << sa.hint << ")";  
   return os;  
 }  
 std::ostream& operator<<(std::ostream &os,const AndAssumption &aa){  
   std::vector<SimpleAssumption>::const_iterator it;  
   if(aa.saList.size()==1){  
     return os << *(aa.saList.begin());  
   }  
   os << "AndAssumption(";  
   for(it=aa.saList.begin(); it!=aa.saList.end(); it++){  
     os << *it << ' ';  
   }  
   os << ")";  
   return os;  
 }  
 std::ostream& operator<<(std::ostream &os,const Assumption &a){  
   std::vector<AndAssumption>::const_iterator it;  
   if(a.aaList.size()==1){  
     return os << *(a.aaList.begin());  
   }  
   os << "Assumption(";  
   for(it=a.aaList.begin(); it!=a.aaList.end(); it++){  
     os << *it << ' ';  
   }  
   os << ")";  
   return os;  
 }  
   
 #endif /* _ASSUMPTION_H */  #endif /* _ASSUMPTION_H */


Generate output suitable for use with a patch program
Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help