SFCGAL 2.3.0
SFCGAL::io::OBJ::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.
 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.

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

◆ RecursionGuard() [1/3]

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

Increments the recursion depth counter.

Parameters
depthRefreference to the recursion depth counter

◆ RecursionGuard() [2/3]

SFCGAL::detail::io::RecursionGuard::RecursionGuard ( const RecursionGuard & )
delete

◆ RecursionGuard() [3/3]

◆ ~RecursionGuard()

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Member Data Documentation

◆ depth

Reference to the recursion depth counter being guarded.