This library is designed to create and run state graphs. It supports hierarchical states and the parallel execution
Diff: utt_user_data.h
- Revision:
- 0:f4fdca2c4c67
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utt_user_data.h Tue Oct 03 08:29:22 2017 +0000 @@ -0,0 +1,38 @@ +#ifndef __UTT_USER_DATA_H__ +#define __UTT_USER_DATA_H__ + +#include "UserData.h" + +class Test{ +public: + + Test():_count(0){} + + void setCount(int count){_count=count;} + + int getCount(){return _count;} + +private: + int _count; + +}; + +void unit_test(){ + + SM::UserData ud; + + Test test; + test.setCount(89); + + ud.put("COUNT",&test); + + printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount()); + + test.setCount(79); + + printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount()); + +} + + +#endif /* #ifndef __UTT_USER_DATA_H__*/ \ No newline at end of file