SFCGAL  2.3.0
Public Member Functions | Public Attributes | List of all members
SFCGAL::detail::io::RecursionGuard Struct Reference

Guard to increment/decrement a recursion depth counter. More...

#include <RecursionGuard.h>

Public Member Functions

 RecursionGuard (int &depthRef)
 Increments the recursion depth counter. More...
 
 RecursionGuard (const RecursionGuard &)=delete
 
 RecursionGuard (RecursionGuard &&)=delete
 
auto operator= (const RecursionGuard &) -> RecursionGuard &=delete
 
auto operator= (RecursionGuard &&) -> RecursionGuard &=delete
 
 ~RecursionGuard ()
 

Public Attributes

int & depth
 Reference to the recursion depth counter being guarded. More...
 

Detailed Description

Guard to increment/decrement a recursion depth counter.

Used in parsers and exporters (WKB, WKT, OBJ, STL, VTK) to guard against unbounded recursion depth. The depth counter is incremented on construction and decremented on destruction, even if an exception is thrown.

Constructor & Destructor Documentation

SFCGAL::detail::io::RecursionGuard::RecursionGuard ( int &  depthRef)
inlineexplicit

Increments the recursion depth counter.

Parameters
depthRefreference to the recursion depth counter
SFCGAL::detail::io::RecursionGuard::RecursionGuard ( const RecursionGuard &  )
delete
SFCGAL::detail::io::RecursionGuard::RecursionGuard ( RecursionGuard &&  )
delete
SFCGAL::detail::io::RecursionGuard::~RecursionGuard ( )
inline

Member Function Documentation

auto SFCGAL::detail::io::RecursionGuard::operator= ( const RecursionGuard &  ) -> RecursionGuard &=delete
delete
auto SFCGAL::detail::io::RecursionGuard::operator= ( RecursionGuard &&  ) -> RecursionGuard &=delete
delete

Member Data Documentation

int& SFCGAL::detail::io::RecursionGuard::depth

Reference to the recursion depth counter being guarded.