CMGDK r49-rc2
名字空间 | 宏定义
K:/CMGDKv18/SDK/Include/hgl/Macro.h文件参考

浏览该文件的源代码。

名字空间

namespace  hgl
 

__MAKE_HGL__&&!__MAKE_PLUGIN__


宏定义

#define NEW_NULL_ARRAY(name, type, count)
#define SAFE_CLEAR(name)
#define SAFE_CLEAR_ARRAY(name)
#define SAFE_CLEAR_OBJECT_ARRAY(name, num)
#define FREE_OBJECT_ARRAY(name, num)
#define SAFE_FREE_OBJECT_ARRAY(name, num)
#define SAFE_RECREATE(name, code)
#define ARRAY_CALL(name, num, code)
#define LOAD_FUNC(type, func)
#define SAVE_FUNC(type, func)

宏定义文档

#define ARRAY_CALL (   name,
  num,
  code 
)
值:
{   \
                                            int array_call_number=num;  \
                                            \
                                            while(array_call_number--)  \
                                                name[array_call_number]->code;  \
                                        }
#define FREE_OBJECT_ARRAY (   name,
  num 
)
值:
{   \
                                            if(name&&num>=0)    \
                                            {   \
                                                int free_object_array_number=num;   \
                                                \
                                                while(free_object_array_number--)   \
                                                    if(name[free_object_array_number])  \
                                                        delete name[free_object_array_number];  \
                                                \
                                                hgl_free(name); \
                                                name=NULL;  \
                                            }   \
                                        }
#define LOAD_FUNC (   type,
  func 
)
#define NEW_NULL_ARRAY (   name,
  type,
  count 
)
值:
{   \
                                                name=new type[count];   \
                                                \
                                                memset(name,0,sizeof(type)*count);  \
                                            }
#define SAFE_CLEAR (   name)
值:
{   \
                                    if(name)    \
                                    {   \
                                        delete name;    \
                                        name=NULL;  \
                                    }   \
                                }
#define SAFE_CLEAR_ARRAY (   name)
值:
{   \
                                        if(name)    \
                                        {   \
                                            delete[] name;  \
                                            name=NULL;  \
                                        }   \
                                    }
#define SAFE_CLEAR_OBJECT_ARRAY (   name,
  num 
)
值:
{   \
                                                    if(name&&num>=0)    \
                                                    {   \
                                                        int safe_clear_object_array_number=num; \
                                                        \
                                                        while(safe_clear_object_array_number--) \
                                                            if(name[safe_clear_object_array_number])    \
                                                                delete name[safe_clear_object_array_number];    \
                                                        \
                                                        delete[] name;  \
                                                        name=NULL;  \
                                                    }   \
                                                }
#define SAFE_FREE_OBJECT_ARRAY (   name,
  num 
)
值:
{   \
                                                    if(name)    \
                                                        FREE_OBJECT_ARRAY(name,num);    \
                                                }
#define SAFE_RECREATE (   name,
  code 
)
值:
{   \
                                            if(name)    \
                                                delete name;    \
                                            \
                                            name=code;  \
                                        }
#define SAVE_FUNC (   type,
  func 
)
值:
bool func(type data,void *buf,int buf_size) \
                                    {   \
                                        if(!buf||buf_size<=0)return(false); \
                                        \
                                        MemStream ms(buf,buf_size); \
                                        \
                                        return(func(data,&ms)); \
                                    }   \
                                    \
                                    bool func(type data,const WideString &filename) \
                                    {   \
                                        FileStream fs;  \
                                        \
                                        if(fs.Create(filename)) \
                                            return(func(data,&fs)); \
                                        else    \
                                            return(false);  \
                                    }
 全部  名字空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义