You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
523 B
29 lines
523 B
#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<TYPE>()
|
|
|
|
#endif // USHELPER_H
|
|
|