|
Urbi SDK Remote for C++
2.7.5
|
00001 /* 00002 * Copyright (C) 2008-2010, Gostai S.A.S. 00003 * 00004 * This software is provided "as is" without warranty of any kind, 00005 * either expressed or implied, including but not limited to the 00006 * implied warranties of fitness for a particular purpose. 00007 * 00008 * See the LICENSE file for more information. 00009 */ 00010 00012 #include <urbi/uprop.hh> 00013 #include <urbi/uvar.hh> 00014 00015 namespace urbi 00016 { 00017 00018 UProp::UProp(UVar& owner, UProperty name) 00019 : owner(owner) 00020 , name(name) 00021 {} 00022 00023 void 00024 UProp::operator =(const UValue& v) 00025 { 00026 owner.setProp(name, v); 00027 } 00028 00029 void 00030 UProp::operator =(const ufloat v) 00031 { 00032 owner.setProp(name, v); 00033 } 00034 00035 void 00036 UProp::operator =(const std::string& v) 00037 { 00038 owner.setProp(name, v); 00039 } 00040 00041 UProp::operator ufloat() 00042 { 00043 return static_cast<ufloat>(owner.getProp(name)); 00044 } 00045 00046 UProp::operator std::string() 00047 { 00048 return owner.getProp(name); 00049 } 00050 00051 UProp::operator UValue() 00052 { 00053 return owner.getProp(name); 00054 } 00055 00056 00057 } // end namespace urbi