[wadalabfont-kit] / jis2prim / Assumption.h  

Diff of /jis2prim/Assumption.h

Parent Directory | Revision Log

version 1.2, Fri Feb 22 12:03:48 2002 UTC version 1.3, Tue Aug 6 06:30:43 2002 UTC
Line 1 
Line 1 
 #ifndef _ASSUMPTION_H  #ifndef _ASSUMPTION_H
 #define _ASSUMPTION_H  #define _ASSUMPTION_H
   #include <vector>
   #include <iostream>
   
 enum PtypeMask{  enum PtypeMask{
   TenMask=1<<0,    TenMask=1<<0,
Line 18 
Line 20 
 };  };
   
 class SimpleAssumption{  class SimpleAssumption{
   friend ostream& operator<<(ostream &os,const SimpleAssumption &sa);    friend std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa);
  protected:   protected:
   PtypeMask pmask;    PtypeMask pmask;
   JointType jtype;    JointType jtype;
Line 30 
Line 32 
     :pmask(pm), jtype(jt), x(xx), y(yy), angle(a), hint(h){}      :pmask(pm), jtype(jt), x(xx), y(yy), angle(a), hint(h){}
 };  };
 class AndAssumption{  class AndAssumption{
   friend ostream& operator<<(ostream &os,const AndAssumption &aa);    friend std::ostream& operator<<(std::ostream &os,const AndAssumption &aa);
  protected:   protected:
   vector<SimpleAssumption> saList;    std::vector<SimpleAssumption> saList;
  public:   public:
   AndAssumption& add(const SimpleAssumption &sa){    AndAssumption& add(const SimpleAssumption &sa){
     saList.push_back(sa);      saList.push_back(sa);
Line 40 
Line 42 
   }    }
 };  };
 class Assumption{  class Assumption{
   friend ostream& operator<<(ostream &os,const Assumption &as);    friend std::ostream& operator<<(std::ostream &os,const Assumption &as);
  private:   private:
   vector<AndAssumption> aaList;    std::vector<AndAssumption> aaList;
  public:   public:
   Assumption& add(const AndAssumption &sa){    Assumption& add(const AndAssumption &sa){
     aaList.push_back(sa);      aaList.push_back(sa);
Line 53 
Line 55 
     return *this;      return *this;
   }    }
 };  };
 ostream& operator<<(ostream &os,const SimpleAssumption &sa){  std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa){
   os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)    os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)
      << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle       << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle
      << ",hint=" << sa.hint << ")";       << ",hint=" << sa.hint << ")";
   return os;    return os;
 }  }
 ostream& operator<<(ostream &os,const AndAssumption &aa){  std::ostream& operator<<(std::ostream &os,const AndAssumption &aa){
   vector<SimpleAssumption>::const_iterator it;    std::vector<SimpleAssumption>::const_iterator it;
   if(aa.saList.size()==1){    if(aa.saList.size()==1){
     return os << *(aa.saList.begin());      return os << *(aa.saList.begin());
   }    }
Line 71 
Line 73 
   os << ")";    os << ")";
   return os;    return os;
 }  }
 ostream& operator<<(ostream &os,const Assumption &a){  std::ostream& operator<<(std::ostream &os,const Assumption &a){
   vector<AndAssumption>::const_iterator it;    std::vector<AndAssumption>::const_iterator it;
   if(a.aaList.size()==1){    if(a.aaList.size()==1){
     return os << *(a.aaList.begin());      return os << *(a.aaList.begin());
   }    }


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

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help