예제 #1
0
    bool FundamentalValue::Equals(const Value* other) const
    {
        if(other->GetType() != GetType())
        {
            return false;
        }

        switch(GetType())
        {
        case TYPE_BOOLEAN:
            {
                bool lhs, rhs;
                return GetAsBoolean(&lhs) && other->GetAsBoolean(&rhs) && lhs==rhs;
            }
        case TYPE_INTEGER:
            {
                int lhs, rhs;
                return GetAsInteger(&lhs) && other->GetAsInteger(&rhs) && lhs==rhs;
            }
        case TYPE_DOUBLE:
            {
                double lhs, rhs;
                return GetAsDouble(&lhs) && other->GetAsDouble(&rhs) && lhs==rhs;
            }
        default:
            NOTREACHED();
            return false;
        }
    }
예제 #2
0
파일: Float.cpp 프로젝트: bugburner/xcsoar
bool DataFieldFloat::SetAsBoolean(bool Value){
  bool res = GetAsBoolean();
  if (res != Value){
    if (Value)
      SetAsFloat(1.0);
    else
      SetAsFloat(0.0);
  }
  return(res);
}
예제 #3
0
파일: Boolean.cpp 프로젝트: hnpilot/XCSoar
void
DataFieldBoolean::Dec(void)
{
  SetAsBoolean(!GetAsBoolean());
}
예제 #4
0
Definition::operator bool()
{
    bool b;
    GetAsBoolean(b);
    return b;
}