This library is designed to create and run state graphs. It supports hierarchical states and the parallel execution

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers utt_user_data.h Source File

utt_user_data.h

00001 #ifndef __UTT_USER_DATA_H__
00002 #define __UTT_USER_DATA_H__
00003 
00004 #include "UserData.h"
00005 
00006 class Test{
00007 public:
00008 
00009     Test():_count(0){}
00010     
00011     void setCount(int count){_count=count;}
00012     
00013     int getCount(){return _count;}
00014     
00015 private:
00016     int _count;  
00017     
00018 };
00019 
00020 void unit_test(){
00021     
00022     SM::UserData ud;
00023     
00024     Test test;
00025     test.setCount(89);
00026     
00027     ud.put("COUNT",&test);
00028     
00029     printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount());
00030     
00031     test.setCount(79);
00032     
00033     printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount());
00034     
00035 }
00036 
00037 
00038 #endif /* #ifndef __UTT_USER_DATA_H__*/