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

#include <tesscallback.h>

Inheritance diagram for _TessFunctionResultCallback_0_1< del, R, A1 >:
TessResultCallback1< R, A1 >

Public Types

typedef TessResultCallback1< R, A1 > base
 
typedef R(* FunctionSignature) (A1)
 

Public Member Functions

 _TessFunctionResultCallback_0_1 (FunctionSignature function)
 
virtual R Run (A1 a1)
 
- Public Member Functions inherited from TessResultCallback1< R, A1 >
virtual ~TessResultCallback1 ()
 

Detailed Description

template<bool del, class R, class A1>
class _TessFunctionResultCallback_0_1< del, R, A1 >

Definition at line 1885 of file tesscallback.h.

Member Typedef Documentation

◆ base

template<bool del, class R, class A1>
typedef TessResultCallback1<R,A1> _TessFunctionResultCallback_0_1< del, R, A1 >::base

Definition at line 1887 of file tesscallback.h.

◆ FunctionSignature

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

Definition at line 1888 of file tesscallback.h.

Constructor & Destructor Documentation

◆ _TessFunctionResultCallback_0_1()

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

Definition at line 1894 of file tesscallback.h.

1896  : function_(function) {
1897  }

Member Function Documentation

◆ Run()

template<bool del, class R, class A1>
virtual R _TessFunctionResultCallback_0_1< del, R, A1 >::Run ( A1  a1)
inlinevirtual

Implements TessResultCallback1< R, A1 >.

Definition at line 1899 of file tesscallback.h.

1899  {
1900  if (!del) {
1901  R result = (*function_)(a1);
1902  return result;
1903  } else {
1904  R result = (*function_)(a1);
1905  // zero out the pointer to ensure segfault if used again
1906  function_ = nullptr;
1907  delete this;
1908  return result;
1909  }
1910  }

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