|
Urbi SDK Remote for C++
2.7.5
|
00001 /* 00002 * Copyright (C) 2008-2011, 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 00011 #include <iostream> 00012 00013 #include "sensor2.hh" 00014 00015 UStart(sensor2); 00016 00017 sensor2::sensor2(std::string s) 00018 : UObject(s) 00019 { 00020 val = new UVar("sensor.val"); 00021 00022 UBindFunction(sensor2, init); 00023 UBindFunction(sensor2, setVal); 00024 UNotifyChange(*val, &sensor2::newval); 00025 } 00026 00027 int 00028 sensor2::init() 00029 { 00030 return 0; 00031 } 00032 00033 UReturn 00034 sensor2::newval(UVar& v) 00035 { 00036 std::cout << "sensor.val notifychange: " << (int)v << std::endl; 00037 return 0; 00038 } 00039 00040 void 00041 sensor2::setVal(int) 00042 { 00043 } 00044 00045 UReturn 00046 sensor2::getval(UVar& v) 00047 { 00048 v = 666; 00049 return 0; 00050 }