tesseract  4.0.0-1-g2a2b
_TessFunctionResultCallback_0_0< del, R > Class Template Reference

#include <tesscallback.h>

Inheritance diagram for _TessFunctionResultCallback_0_0< del, R >:
TessResultCallback< R >

Public Types

typedef TessResultCallback< R > base
 
typedef R(* FunctionSignature) ()
 

Public Member Functions

 _TessFunctionResultCallback_0_0 (FunctionSignature function)
 
virtual R Run ()
 
- Public Member Functions inherited from TessResultCallback< R >
virtual ~TessResultCallback ()
 

Detailed Description

template<bool del, class R>
class _TessFunctionResultCallback_0_0< del, R >

Definition at line 205 of file tesscallback.h.

Member Typedef Documentation

◆ base

template<bool del, class R>
typedef TessResultCallback<R> _TessFunctionResultCallback_0_0< del, R >::base

Definition at line 207 of file tesscallback.h.

◆ FunctionSignature

template<bool del, class R>
typedef R(* _TessFunctionResultCallback_0_0< del, R >::FunctionSignature) ()

Definition at line 208 of file tesscallback.h.

Constructor & Destructor Documentation

◆ _TessFunctionResultCallback_0_0()

template<bool del, class R>
_TessFunctionResultCallback_0_0< del, R >::_TessFunctionResultCallback_0_0 ( FunctionSignature  function)
inline

Definition at line 214 of file tesscallback.h.

216  : function_(function) {
217  }

Member Function Documentation

◆ Run()

template<bool del, class R>
virtual R _TessFunctionResultCallback_0_0< del, R >::Run ( )
inlinevirtual

Implements TessResultCallback< R >.

Definition at line 219 of file tesscallback.h.

219  {
220  if (!del) {
221  R result = (*function_)();
222  return result;
223  } else {
224  R result = (*function_)();
225  // zero out the pointer to ensure segfault if used again
226  function_ = nullptr;
227  delete this;
228  return result;
229  }
230  }

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