pupene  0.2.0
null-pupper.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "pupper.h"
4 
5 /** \file
6  * NopPupper was also a tempting name.
7  */
8 namespace pupene {
9  /**
10  * Does nothing by itself. but can be used together with
11  * DebugPupper when inspecting existing objects.
12  *
13  * @see to_debug
14  */
15  class NullPupper : public Pupper<NullPupper> {
16  public:
17  NullPupper() = default;
18  ~NullPupper() override = default;
19 
20  template<typename T>
21  PupPolicy begin(T& /*value*/, const Meta& /*meta*/) {
22  return PupPolicy::pup_object;
23  }
24 
25  void end(const Meta& /*meta*/) {}
26 
27  template<typename T>
28  void pup(T& /*value*/, const Meta& /*meta*/) {}
29  };
30 
31 }
void pup(T &, const Meta &)
Definition: null-pupper.h:28
pup object using its component pup functions
Definition: debug.cpp:4
PupPolicy begin(T &, const Meta &)
Definition: null-pupper.h:21
Holds name and type of objects.
Definition: traits.h:7
~NullPupper() override=default
void end(const Meta &)
Definition: null-pupper.h:25
NullPupper()=default
Does nothing by itself.
Definition: null-pupper.h:15
PupPolicy
Controls an object&#39;s pup() behavior.
Definition: pupper.h:17
Base class for working with puppable types.
Definition: pupper.h:83