Exemplo n.º 1
0
  static bool isIntegerOrDouble(AnyReference value)
  {

    Signature signature(value.signature());
    return signature.isConvertibleTo(Signature("i")) != 0.0 ||
           signature.isConvertibleTo(Signature("d")) != 0.0;
  }
Exemplo n.º 2
0
  bool ParameterModelPrivate::inInterval(AnyReference value, AnyReference min, AnyReference max) const
  {
    Signature signature(value.signature());
    qiLogDebug() << "Enter in inInterval";
    qiLogDebug() << "Signature of value is : " << signature.toString();

    //if value is bool string or Resource return true
    if(signature.isConvertibleTo(Signature::fromType(Signature::Type_Bool)) == 1.0f ||
       signature.isConvertibleTo(Signature::fromType(Signature::Type_String)) == 1.0f ||
       signature.isConvertibleTo(ParameterModel::signatureRessource()) == 1.0f)
      return true;

    qiLogDebug() << "Type of value is double or integer";

    //if value is not in [min, max] return false
    if(value < min || max < value)
      return false;

    return true;
  }