handle.h

来自「粗糙集应用软件」· C头文件 代码 · 共 47 行

H
47
字号
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...: General template class for handles.  Smart pointer
//                 to a class object.
// Comments......:
// Revisions.....:
//===================================================================

#ifndef __HANDLE_H__
#define __HANDLE_H__

#include <copyright.h>

#include <kernel/basic/types.h>
#include <kernel/basic/macros.h>
#include <kernel/basic/message.h>

//-------------------------------------------------------------------
// Class.........: Handle
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Provides a smart pointer to class objects.
//                 The advantage of using handles instead of standard
//                 C++ pointers is that the memory management of (large)
//                 objects is significantly simplified and the safety of
//                 memory operations is increased.
//
//                 Note that the current scheme fails if the structure
//                 formed by the objects in memory is not a directed
//                 acyclic graph (DAG)! Make therefore sure that you
//                 do not use the present handle template if you introduce
//                 circular references. Or, perhaps even better, redesign.
//
// Comments......: Can probably be improved upon a little, Take a look at
//                 Meyers' book ("More Effective C++: 35 New Ways to...")
//                 for a discussion.
//
//                 For some reason MSVC++ 6.0 seems to accept member templates
//                 only if they are declared inside the class body...
//
//                 It seems that MSVC++ 6.0 is somewhat unstable in its
//                 support for member templates, since I encounter mysterious
//                 crashes elsewhere if member templates are used. If they are
//                 not used, everything works just fine...
//
// Revisions.....: A

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?