CVB++ 14.1
sony_code.hpp
1#pragma once
2
3#include "reader_with_transmit_start_stop_config.hpp"
4
5namespace Cvb
6{
7 CVB_BEGIN_INLINE_NS
8
9 namespace Barcode
10 {
11 using namespace Internal;
12
13
15
18 {
19public:
20
22
27 void SetInterpretCode(bool interpret)
28 {
29 SetDirty();
30 interpret_ = interpret;
31 }
32
34
39 bool InterpretCode() const
40 {
41 return interpret_;
42 };
43
44
45
46 protected:
47 SmartBool interpret_;
48
49
50 public:
51 virtual Symbology Type() const override { return Symbology::SonyCode; };
52
54
60 static std::unique_ptr<SonyCode> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
61 {
62 auto pConfig = std::unique_ptr<SonyCode>(new SonyCode());
63 isActiveOut = pConfig->ReadFromHandle(guard);
64 return pConfig;
65 }
66
67 protected:
68 virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
69 {
70 CExports::cvbbool_t active;
71 CVB_CALL_CAPI(CvcBcGetSonyCode(reinterpret_cast<std::intptr_t>(guard.Handle()),
72 &active,
73 &minDigits_,
74 &maxDigits_,
75 checkQuietzone_.Ptr(),
76 evalCheckDigit_.Ptr(),
77 transmitCheckDigit_.Ptr(),
78 transmitStartStop_.Ptr(),
79 interpret_.Ptr(),
80 inverse_.Ptr()
81 ));
82 return SmartBool(active);
83 }
84
85 virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
86 {
87 Internal::DoResCall([&]()
88 {
89 return CVB_CALL_CAPI(CvcBcSetSonyCode(reinterpret_cast<std::intptr_t>(guard.Handle()),
90 SmartBool(active),
91 minDigits_,
92 maxDigits_,
93 checkQuietzone_,
94 evalCheckDigit_,
95 transmitCheckDigit_,
96 transmitStartStop_,
97 interpret_,
98 inverse_
99 ));
100 });
101 }
102 protected:
103 SonyCode()
104 : ReaderWithTransmitStartStopConfigBase()
105 {
106 }
107
108 };
109
110 using SonyCodePtr = std::shared_ptr<SonyCode>;
111 }
112
113 CVB_END_INLINE_NS
114}
Configuration to access parameters of ReaderWithTransmitStartStopConfigBase.
Definition: reader_with_transmit_start_stop_config.hpp:19
Configuration to access parameters of SonyCode.
Definition: sony_code.hpp:18
static std::unique_ptr< SonyCode > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: sony_code.hpp:60
bool InterpretCode() const
Returns whether to check/ignore full description of SonyCode.
Definition: sony_code.hpp:39
void SetInterpretCode(bool interpret)
Check/ignore full description of SonyCode.
Definition: sony_code.hpp:27
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ SonyCode
SonyCode Barcode.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24