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 
14 
15 namespace msgpack {
16 
20 
21 struct null_visitor {
22  bool visit_nil() {
23  return true;
24  }
25  bool visit_boolean(bool /*v*/) {
26  return true;
27  }
28  bool visit_positive_integer(uint64_t /*v*/) {
29  return true;
30  }
31  bool visit_negative_integer(int64_t /*v*/) {
32  return true;
33  }
34  bool visit_float32(float /*v*/) {
35  return true;
36  }
37  bool visit_float64(double /*v*/) {
38  return true;
39  }
40  bool visit_str(const char* /*v*/, uint32_t /*size*/) {
41  return true;
42  }
43  bool visit_bin(const char* /*v*/, uint32_t /*size*/) {
44  return true;
45  }
46  bool visit_ext(const char* /*v*/, uint32_t /*size*/) {
47  return true;
48  }
49  bool start_array(uint32_t /*num_elements*/) {
50  return true;
51  }
53  return true;
54  }
55  bool end_array_item() {
56  return true;
57  }
58  bool end_array() {
59  return true;
60  }
61  bool start_map(uint32_t /*num_kv_pairs*/) {
62  return true;
63  }
64  bool start_map_key() {
65  return true;
66  }
67  bool end_map_key() {
68  return true;
69  }
70  bool start_map_value() {
71  return true;
72  }
73  bool end_map_value() {
74  return true;
75  }
76  bool end_map() {
77  return true;
78  }
79  void parse_error(size_t /*parsed_offset*/, size_t /*error_offset*/) {
80  }
81  void insufficient_bytes(size_t /*parsed_offset*/, size_t /*error_offset*/) {
82  }
83  bool referenced() const {
84  return false;
85  }
86  void set_referenced(bool /*referenced*/) {
87  }
88 };
89 
91 } // MSGPACK_API_VERSION_NAMESPACE(v2)
93 
94 } // namespace msgpack
95 
96 #endif // MSGPACK_V2_NULL_VISITOR_HPP
Definition: adaptor_base.hpp:15
Definition: null_visitor.hpp:21
bool visit_positive_integer(uint64_t)
Definition: null_visitor.hpp:28
bool end_map_value()
Definition: null_visitor.hpp:73
bool end_array()
Definition: null_visitor.hpp:58
bool start_map_key()
Definition: null_visitor.hpp:64
bool end_map()
Definition: null_visitor.hpp:76
void insufficient_bytes(size_t, size_t)
Definition: null_visitor.hpp:81
bool start_map_value()
Definition: null_visitor.hpp:70
bool end_map_key()
Definition: null_visitor.hpp:67
bool visit_float64(double)
Definition: null_visitor.hpp:37
bool start_array(uint32_t)
Definition: null_visitor.hpp:49
bool start_array_item()
Definition: null_visitor.hpp:52
bool visit_negative_integer(int64_t)
Definition: null_visitor.hpp:31
bool visit_float32(float)
Definition: null_visitor.hpp:34
bool start_map(uint32_t)
Definition: null_visitor.hpp:61
bool visit_bin(const char *, uint32_t)
Definition: null_visitor.hpp:43
bool visit_nil()
Definition: null_visitor.hpp:22
bool visit_ext(const char *, uint32_t)
Definition: null_visitor.hpp:46
bool referenced() const
Definition: null_visitor.hpp:83
bool visit_str(const char *, uint32_t)
Definition: null_visitor.hpp:40
void set_referenced(bool)
Definition: null_visitor.hpp:86
void parse_error(size_t, size_t)
Definition: null_visitor.hpp:79
bool end_array_item()
Definition: null_visitor.hpp:55
bool visit_boolean(bool)
Definition: null_visitor.hpp:25
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66