Urbi SDK Remote for C++  2.7.5
uaccess2.uob/uaccess.cc
Go to the documentation of this file.
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 "uaccess.hh"
00013 
00014 using namespace urbi;
00015 
00016 UStart (uaccess);
00017 
00018 uaccess::uaccess (const std::string& s)
00019   : UObject (s)
00020 {
00021   UBindFunction (uaccess, init);
00022   UBindVar (uaccess, val);
00023   // This uobject is used for non uowned tests
00024   // UOwned(val);
00025   // UNotifyAccess (val, &uaccess::newval);
00026   UNotifyChange  (val, &uaccess::changed);
00027 }
00028 
00029 int
00030 uaccess::init ()
00031 {
00032   val = 0;
00033   return 0;
00034 }
00035 
00036 UReturn
00037 uaccess::newval (UVar& v)
00038 {
00039   static int value = 0;
00040   value++;
00041   v = value;
00042   return 0;
00043 }
00044 
00045 UReturn
00046 uaccess::changed (UVar&)
00047 {
00048   return 0;
00049 }