tesseract v5.3.3.20231005
tesseract::INT_CLASS_STRUCT Struct Reference

#include <intproto.h>

Public Member Functions

 INT_CLASS_STRUCT ()=default
 
 INT_CLASS_STRUCT (int MaxNumProtos, int MaxNumConfigs)
 
 ~INT_CLASS_STRUCT ()
 

Public Attributes

uint16_t NumProtos = 0
 
uint8_t NumProtoSets = 0
 
uint8_t NumConfigs = 0
 
PROTO_SET_STRUCTProtoSets [MAX_NUM_PROTO_SETS]
 
std::vector< uint8_t > ProtoLengths
 
uint16_t ConfigLengths [MAX_NUM_CONFIGS]
 
int font_set_id = 0
 

Detailed Description

Definition at line 93 of file intproto.h.

Constructor & Destructor Documentation

◆ INT_CLASS_STRUCT() [1/2]

tesseract::INT_CLASS_STRUCT::INT_CLASS_STRUCT ( )
default

◆ INT_CLASS_STRUCT() [2/2]

tesseract::INT_CLASS_STRUCT::INT_CLASS_STRUCT ( int  MaxNumProtos,
int  MaxNumConfigs 
)

This constructor creates a new integer class data structure and returns it. Sufficient space is allocated to handle the specified number of protos and configs.

Parameters
MaxNumProtosnumber of protos to allocate space for
MaxNumConfigsnumber of configs to allocate space for

Definition at line 575 of file intproto.cpp.

575 :
576 NumProtos(0),
578 NumConfigs(0),
580{
581 assert(MaxNumConfigs <= MAX_NUM_CONFIGS);
583
584 for (int i = 0; i < NumProtoSets; i++) {
585 /* allocate space for a proto set, install in class, and initialize */
586 auto ProtoSet = new PROTO_SET_STRUCT;
587 memset(ProtoSet, 0, sizeof(*ProtoSet));
588 ProtoSets[i] = ProtoSet;
589
590 /* allocate space for the proto lengths and install in class */
591 }
592 memset(ConfigLengths, 0, sizeof(ConfigLengths));
593}
#define MaxNumIntProtosIn(C)
Definition: intproto.h:145
#define MAX_NUM_PROTO_SETS
Definition: intproto.h:50
#define MAX_NUM_CONFIGS
Definition: intproto.h:47
#define PROTOS_PER_PROTO_SET
Definition: intproto.h:49
PROTO_SET_STRUCT * ProtoSets[MAX_NUM_PROTO_SETS]
Definition: intproto.h:100
uint16_t ConfigLengths[MAX_NUM_CONFIGS]
Definition: intproto.h:102
std::vector< uint8_t > ProtoLengths
Definition: intproto.h:101

◆ ~INT_CLASS_STRUCT()

tesseract::INT_CLASS_STRUCT::~INT_CLASS_STRUCT ( )

Definition at line 595 of file intproto.cpp.

595 {
596 for (int i = 0; i < NumProtoSets; i++) {
597 delete ProtoSets[i];
598 }
599}

Member Data Documentation

◆ ConfigLengths

uint16_t tesseract::INT_CLASS_STRUCT::ConfigLengths[MAX_NUM_CONFIGS]

Definition at line 102 of file intproto.h.

◆ font_set_id

int tesseract::INT_CLASS_STRUCT::font_set_id = 0

Definition at line 103 of file intproto.h.

◆ NumConfigs

uint8_t tesseract::INT_CLASS_STRUCT::NumConfigs = 0

Definition at line 99 of file intproto.h.

◆ NumProtos

uint16_t tesseract::INT_CLASS_STRUCT::NumProtos = 0

Definition at line 97 of file intproto.h.

◆ NumProtoSets

uint8_t tesseract::INT_CLASS_STRUCT::NumProtoSets = 0

Definition at line 98 of file intproto.h.

◆ ProtoLengths

std::vector<uint8_t> tesseract::INT_CLASS_STRUCT::ProtoLengths

Definition at line 101 of file intproto.h.

◆ ProtoSets

PROTO_SET_STRUCT* tesseract::INT_CLASS_STRUCT::ProtoSets[MAX_NUM_PROTO_SETS]

Definition at line 100 of file intproto.h.


The documentation for this struct was generated from the following files: