MessagePack for C++
null_visitor.hpp
Go to the documentation of this file.
1 //
2 // MessagePack for C++ deserializing routine
3 //
4 // Copyright (C) 2017 KONDO Takatoshi
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 //
10 #ifndef MSGPACK_V2_NULL_VISITOR_HPP
11 #define MSGPACK_V2_NULL_VISITOR_HPP
12 
13 #include "msgpack/versioning.hpp"
14 #include "msgpack/cpp_config.hpp"
15 
16 namespace msgpack {
17 
21 
22 struct null_visitor {
23  bool visit_nil() {
24  return true;
25  }
26  bool visit_boolean(bool /*v*/) {
27  return true;
28  }
29  bool visit_positive_integer(uint64_t /*v*/) {
30  return true;
31  }
32  bool visit_negative_integer(int64_t /*v*/) {
33  return true;
34  }
35  bool visit_float(double /*v*/) {
36  return true;
37  }
38  bool visit_str(const char* /*v*/, uint32_t /*size*/) {
39  return true;
40  }
41  bool visit_bin(const char* /*v*/, uint32_t /*size*/) {
42  return true;
43  }
44  bool visit_ext(const char* /*v*/, uint32_t /*size*/) {
45  return true;
46  }
47  bool start_array(uint32_t /*num_elements*/) {
48  return true;
49  }
51  return true;
52  }
53  bool end_array_item() {
54  return true;
55  }
56  bool end_array() {
57  return true;
58  }
59  bool start_map(uint32_t /*num_kv_pairs*/) {
60  return true;
61  }
62  bool start_map_key() {
63  return true;
64  }
65  bool end_map_key() {
66  return true;
67  }
68  bool start_map_value() {
69  return true;
70  }
71  bool end_map_value() {
72  return true;
73  }
74  bool end_map() {
75  return true;
76  }
77  void parse_error(size_t /*parsed_offset*/, size_t /*error_offset*/) {
78  }
79  void insufficient_bytes(size_t /*parsed_offset*/, size_t /*error_offset*/) {
80  }
81  bool referenced() const {
82  return false;
83  }
84  void set_referenced(bool /*referenced*/) {
85  }
86 };
87 
89 } // MSGPACK_API_VERSION_NAMESPACE(v2)
91 
92 } // namespace msgpack
93 
94 #endif // MSGPACK_V2_NULL_VISITOR_HPP
bool referenced() const
Definition: null_visitor.hpp:81
void parse_error(size_t, size_t)
Definition: null_visitor.hpp:77
bool end_map_value()
Definition: null_visitor.hpp:71
bool start_array(uint32_t)
Definition: null_visitor.hpp:47
bool visit_float(double)
Definition: null_visitor.hpp:35
bool end_map()
Definition: null_visitor.hpp:74
Definition: adaptor_base.hpp:15
bool start_map_value()
Definition: null_visitor.hpp:68
bool start_array_item()
Definition: null_visitor.hpp:50
void set_referenced(bool)
Definition: null_visitor.hpp:84
bool visit_boolean(bool)
Definition: null_visitor.hpp:26
bool end_map_key()
Definition: null_visitor.hpp:65
bool visit_bin(const char *, uint32_t)
Definition: null_visitor.hpp:41
bool start_map(uint32_t)
Definition: null_visitor.hpp:59
bool visit_nil()
Definition: null_visitor.hpp:23
bool visit_positive_integer(uint64_t)
Definition: null_visitor.hpp:29
bool visit_str(const char *, uint32_t)
Definition: null_visitor.hpp:38
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
bool start_map_key()
Definition: null_visitor.hpp:62
Definition: null_visitor.hpp:22
bool visit_ext(const char *, uint32_t)
Definition: null_visitor.hpp:44
bool visit_negative_integer(int64_t)
Definition: null_visitor.hpp:32
bool end_array()
Definition: null_visitor.hpp:56
bool end_array_item()
Definition: null_visitor.hpp:53
void insufficient_bytes(size_t, size_t)
Definition: null_visitor.hpp:79