Coverage Report

Created: 2025-08-26 06:57

/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
28.2k
  {
48
28.2k
    if (ptr_ != 0) 
49
8.54k
      parms_.del(ptr_);
50
28.2k
    ptr_ = other;
51
28.2k
    parms_ = other_parms;
52
28.2k
  }
acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::reset(acommon::Error*, acommon::CopyPtr<acommon::Error>::Parms const&)
Line
Count
Source
47
21.8k
  {
48
21.8k
    if (ptr_ != 0) 
49
8.54k
      parms_.del(ptr_);
50
21.8k
    ptr_ = other;
51
21.8k
    parms_ = other_parms;
52
21.8k
  }
acommon::GenericCopyPtr<acommon::Tokenizer, acommon::CopyPtr<acommon::Tokenizer>::Parms>::reset(acommon::Tokenizer*, acommon::CopyPtr<acommon::Tokenizer>::Parms const&)
Line
Count
Source
47
450
  {
48
450
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
450
    ptr_ = other;
51
450
    parms_ = other_parms;
52
450
  }
acommon::GenericCopyPtr<acommon::Filter, acommon::CopyPtr<acommon::Filter>::Parms>::reset(acommon::Filter*, acommon::CopyPtr<acommon::Filter>::Parms const&)
Line
Count
Source
47
450
  {
48
450
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
450
    ptr_ = other;
51
450
    parms_ = other_parms;
52
450
  }
acommon::GenericCopyPtr<acommon::Config, acommon::CopyPtr<acommon::Config>::Parms>::reset(acommon::Config*, acommon::CopyPtr<acommon::Config>::Parms const&)
Line
Count
Source
47
470
  {
48
470
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
470
    ptr_ = other;
51
470
    parms_ = other_parms;
52
470
  }
acommon::GenericCopyPtr<acommon::Convert, acommon::ClonePtr<acommon::Convert>::Parms>::reset(acommon::Convert*, acommon::ClonePtr<acommon::Convert>::Parms const&)
Line
Count
Source
47
924
  {
48
924
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
924
    ptr_ = other;
51
924
    parms_ = other_parms;
52
924
  }
acommon::GenericCopyPtr<aspeller::Suggest, acommon::ClonePtr<aspeller::Suggest>::Parms>::reset(aspeller::Suggest*, acommon::ClonePtr<aspeller::Suggest>::Parms const&)
Line
Count
Source
47
914
  {
48
914
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
914
    ptr_ = other;
51
914
    parms_ = other_parms;
52
914
  }
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
3.23k
  {
48
3.23k
    if (ptr_ != 0) 
49
0
      parms_.del(ptr_);
50
3.23k
    ptr_ = other;
51
3.23k
    parms_ = other_parms;
52
3.23k
  }
53
54
  template <typename T, typename Parms>
55
  GenericCopyPtr<T,Parms>::~GenericCopyPtr() 
56
15.5k
  {
57
15.5k
    if (ptr_ != 0)
58
6.51k
      parms_.del(ptr_);
59
15.5k
  }
acommon::GenericCopyPtr<acommon::Error, acommon::CopyPtr<acommon::Error>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
8.56k
  {
57
8.56k
    if (ptr_ != 0)
58
78
      parms_.del(ptr_);
59
8.56k
  }
acommon::GenericCopyPtr<acommon::Tokenizer, acommon::CopyPtr<acommon::Tokenizer>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
454
  {
57
454
    if (ptr_ != 0)
58
450
      parms_.del(ptr_);
59
454
  }
acommon::GenericCopyPtr<acommon::Filter, acommon::CopyPtr<acommon::Filter>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
454
  {
57
454
    if (ptr_ != 0)
58
450
      parms_.del(ptr_);
59
454
  }
acommon::GenericCopyPtr<aspeller::Suggest, acommon::ClonePtr<aspeller::Suggest>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
940
  {
57
940
    if (ptr_ != 0)
58
914
      parms_.del(ptr_);
59
940
  }
acommon::GenericCopyPtr<aspeller::SensitiveCompare, acommon::CopyPtr<aspeller::SensitiveCompare>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
470
  {
57
470
    if (ptr_ != 0)
58
0
      parms_.del(ptr_);
59
470
  }
acommon::GenericCopyPtr<acommon::Config, acommon::CopyPtr<acommon::Config>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
470
  {
57
470
    if (ptr_ != 0)
58
470
      parms_.del(ptr_);
59
470
  }
acommon::GenericCopyPtr<acommon::Convert, acommon::ClonePtr<acommon::Convert>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
940
  {
57
940
    if (ptr_ != 0)
58
924
      parms_.del(ptr_);
59
940
  }
acommon::GenericCopyPtr<aspeller::Dictionary::Id, acommon::CopyPtr<aspeller::Dictionary::Id>::Parms>::~GenericCopyPtr()
Line
Count
Source
56
3.23k
  {
57
3.23k
    if (ptr_ != 0)
58
3.23k
      parms_.del(ptr_);
59
3.23k
  }
Unexecuted instantiation: acommon::GenericCopyPtr<acommon::Enumeration<aspeller::WordEntry*>, acommon::ClonePtr<acommon::Enumeration<aspeller::WordEntry*> >::Parms>::~GenericCopyPtr()
60
  
61
}
62
63
#endif