Urbi SDK Remote for C++  2.7.5
generic.hh
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 #ifndef GENERIC_GENERIC_HH
00012 # define GENERIC_GENERIC_HH
00013 
00014 # include <urbi/uobject.hh>
00015 
00016 // FIXME: We would like to return void here, but in that case, VC++
00017 // fails to compile our specialization of callbacks.  It would be nice
00018 // to avoid this special-casing for void, but I don't know how.  So
00019 // for the time being, don't use any void functions...
00020 // # define USE_VOID
00021 
00022 // USE_VOID is defined in uobject.hh, undef it to get the wanted behavior.
00023 # undef USE_VOID
00024 
00025 # ifdef USE_VOID
00026 #  define IF_VOID(Then, Else) Then
00027 # else
00028 #  define IF_VOID(Then, Else) Else
00029 # endif
00030 
00031 using namespace urbi;
00032 
00033 class generic : public UObject
00034 {
00035 public:
00036   generic (const std::string& s);
00037   int   init ();
00038 
00039   int foo (int x);
00040   IF_VOID(void, int) inc ();
00041 
00042   UReturn newval (UVar&);
00043 
00044 private:
00045   UVar val;
00046 };
00047 #endif