Coverage Report

Created: 2023-12-08 06:59

/src/aspell/common/generic_copy_ptr-t.hpp
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2001
2
// Kevin Atkinson
3
//
4
// Permission to use, copy, modify, distribute and sell this software
5
// and its documentation for any purpose is hereby granted without
6
// fee, provided that the above copyright notice appear in all copies
7
// and that both that copyright notice and this permission notice
8
// appear in supporting documentation. Kevin Atkinson makes no
9
// representations about the suitability of this software for any
10
// purpose.  It is provided "as is" without express or implied
11
// warranty.
12
13
#ifndef autil__generic_copy_ptr_t
14
#define autil__generic_copy_ptr_t
15
16
#include "generic_copy_ptr.hpp"
17
18
namespace acommon {
19
20
  template <typename T, typename Parms> 
21
  GenericCopyPtr<T,Parms>::GenericCopyPtr(const GenericCopyPtr & other) 
22
0
  {
23
0
    if (other.ptr_ != 0) 
24
0
      ptr_ = parms_.clone(other.ptr_);
25
0
    else
26
0
      ptr_ = 0;
27
0
    parms_  = other.parms_;
28
0
  }
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::GenericCopyPtr(acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms> const&)
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Enumeration<aspeller::WordEntry*>, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms>::GenericCopyPtr(acommon::GenericCopyPtr<acommon::Enumeration<aspeller::WordEntry*>, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms> const&)
29
  
30
  template <typename T, typename Parms>
31
  void GenericCopyPtr<T,Parms>::assign(const T * other_ptr, 
32
               const Parms & other_parms) 
33
0
  {
34
0
    if (other_ptr == 0) {
35
0
      if (ptr_ != 0) parms_.del(ptr_);
36
0
      ptr_ = 0;
37
0
    } else if (ptr_ == 0) {
38
0
      ptr_ = parms_.clone(other_ptr);
39
0
    } else {
40
0
      parms_.assign(ptr_, other_ptr);
41
0
    }
42
0
    parms_ = other_parms;
43
0
  }
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::assign(acommon::Error const*, acommon::CopyPtr<acommon::Error>::Parms const&)
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Enumeration<aspeller::WordEntry*>, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms>::assign(acommon::Enumeration<aspeller::WordEntry*> const*, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms const&)
44
45
  template <typename T, typename Parms>
46
  void GenericCopyPtr<T,Parms>::reset (T * other, const Parms & other_parms) 
47
41.3k
  {
48
41.3k
    if (ptr_ != 0) 
49
9.29k
      parms_.del(ptr_);
50
41.3k
    ptr_ = other;
51
41.3k
    parms_ = other_parms;
52
41.3k
  }
acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::reset(acommon::Error*, acommon::CopyPtr<acommon::Error>::Parms const&)
Line
Count
Source
47
31.4k
  {
48
31.4k
    if (ptr_ != 0) 
49
9.29k
      parms_.del(ptr_);
50
31.4k
    ptr_ = other;
51
31.4k
    parms_ = other_parms;
52
31.4k
  }
acommon::GenericCopyPtr<acommon::Tokenizer, acommon::CopyPtr<acommon::Tokenizer>::Parms>::reset(acommon::Tokenizer*, acommon::CopyPtr<acommon::Tokenizer>::Parms const&)
Line
Count
Source
47
694
  {
48
694
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
694
    ptr_ = other;
51
694
    parms_ = other_parms;
52
694
  }
acommon::GenericCopyPtr<acommon::Filter, acommon::CopyPtr<acommon::Filter>::Parms>::reset(acommon::Filter*, acommon::CopyPtr<acommon::Filter>::Parms const&)
Line
Count
Source
47
694
  {
48
694
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
694
    ptr_ = other;
51
694
    parms_ = other_parms;
52
694
  }
acommon::GenericCopyPtr<acommon::Config, acommon::CopyPtr<acommon::Config>::Parms>::reset(acommon::Config*, acommon::CopyPtr<acommon::Config>::Parms const&)
Line
Count
Source
47
739
  {
48
739
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
739
    ptr_ = other;
51
739
    parms_ = other_parms;
52
739
  }
acommon::GenericCopyPtr<acommon::Convert, acommon::ClonePtr<acommon::Convert>::Parms>::reset(acommon::Convert*, acommon::ClonePtr<acommon::Convert>::Parms const&)
Line
Count
Source
47
1.41k
  {
48
1.41k
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
1.41k
    ptr_ = other;
51
1.41k
    parms_ = other_parms;
52
1.41k
  }
acommon::GenericCopyPtr<aspeller::Suggest, acommon::ClonePtr<aspeller::Suggest>::Parms>::reset(aspeller::Suggest*, acommon::ClonePtr<aspeller::Suggest>::Parms const&)
Line
Count
Source
47
1.40k
  {
48
1.40k
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
1.40k
    ptr_ = other;
51
1.40k
    parms_ = other_parms;
52
1.40k
  }
acommon::GenericCopyPtr<aspeller::Dictionary::Id, acommon::CopyPtr<aspeller::Dictionary::Id>::Parms>::reset(aspeller::Dictionary::Id*, acommon::CopyPtr<aspeller::Dictionary::Id>::Parms const&)
Line
Count
Source
47
4.97k
  {
48
4.97k
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
4.97k
    ptr_ = other;
51
4.97k
    parms_ = other_parms;
52
4.97k
  }
53
54
  template <typename T, typename Parms>
55
  GenericCopyPtr<T,Parms>::~GenericCopyPtr() 
56
23.8k
  {
57
23.8k
    if (ptr_ != 0)
58
10.0k
      parms_.del(ptr_);
59
23.8k
  }
acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
13.0k
  {
57
13.0k
    if (ptr_ != 0)
58
102
      parms_.del(ptr_);
59
13.0k
  }
acommon::GenericCopyPtr<acommon::Tokenizer, acommon::CopyPtr<acommon::Tokenizer>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
696
  {
57
696
    if (ptr_ != 0)
58
694
      parms_.del(ptr_);
59
696
  }
acommon::GenericCopyPtr<acommon::Filter, acommon::CopyPtr<acommon::Filter>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
696
  {
57
696
    if (ptr_ != 0)
58
694
      parms_.del(ptr_);
59
696
  }
acommon::GenericCopyPtr<aspeller::Suggest, acommon::ClonePtr<aspeller::Suggest>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
1.47k
  {
57
1.47k
    if (ptr_ != 0)
58
1.40k
      parms_.del(ptr_);
59
1.47k
  }
acommon::GenericCopyPtr<aspeller::SensitiveCompare, acommon::CopyPtr<aspeller::SensitiveCompare>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
739
  {
57
739
    if (ptr_ != 0)
58
0
      parms_.del(ptr_);
59
739
  }
acommon::GenericCopyPtr<acommon::Config, acommon::CopyPtr<acommon::Config>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
739
  {
57
739
    if (ptr_ != 0)
58
739
      parms_.del(ptr_);
59
739
  }
acommon::GenericCopyPtr<acommon::Convert, acommon::ClonePtr<acommon::Convert>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
1.47k
  {
57
1.47k
    if (ptr_ != 0)
58
1.41k
      parms_.del(ptr_);
59
1.47k
  }
acommon::GenericCopyPtr<aspeller::Dictionary::Id, acommon::CopyPtr<aspeller::Dictionary::Id>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
4.97k
  {
57
4.97k
    if (ptr_ != 0)
58
4.97k
      parms_.del(ptr_);
59
4.97k
  }
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Enumeration<aspeller::WordEntry*>, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms>::~GenericCopyPtr()
60
  
61
}
62
63
#endif