-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray_Auto_Ptr.h
More file actions
executable file
·67 lines (53 loc) · 1.1 KB
/
Copy pathArray_Auto_Ptr.h
File metadata and controls
executable file
·67 lines (53 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -*- C++ -*-
//==============================================================================
/**
* @file Expr_Command.h
*
* Honor Pledge:
*
* I pledge that I have neither given nor received any help
* on this assignment.
*/
//==============================================================================
#ifndef _ARRAY_AUTO_POINTER_H_
#define _ARRAY_AUTO_POINTER_H_
/**
* @class Array_Auto_Ptr
*
* This is a pure abstract class.
* Provide the common implement of all the commands in this abstract class.
*/
template <typename T>
class Array_Auto_Ptr
{
public:
// constructor
Array_Auto_Ptr (void);
// initialization constructor
Array_Auto_Ptr (T * ptr);
// destructor
~Array_Auto_Ptr (void);
/**
*
*
*/
T * operator -> (void);
/**
*
*/
T & operator * (void);
/**
*
*/
operator T * (void);
/**
*
*/
T & operator [] (int i);
protected:
// pointer to the data
T * ptr_;
};
// include implementation file
#include "Array_Auto_Ptr.cpp"
#endif // !defined _ARRAY_AUTO_POINTER_H_