All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
dump::DumperBase Class Reference

Base class for data dumpers. More...

#include <DumperBase.h>

Inheritance diagram for dump::DumperBase:
dump::raw::OpDetWaveformDumper

Classes

struct  IndentSettings
 

Public Member Functions

 DumperBase ()
 Default constructor: no indentation. More...
 
template<typename Stream >
decltype(auto) indenter (Stream &&out) const
 Returns an Indenter object tied to this dumper and out stream. More...
 

Protected Member Functions

IndentSettingsindentSettings ()
 
IndentSettings const & indentSettings () const
 
IndentSettingssaveIndentSettings ()
 Stacks a copy of the current settings, and returns the "new" ones. More...
 
IndentSettingsrestoreIndentSettings ()
 Restores and returns the last saved settings. More...
 

Private Attributes

std::vector< IndentSettingsfIndentSettings
 All indentation settings. More...
 

Detailed Description

Base class for data dumpers.

This class provides some basic and common infrastructure:

Definition at line 39 of file DumperBase.h.

Constructor & Destructor Documentation

dump::DumperBase::DumperBase ( )
inline

Default constructor: no indentation.

Definition at line 61 of file DumperBase.h.

61 : fIndentSettings{ {} } {}
std::vector< IndentSettings > fIndentSettings
All indentation settings.
Definition: DumperBase.h:56

Member Function Documentation

template<typename Stream >
decltype(auto) dump::DumperBase::indenter ( Stream &&  out) const
inline

Returns an Indenter object tied to this dumper and out stream.

Definition at line 202 of file DumperBase.h.

203  { return Indenter<Stream>(std::forward<Stream>(out), *this); }
IndentSettings& dump::DumperBase::indentSettings ( )
inlineprotected

Definition at line 207 of file DumperBase.h.

207 { return fIndentSettings.back(); }
std::vector< IndentSettings > fIndentSettings
All indentation settings.
Definition: DumperBase.h:56
IndentSettings const& dump::DumperBase::indentSettings ( ) const
inlineprotected

Definition at line 208 of file DumperBase.h.

209  { return fIndentSettings.back(); }
std::vector< IndentSettings > fIndentSettings
All indentation settings.
Definition: DumperBase.h:56
IndentSettings& dump::DumperBase::restoreIndentSettings ( )
inlineprotected

Restores and returns the last saved settings.

Definition at line 220 of file DumperBase.h.

221  {
222  if (fIndentSettings.size() > 1U) fIndentSettings.pop_back();
223  assert(!fIndentSettings.empty());
224  return indentSettings();
225  }
IndentSettings & indentSettings()
Definition: DumperBase.h:207
std::vector< IndentSettings > fIndentSettings
All indentation settings.
Definition: DumperBase.h:56
IndentSettings& dump::DumperBase::saveIndentSettings ( )
inlineprotected

Stacks a copy of the current settings, and returns the "new" ones.

Definition at line 212 of file DumperBase.h.

213  {
214  auto oldSettings = indentSettings();
215  fIndentSettings.push_back(std::move(oldSettings));
216  return indentSettings();
217  }
IndentSettings & indentSettings()
Definition: DumperBase.h:207
std::vector< IndentSettings > fIndentSettings
All indentation settings.
Definition: DumperBase.h:56

Member Data Documentation

std::vector<IndentSettings> dump::DumperBase::fIndentSettings
private

All indentation settings.

Definition at line 56 of file DumperBase.h.


The documentation for this class was generated from the following file: