|
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 #include "remote.hh" 00013 00014 UStart (remote); 00015 00016 remote::remote (const std::string& s) 00017 : UObject (s) 00018 { 00019 UBindVar (remote, toto); 00020 UBindFunction (remote, init); 00021 UBindFunction (remote, foo); 00022 00023 val = new UVar ("remote.val"); 00024 UNotifyChange (*val, &remote::newval); 00025 } 00026 00027 int 00028 remote::init () 00029 { 00030 return 0; 00031 } 00032 00033 UReturn 00034 remote::newval (UVar& v) 00035 { 00036 std::cout << "remote.val=" << (int)v << std::endl; 00037 return 0; 00038 } 00039 00040 int 00041 remote::foo (int x) 00042 { 00043 toto = x; 00044 return x+1; 00045 }