00001 // This is core/vcsl/vcsl_length.cxx 00002 #include "vcsl_length.h" 00003 #include <vcsl/vcsl_meter.h> 00004 00005 //--------------------------------------------------------------------------- 00006 // Is `new_unit' a compatible unit for the dimension ? 00007 //--------------------------------------------------------------------------- 00008 bool vcsl_length::compatible_unit(vcsl_unit_sptr const& new_unit) const 00009 { 00010 return new_unit->cast_to_length_unit()!=0; 00011 } 00012 00013 //--------------------------------------------------------------------------- 00014 // Return the standard unit associated to the dimension 00015 //--------------------------------------------------------------------------- 00016 vcsl_unit_sptr vcsl_length::standard_unit() const 00017 { 00018 return vcsl_meter::instance().ptr(); 00019 } 00020 00021 //--------------------------------------------------------------------------- 00022 // Return the reference to the unique vcsl_length object 00023 //--------------------------------------------------------------------------- 00024 vcsl_length_sptr vcsl_length::instance() 00025 { 00026 static vcsl_length_sptr instance_=new vcsl_length; 00027 return instance_; 00028 }