Tesseract  3.02
ETEXT_DESC Class Reference

#include <ocrclass.h>

List of all members.

Public Member Functions

 ETEXT_DESC ()
void set_deadline_msecs (inT32 deadline_msecs)
bool deadline_exceeded () const

Public Attributes

inT16 count
inT16 progress
inT8 more_to_come
volatile inT8 ocr_alive
inT8 err_code
CANCEL_FUNC cancel
void * cancel_this
struct timeval end_time
EANYCODE_CHAR text [1]

Detailed Description

Definition at line 112 of file ocrclass.h.


Constructor & Destructor Documentation

ETEXT_DESC::ETEXT_DESC ( ) [inline]

Definition at line 125 of file ocrclass.h.

               : count(0), progress(0), more_to_come(0), ocr_alive(0),
                   err_code(0), cancel(NULL), cancel_this(NULL) {
    end_time.tv_sec = 0;
    end_time.tv_usec = 0;
  }

Member Function Documentation

bool ETEXT_DESC::deadline_exceeded ( ) const [inline]

Definition at line 144 of file ocrclass.h.

                                 {
    if (end_time.tv_sec == 0 && end_time.tv_usec == 0) return false;
    struct timeval now;
    gettimeofday(&now, NULL);
    return (now.tv_sec > end_time.tv_sec || (now.tv_sec == end_time.tv_sec &&
                                             now.tv_usec > end_time.tv_usec));
  }
void ETEXT_DESC::set_deadline_msecs ( inT32  deadline_msecs) [inline]

Definition at line 132 of file ocrclass.h.

                                                {
    gettimeofday(&end_time, NULL);
    inT32 deadline_secs = deadline_msecs / 1000;
    end_time.tv_sec += deadline_secs;
    end_time.tv_usec += (deadline_msecs -  deadline_secs * 1000) * 1000;
    if (end_time.tv_usec > 1000000) {
      end_time.tv_usec -= 1000000;
      ++end_time.tv_sec;
    }
  }

Member Data Documentation

Definition at line 119 of file ocrclass.h.

Definition at line 120 of file ocrclass.h.

Definition at line 114 of file ocrclass.h.

struct timeval ETEXT_DESC::end_time

Definition at line 121 of file ocrclass.h.

Definition at line 118 of file ocrclass.h.

Definition at line 116 of file ocrclass.h.

Definition at line 117 of file ocrclass.h.

Definition at line 115 of file ocrclass.h.

Definition at line 123 of file ocrclass.h.


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