File: SchemaImpl.hpp

package info (click to toggle)
reflect-cpp 0.18.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,524 kB
  • sloc: cpp: 44,484; python: 131; makefile: 30; sh: 3
file content (46 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef RFL_AVRO_SCHEMAIMPL_HPP_
#define RFL_AVRO_SCHEMAIMPL_HPP_

#include <avro.h>

#include <string>

#include "../Box.hpp"
#include "../Result.hpp"

namespace rfl::avro {

class SchemaImpl {
 public:
  SchemaImpl(const std::string& _json_str);

  ~SchemaImpl();

  SchemaImpl(const SchemaImpl& _other) = delete;

  SchemaImpl(SchemaImpl&& _other) noexcept;

  SchemaImpl& operator=(const SchemaImpl& _other) = delete;

  SchemaImpl& operator=(SchemaImpl&& _other) noexcept;

  /// The JSON string used to create this schema.
  const std::string& json_str() const { return json_str_; }

  /// The interface used to create new values.
  avro_value_iface_t* iface() const { return iface_; };

 private:
  /// The JSON string used to create the schema.
  std::string json_str_;

  /// The actual schema
  Box<avro_schema_t> schema_;

  /// The interface used to create new, generic classes.
  avro_value_iface_t* iface_;
};

}  // namespace rfl::avro

#endif