upc_a.hpp
1 #pragma once
2 
3 #include "reader_ean_upc_config_base.hpp"
4 
5 namespace Cvb
6 {
7  CVB_BEGIN_INLINE_NS
8 
9  namespace Barcode
10  {
11  using namespace Internal;
12 
13 
15 
18  {
19 
20  public:
21  virtual Symbology Type() const override { return Symbology::UpcA; };
22 
24 
30  static std::unique_ptr<UpcA> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
31  {
32  auto pConfig = std::unique_ptr<UpcA>(new UpcA());
33  isActiveOut = pConfig->ReadFromHandle(guard);
34  return pConfig;
35  }
36 
37  protected:
38  virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
39  {
40  CExports::cvbbool_t active;
41  CVB_CALL_CAPI(CvcBcGetUPCA(reinterpret_cast<std::intptr_t>(guard.Handle()),
42  &active,
43  checkQuietzone_.Ptr(),
44  appendix2Present_.Ptr(),
45  appendix5Present_.Ptr(),
46  inverse_.Ptr()
47  ));
48  return SmartBool(active);
49  }
50 
51  virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
52  {
53  CVB_CALL_CAPI(CvcBcSetUPCA(reinterpret_cast<std::intptr_t>(guard.Handle()),
54  SmartBool(active),
55  checkQuietzone_,
56  appendix2Present_,
57  appendix5Present_,
58  inverse_
59  ));
60  }
61  protected:
62  UpcA()
63  : ReaderEanUpcConfigBase()
64  {
65  }
66 
67  };
68 
69  using UpcAPtr = std::shared_ptr<UpcA>;
70  }
71 
72  CVB_END_INLINE_NS
73 }
STL class.
static std::unique_ptr< UpcA > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: upc_a.hpp:30
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:96
Root namespace for the Image Manager interface.
Definition: version.hpp:11
virtual Symbology Type() const override
Symbology of configuration object.
Definition: upc_a.hpp:21
STL class.
Configuration to access parameters of ReaderEanUpcConfigBase.
Definition: reader_ean_upc_config_base.hpp:19
Configuration to access parameters of UpcA.
Definition: upc_a.hpp:17