tudocomp
– The TU Dortmund Compression Framework
EspContext.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tudocomp/util/View.hpp>
8 
9 namespace tdc {namespace esp {
10  template<typename ipd_t>
11  class EspContext {
12  const Env* m_env;
13  public:
15 
16  template<typename F>
17  auto with_env(F f) -> decltype(f(*m_env)) {
18  if (m_env != nullptr) {
19  return f(*m_env);
20  }
21  return decltype(f(*m_env))();
22  }
23 
26 
27  EspContext(const Env* e, bool silent):
28  m_env(e),
29  debug(std::cout, !silent, false)
30  {}
31 
34  bool behavior_iter_log_mode = false; // UNUSED
35 
36  template<typename T>
37  SLP generate_grammar(T&& s);
38  };
39 }}
Contains the text compression and encoding framework.
Definition: namespaces.hpp:11
DebugContext debug
Definition: EspContext.hpp:24
EspContext(const Env *e, bool silent)
Definition: EspContext.hpp:27
auto with_env(F f) -> decltype(f(*m_env))
Definition: EspContext.hpp:17
A const view into a slice of memory.
bool behavior_metablocks_maximimze_repeating
Definition: EspContext.hpp:32
Local environment for a compression/encoding/decompression call.
bool behavior_landmarks_tie_to_right
Definition: EspContext.hpp:33