CVB++ 14.0
code32.hpp
1#pragma once
2
3#include "reader_with_quietzone_config_base.hpp"
4
5namespace Cvb
6{
7 CVB_BEGIN_INLINE_NS
8
9 namespace Barcode
10 {
11 using namespace Internal;
12
14
17 {
18public:
19
21
26 void SetTransmitCheckDigit(bool transmitCheckDigit)
27 {
28 SetDirty();
29 transmitCheckDigit_ = transmitCheckDigit;
30 };
31
33
38 bool TransmitCheckDigit() const
39 {
40 return transmitCheckDigit_;
41 };
42
43
45
50 void SetTransmitStartStop(bool transmitStartStop)
51 {
52 SetDirty();
53 transmitStartStop_ = transmitStartStop;
54 };
55
57
62 bool TransmitStartStop() const
63 {
64 return transmitStartStop_;
65 };
66
67
68
69 protected:
70 SmartBool transmitCheckDigit_;
71 SmartBool transmitStartStop_;
72
73
74 public:
75 virtual Symbology Type() const override { return Symbology::Code32; };
76
78
84 static std::unique_ptr<Code32> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
85 {
86 auto pConfig = std::unique_ptr<Code32>(new Code32());
87 isActiveOut = pConfig->ReadFromHandle(guard);
88 return pConfig;
89 }
90
91 protected:
92 virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
93 {
94 CExports::cvbbool_t active;
95 CVB_CALL_CAPI(CvcBcGetCode32(reinterpret_cast<std::intptr_t>(guard.Handle()),
96 &active,
97 checkQuietzone_.Ptr(),
98 transmitCheckDigit_.Ptr(),
99 transmitStartStop_.Ptr(),
100 inverse_.Ptr()
101 ));
102
103 return SmartBool(active);
104 }
105
106 virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
107 {
108 Internal::DoResCall([&]()
109 {
110 return CVB_CALL_CAPI(CvcBcSetCode32(reinterpret_cast<std::intptr_t>(guard.Handle()),
111 SmartBool(active),
112 checkQuietzone_,
113 transmitCheckDigit_,
114 transmitStartStop_,
115 inverse_
116 ));
117 });
118 }
119 protected:
120 Code32()
121 : ReaderWithQuietzoneConfigBase()
122 {
123 }
124
125 };
126
127 using Code32Ptr = std::shared_ptr<Code32>;
128 }
129
130 CVB_END_INLINE_NS
131}
Configuration to access parameters of Code32.
Definition: code32.hpp:17
static std::unique_ptr< Code32 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code32.hpp:84
bool TransmitStartStop() const
Returns whether to transmit/not transmit start and stop digits with data.
Definition: code32.hpp:62
void SetTransmitCheckDigit(bool transmitCheckDigit)
Append/do not append check digit to data.
Definition: code32.hpp:26
void SetTransmitStartStop(bool transmitStartStop)
Transmit/do not transmit start and stop digits with data.
Definition: code32.hpp:50
bool TransmitCheckDigit() const
Returns the transmit check digit value.
Definition: code32.hpp:38
Configuration to access parameters of ReaderWithQuietzoneConfigBase.
Definition: reader_with_quietzone_config_base.hpp:20
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ Code32
Code 32 Barcode.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24