Mobile API Reference  MicroStrategy 2019
DeleteOperator.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : DeleteOperator.h
3 // AUTHOR : Juan Pablo Muraira
4 // CREATION : 9/26/2001
5 // Copyright (C) MicroStrategy Incorporated 2001
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MBase_DeleteOperator_h
9 #define MBase_DeleteOperator_h
10 
11 #include "Null.h"
12 
13 namespace MBase
14 {
25  // C++ delete
27  template<class T>
28  class DeleteC
29  {
30  public:
31  void operator()(T* ipData) throw()
32  {
33  if (ipData!=NULL)
34  {
35  delete ipData;
36  }
37  }
38  };
39 
41  // C++ array delete
42  template<class T> // Delete used by arrays
44  {
45  public:
46  void operator()(T* ipData) throw()
47  {
48  if (ipData!=NULL)
49  {
50  delete [] ipData;
51  }
52  }
53  };
54 
56  // DeleteOperatorGeneric
57  template<class T>
59  {
60  public:
61  void operator()(T* ipData) throw()
62  {
63  if (ipData)
64  {
65  ipData->Delete();
66  }
67  }
68  };
69 
71  //xhan 09/25/05, Don't delete, just call the destructor of T
72  // C++ destroy
73  template<class T>
74  class Destroy
75  {
76  public:
77  void operator()(T* ipData) throw()
78  {
79  if (ipData!=NULL)
80  {
81  ipData->~T();
82  }
83  }
84  };
85 
86 }
87 
88 #endif // MBase_DeleteOperator_h
void operator()(T *ipData)
Definition: DeleteOperator.h:31
Definition: DeleteOperator.h:74
void operator()(T *ipData)
Definition: DeleteOperator.h:46
void operator()(T *ipData)
Definition: DeleteOperator.h:61
Definition: DeleteOperator.h:43
Definition: DeleteOperator.h:58
Definition: Allocator.h:47
void operator()(T *ipData)
Definition: DeleteOperator.h:77
Definition: DeleteOperator.h:28
#define NULL
Definition: Null.h:10