This library is designed to create and run state graphs. It supports hierarchical states and the parallel execution
utt_user_data.h@1:0f11d9338d89, 2017-10-03 (annotated)
- Committer:
- martin13
- Date:
- Tue Oct 03 08:36:40 2017 +0000
- Revision:
- 1:0f11d9338d89
- Parent:
- 0:f4fdca2c4c67
added empty readme
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
martin13 | 0:f4fdca2c4c67 | 1 | #ifndef __UTT_USER_DATA_H__ |
martin13 | 0:f4fdca2c4c67 | 2 | #define __UTT_USER_DATA_H__ |
martin13 | 0:f4fdca2c4c67 | 3 | |
martin13 | 0:f4fdca2c4c67 | 4 | #include "UserData.h" |
martin13 | 0:f4fdca2c4c67 | 5 | |
martin13 | 0:f4fdca2c4c67 | 6 | class Test{ |
martin13 | 0:f4fdca2c4c67 | 7 | public: |
martin13 | 0:f4fdca2c4c67 | 8 | |
martin13 | 0:f4fdca2c4c67 | 9 | Test():_count(0){} |
martin13 | 0:f4fdca2c4c67 | 10 | |
martin13 | 0:f4fdca2c4c67 | 11 | void setCount(int count){_count=count;} |
martin13 | 0:f4fdca2c4c67 | 12 | |
martin13 | 0:f4fdca2c4c67 | 13 | int getCount(){return _count;} |
martin13 | 0:f4fdca2c4c67 | 14 | |
martin13 | 0:f4fdca2c4c67 | 15 | private: |
martin13 | 0:f4fdca2c4c67 | 16 | int _count; |
martin13 | 0:f4fdca2c4c67 | 17 | |
martin13 | 0:f4fdca2c4c67 | 18 | }; |
martin13 | 0:f4fdca2c4c67 | 19 | |
martin13 | 0:f4fdca2c4c67 | 20 | void unit_test(){ |
martin13 | 0:f4fdca2c4c67 | 21 | |
martin13 | 0:f4fdca2c4c67 | 22 | SM::UserData ud; |
martin13 | 0:f4fdca2c4c67 | 23 | |
martin13 | 0:f4fdca2c4c67 | 24 | Test test; |
martin13 | 0:f4fdca2c4c67 | 25 | test.setCount(89); |
martin13 | 0:f4fdca2c4c67 | 26 | |
martin13 | 0:f4fdca2c4c67 | 27 | ud.put("COUNT",&test); |
martin13 | 0:f4fdca2c4c67 | 28 | |
martin13 | 0:f4fdca2c4c67 | 29 | printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount()); |
martin13 | 0:f4fdca2c4c67 | 30 | |
martin13 | 0:f4fdca2c4c67 | 31 | test.setCount(79); |
martin13 | 0:f4fdca2c4c67 | 32 | |
martin13 | 0:f4fdca2c4c67 | 33 | printf("COUNT = %i\n",ud.get<Test*>("COUNT")->getCount()); |
martin13 | 0:f4fdca2c4c67 | 34 | |
martin13 | 0:f4fdca2c4c67 | 35 | } |
martin13 | 0:f4fdca2c4c67 | 36 | |
martin13 | 0:f4fdca2c4c67 | 37 | |
martin13 | 0:f4fdca2c4c67 | 38 | #endif /* #ifndef __UTT_USER_DATA_H__*/ |