tudocomp
– The TU Dortmund Compression Framework
pre_header/Env.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstddef>
4 #include <cstdint>
5 #include <fstream>
6 #include <functional>
7 #include <iomanip>
8 #include <iostream>
9 #include <istream>
10 #include <map>
11 #include <memory>
12 #include <set>
13 #include <sstream>
14 #include <stack>
15 #include <stdexcept>
16 #include <streambuf>
17 #include <string>
18 #include <tuple>
19 #include <type_traits>
20 #include <unordered_map>
21 #include <vector>
22 
23 #include <glog/logging.h>
24 
25 #include <tudocomp/def.hpp>
26 #include <tudocomp/OptionValue.hpp>
27 
28 namespace tdc {
29 
30 class EnvRoot;
31 class Env;
32 
33 class EnvRoot {
34 private:
35  std::unique_ptr<AlgorithmValue> m_algo_value;
36 
37 public:
38  inline EnvRoot() {
39  }
40 
42  m_algo_value(std::make_unique<AlgorithmValue>(std::move(algo_value))) {
43  }
44 
45  inline ~EnvRoot() {
46  }
47 
48  inline AlgorithmValue& algo_value();
49 };
50 
55 class Env {
56  std::shared_ptr<EnvRoot> m_root;
57  AlgorithmValue m_node;
58 
59  inline const AlgorithmValue& algo() const;
60 
61 public:
62  inline Env() = delete;
63  inline Env(const Env& other) = delete;
64  inline Env(Env&& other);
65  inline Env(std::shared_ptr<EnvRoot> root,
66  const AlgorithmValue& node);
67  inline ~Env();
68 
69  inline const std::shared_ptr<EnvRoot>& root() const;
70 
72  inline void error(const std::string& msg) const;
73 
76  inline Env env_for_option(const std::string& option) const;
77 
79  inline const OptionValue& option(const std::string& option) const;
80 };
81 
82 }
Contains the text compression and encoding framework.
Definition: namespaces.hpp:11
EnvRoot(AlgorithmValue &&algo_value)
AlgorithmValue & algo_value()
Definition: Env.hpp:7
Local environment for a compression/encoding/decompression call.