#ifndef USHELPER_H #define USHELPER_H #define SINGLETON(NAME) \ private: \ static NAME* _instance; \ static QMutex _mutex; \ public: \ static NAME* getInstance() \ { \ if(!_instance) \ { \ _mutex.lock(); \ if(!_instance) \ { \ _instance = new NAME(); \ } \ _mutex.unlock(); \ } \ return _instance; \ } #define SINGLETON_DEF(NAME) \ NAME* NAME::_instance; \ QMutex NAME::_mutex; #define GET_VALUE(REQUEST, INDEX, TYPE) REQUEST.getValueList()[INDEX].value() #endif // USHELPER_H