DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
parsing_chain.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_PARSING_CHAIN_H
13 #define DOCWIRE_PARSING_CHAIN_H
14 
15 #include "chain_element.h"
16 #include "core_export.h"
17 #include "pimpl.h"
18 #include "ref_or_owned.h"
19 
20 namespace docwire
21 {
22 
23 namespace pipeline
24 {
25 struct start_processing {};
26 } // namespace pipeline
27 
28 class DOCWIRE_CORE_EXPORT parsing_chain : public chain_element, public with_pimpl<parsing_chain>
29 {
30  public:
33  parsing_chain& operator=(parsing_chain&& chain);
34 
35  void operator()(message_ptr msg);
36 
37  bool is_leaf() const override;
38  bool is_generator() const override;
39 
40  bool is_complete() const;
41 
42  protected:
43  virtual continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
44 
45  private:
47 };
48 
49 DOCWIRE_CORE_EXPORT parsing_chain operator|(ref_or_owned<chain_element> lhs, ref_or_owned<chain_element> rhs);
50 
51 inline parsing_chain& operator|=(parsing_chain& lhs, ref_or_owned<chain_element> rhs)
52 {
53  lhs = std::move(lhs) | rhs;
54  return lhs;
55 }
56 
57 } // namespace docwire
58 
59 #endif //DOCWIRE_PARSING_CHAIN_H
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
A utility class that simplifies declaring function attributes that need to be stored without requirin...
Definition: ref_or_owned.h:34
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19