Logo Search packages:      
Sourcecode: jaula version File versions

void JAULA::Value_Number_Int::set ( Value const &  origin  )  throw (Bad_Data_Type) [virtual]

Copies the contents of one instance into another.

Parameters:
origin Reference to the value to be copied.
Exceptions:
Bad_Data_Type This exception is launched in case that origin and destination value types are different.

Reimplemented from JAULA::Value.

Definition at line 66 of file jaula_value_number_int.cc.

References JAULA::Exception::addOrigin(), data_, getData(), and JAULA::Value::set().

  {
    try
    {
      Value::set(origin);
      Value_Number_Int const *pOrg = dynamic_cast<Value_Number_Int const *>(&origin);
      if (!pOrg)
        throw Bad_Data_Type("Origin and Destination types do not match", "narrowing origin to destination type");
      data_ = pOrg->getData();
    }
    catch(Bad_Data_Type &ex)
    {
      ex.addOrigin("Value_Number_Int::set(Value const &)");
      throw ex;
    }
  }


Generated by  Doxygen 1.6.0   Back to index