#ifndef CUTIL_COMMON_H
#define CUTIL_COMMON_H

//C++11
#ifdef USE_QT
#include <QString>
#include <QByteArray>
#include <QVector>
#include <QMap>
#include <QList>
#include <QSet>
#include <QDebug>

#else
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <memory>
#include <queue>
#include <stack>
#include <map>
#include <set>
#endif


#ifndef uchar
typedef unsigned char uchar ;
#endif

#ifndef ushort
typedef unsigned short ushort ;
#endif

#ifndef uint
typedef unsigned int uint ;
#endif

#ifdef USE_QT
typedef QVector<uchar> uCharArrayStream;
#else
typedef std::vector<uchar> uCharArrayStream;
//typedef std::function<void(int)> onCreated; //CallBackFunction
#endif

//NAME 붙은건 입맛대로 바꿔서써라.
#define NAME_PROPERTY(Type, MemberName, FaceName) \
    protected:  Type MemberName; \
    public:	Type get##FaceName() const { \
    return MemberName; \
    } \
    public: void set##FaceName(Type value) { \
    MemberName = value; \
    }

#define NAME_READONLY_PROPERTY(Type, Name) __declspec( property (get = property__get_##Name) ) Type Name;\
    typedef Type property__tmp_type_##Name
#define NAME_WRITEONLY_PROPERTY(Type,Name) __declspec( property (put = property__set_##Name) ) Type Name;\
    typedef Type property__tmp_type_##Name
#define GET(Name) property__tmp_type_##Name property__get_##Name()
#define SET(Name) void property__set_##Name(const property__tmp_type_##Name& value)

#define NS_URNAME_BEGIN namespace urname{;
#define NS_URNAME_END };

#define USING_URNAME using namespace urname;

#endif // CUTILCOMMON_H

 

//공부용으로 도움이되길바란다.
//NAME붙은건 입맛대로 바꿔서쓰시길.

+ Recent posts