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

utt_user_data.h

Committer:
martin13
Date:
2017-10-03
Revision:
1:0f11d9338d89
Parent:
0:f4fdca2c4c67

File content as of revision 1:0f11d9338d89:

#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__*/