Free Electron
Public Member Functions | Private Attributes | List of all members
YAML::DepthGuard< max_depth > Class Template Referencefinal

The DepthGuard class DepthGuard takes a reference to an integer. More...

#include <depthguard.h>

Public Member Functions

 DepthGuard (int &depth_, const Mark &mark_, const std::string &msg_)
 
 DepthGuard (const DepthGuard &copy_ctor)=delete
 
 DepthGuard (DepthGuard &&move_ctor)=delete
 
DepthGuardoperator= (const DepthGuard &copy_assign)=delete
 
DepthGuardoperator= (DepthGuard &&move_assign)=delete
 
int current_depth () const
 

Private Attributes

int & m_depth
 

Detailed Description

template<int max_depth = 2000>
class YAML::DepthGuard< max_depth >

The DepthGuard class DepthGuard takes a reference to an integer.

It increments the integer upon construction of DepthGuard and decrements the integer upon destruction.

If the integer would be incremented past max_depth, then an exception is thrown. This is ideally geared toward guarding against deep recursion.

Parameters
max_depthcompile-time configurable maximum depth.

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