vcsl_angle.cxx
Go to the documentation of this file.
1 // This is core/vcsl/vcsl_angle.cxx
2 #include "vcsl_angle.h"
3 #include <vcsl/vcsl_radian.h>
4 
5 //---------------------------------------------------------------------------
6 // Is `new_unit' a compatible unit for the dimension ?
7 //---------------------------------------------------------------------------
8 bool vcsl_angle::compatible_unit(vcsl_unit_sptr const& new_unit) const
9 {
10  return new_unit->cast_to_angle_unit()!=nullptr;
11 }
12 
14 {
15  return vcsl_radian::instance().ptr();
16 }
17 
18 //---------------------------------------------------------------------------
19 // Return the reference to the unique vcsl_angle object
20 //---------------------------------------------------------------------------
22 {
23  static vcsl_angle_sptr instance_=new vcsl_angle;
24  return instance_;
25 }
vcsl_angle()=default
vcsl_unit_sptr standard_unit() const override
Return the standard unit associated to the dimension.
Definition: vcsl_angle.cxx:13
bool compatible_unit(vcsl_unit_sptr const &new_unit) const override
Is ‘new_unit’ a compatible unit for the dimension ?.
Definition: vcsl_angle.cxx:8
Standard unit associated to the angle dimension.
static vcsl_radian_sptr instance()
Return the reference to the unique vcsl_radian object.
Definition: vcsl_radian.cxx:7
Angle dimension.
static vcsl_angle_sptr instance()
Return the reference to the unique vcsl_angle object.
Definition: vcsl_angle.cxx:21
T * ptr() const