Revision 1573

trunk/src/linad99/ptr_vec.cpp (revision 1573)
35 35
};
36 36

  
37 37
/**
38
 * Description not yet available.
39
 * \param
40
 */
41
 ptr_vector::~ptr_vector()
42
 {
43
   #ifdef DIAG
38
Destructor
39
*/
40
ptr_vector::~ptr_vector()
41
{
42
#ifdef DIAG
44 43
     cout << "deleting an ivector with address " << _farptr_tolong(v)
45 44
          <<" and ncopies = " << *ncopies <<"\n";
46
   #endif
47
   if (shape->ncopies)
48
   {
49
     (shape->ncopies)--;
50
   }
51
   else
52
   {
53
     if ( v == NULL)
54
     {
55
       cerr << " Trying to delete NULL pointer in ~ivector\n";
56
       ad_exit(21);
57
     }
58
     v += indexmin();
59
     delete [] v;
60
     v=NULL;
61
     #ifdef DIAG
45
#endif
46
  if (shape->ncopies)
47
  {
48
    (shape->ncopies)--;
49
  }
50
  else
51
  {
52
    if (v == NULL)
53
    {
54
      cerr << " Trying to delete NULL pointer in ~ivector\n";
55
      ad_exit(21);
56
    }
57
    v += indexmin();
58
    delete [] v;
59
    v=NULL;
60

  
61
#ifdef DIAG
62 62
       cout << "Really deleting an ivector with address "
63 63
            << _farptr_tolong(v) <<"\n";
64
     #endif
64
#endif
65 65

  
66
     delete  shape;
67
     shape = NULL;
68
   }
69
 }
70

  
66
    delete  shape;
67
    shape = NULL;
68
  }
69
}
71 70
/**
72
 * Description not yet available.
73
 * \param
74
 */
71
Copy constructor
72
*/
75 73
ptr_vector::ptr_vector(const ptr_vector& t)
76
 {
77
   #ifdef DIAG
74
{
75
#ifdef DIAG
78 76
    cout << "Copy constructor called for ivector with address "
79 77
         << _farptr_tolong(t.v) <<"\n";
80
   #endif
81
   shape=t.shape;
82
   (shape->ncopies)++;
83
   v = t.v;
84
 }
85

  
78
#endif
79
  shape=t.shape;
80
  (shape->ncopies)++;
81
  v = t.v;
82
}
86 83
/**
87
 * Description not yet available.
88
 * \param
84
Copy values from _t to this. _t and this indexes should be the same.
85

  
86
\param _t values to copy
89 87
 */
90 88
ptr_vector& ptr_vector::operator=(const ptr_vector& _t)
91
 {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff