Logo Search packages:      
Sourcecode: jaula version File versions

void JAULA::Value_Boolean::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 68 of file jaula_value_boolean.cc.

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

  {
    try
    {
      Value::set(origin);
      Value_Boolean const *pOrg =
        dynamic_cast<Value_Boolean 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_Boolean::set(Value const &)");
      throw ex;
    }
  }


Generated by  Doxygen 1.6.0   Back to index