Revision 1247 trunk/src/linad99/indextyp.cpp

indextyp.cpp (revision 1247)
20 20
  }
21 21

  
22 22
/**
23
 * Description not yet available.
24
 * \param
25
 */
26
  smart_counter::smart_counter(void)
27
  {
28
    ncopies=new int;
29
    *ncopies=0;
30
  }
31

  
23
Default constructor
24
*/
25
smart_counter::smart_counter(void)
26
{
27
  ncopies = new int;
28
  *ncopies = 0;
29
}
32 30
/**
33
 * Description not yet available.
34
 * \param
35
 */
36
  smart_counter::smart_counter(const smart_counter & sc)
37
  {
38
    ncopies=sc.ncopies;
31
Copy constructor
32
*/
33
smart_counter::smart_counter(const smart_counter& sc)
34
{
35
    ncopies = sc.ncopies;
39 36
    (*ncopies)++;
40
  }
41

  
37
}
42 38
/**
43
 * Description not yet available.
44
 * \param
45
 */
46
  smart_counter::~smart_counter(void)
39
Destructor
40
*/
41
smart_counter::~smart_counter(void)
42
{
43
  if (*ncopies == 0)
47 44
  {
48
    if (*ncopies==0)
49
    {
50
      delete ncopies;
51
      ncopies=0;
52
    }
53
    else
54
    {
55
      (*ncopies)--;
56
    }
45
    delete ncopies;
46
    ncopies = 0;
57 47
  }
48
  else
49
  {
50
    (*ncopies)--;
51
  }
52
}
58 53

  
59 54
  ad_integer::ad_integer(const index_type& it) : d(it.integer()) {}
60 55

  

Also available in: Unified diff