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

#include <tesscallback.h>

Inheritance diagram for _TessFunctionResultCallback_0_2< del, R, A1, A2 >:
TessResultCallback2< R, A1, A2 >

Public Types

typedef TessResultCallback2< R, A1, A2 > base
 
typedef R(* FunctionSignature) (A1, A2)
 

Public Member Functions

 _TessFunctionResultCallback_0_2 (FunctionSignature function)
 
virtual R Run (A1 a1, A2 a2)
 
- Public Member Functions inherited from TessResultCallback2< R, A1, A2 >
virtual ~TessResultCallback2 ()
 

Detailed Description

template<bool del, class R, class A1, class A2>
class _TessFunctionResultCallback_0_2< del, R, A1, A2 >

Definition at line 3490 of file tesscallback.h.

Member Typedef Documentation

◆ base

template<bool del, class R, class A1, class A2>
typedef TessResultCallback2<R,A1,A2> _TessFunctionResultCallback_0_2< del, R, A1, A2 >::base

Definition at line 3492 of file tesscallback.h.

◆ FunctionSignature

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

Definition at line 3493 of file tesscallback.h.

Constructor & Destructor Documentation

◆ _TessFunctionResultCallback_0_2()

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

Definition at line 3499 of file tesscallback.h.

3501  : function_(function) {
3502  }

Member Function Documentation

◆ Run()

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

Implements TessResultCallback2< R, A1, A2 >.

Definition at line 3504 of file tesscallback.h.

3504  {
3505  if (!del) {
3506  R result = (*function_)(a1,a2);
3507  return result;
3508  } else {
3509  R result = (*function_)(a1,a2);
3510  // zero out the pointer to ensure segfault if used again
3511  function_ = nullptr;
3512  delete this;
3513  return result;
3514  }
3515  }

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