Public Member Functions | Private Member Functions | Private Attributes | List of all members
CVocAdmin Class Reference

Vocabulary Administration class. More...

#include <vocadmin.H>

Public Member Functions

 CVocAdmin (const size_t &nNumWords, const bool &bDebug)
 Constructor.
 ~CVocAdmin ()
 Destructor.
size_t GetLearnPos (bool bRandom)
 Get the next learning position.
void MarkAsLearnedStack (size_t idx)
 Mark position idx as learned in the bit array stack.
void MarkAsLearned (size_t idx)
 Mark position idx as learned in the bit array.
bool IsFinished ()
 Is learning process finished function.

Private Member Functions

void printBits ()
 Helper function.
void initArrStack ()
 Helper function.

Private Attributes

size_t * m_pBitArrLearned
 Learned bit array with m_nNumArrDim dimensions.
size_t * m_pBitArrLearnedStack
 Learned bit array stack with m_nNumArrDim dimensions.
size_t m_nNumUnlearnedWords
 number of unlearned words
size_t m_nNumUnlearnedWordsStack
 number of unlearned words in the current stack
size_t m_nNumArrDim
 Number of array dimensions in m_pBitArrLearned and m_pBitArrLearnedStack.
size_t m_nLastLearnPos
 number of the last learn position
bool m_bDebug
 debug mode

Detailed Description

Vocabulary Administration class.

This class controls the learning process. It administrates a bit array with the current learning status and handles the current learning position as well.

Constructor & Destructor Documentation

CVocAdmin::CVocAdmin ( const size_t &  nNumWords,
const bool &  bDebug 
)

Constructor.

This constructor initializes a bit array with numWords positions. and sets the debug mode.

Parameters
nNumWordssize from the learning bit array.
bDebugenable or disable the debug mode.
CVocAdmin::~CVocAdmin ( )

Destructor.

This destructor releases the allocated memory.

Member Function Documentation

size_t CVocAdmin::GetLearnPos ( bool  bRandom)

Get the next learning position.

This function returns a unlearned position x. If the random mode is disabled, x is equal the current position + 1.

Parameters
bRandomenable or disable the random mode.
Returns
This function returns the index number from the next learning position.
void CVocAdmin::initArrStack ( )
private

Helper function.

This function initializes a second learning bit array. CVocAdmin will need this array, if the stack mode is enabled.

See Also
MarkAsLearnedStack
bool CVocAdmin::IsFinished ( )

Is learning process finished function.

This function returns true, if every position in the learning bit array is 1.

Returns
This function returns true, if the learning process is finished; otherwise false.
void CVocAdmin::MarkAsLearned ( size_t  idx)

Mark position idx as learned in the bit array.

This function changes the bit idx in the learning bit array to 1. It will be used, if the stack by stack mode is disabled or vocatra is in the last stack.

Parameters
idxlearned position in the current array.
See Also
MarkAsLearnedStack()
Finish()
void CVocAdmin::MarkAsLearnedStack ( size_t  idx)

Mark position idx as learned in the bit array stack.

This function changes the bit idx in the learning bit array stack to 1. It will be used, if vocatra is not in the last stack and the stack by stack mode is enabled.

Parameters
idxlearned position in the current array stack.
See Also
MarksAsLearned()
Finish()
void CVocAdmin::printBits ( )
private

Helper function.

This function prints the learning bit array to the standard output, if the debug mode is enabled.

References CVocatraInfo::GetName().

Member Data Documentation

size_t CVocAdmin::m_nNumArrDim
private

Number of array dimensions in m_pBitArrLearned and m_pBitArrLearnedStack.

See Also
m_pBitArrLearned
size_t* CVocAdmin::m_pBitArrLearned
private

Learned bit array with m_nNumArrDim dimensions.

Every dimension contains 32 positions and every position resp. bit represents a word. If the bit is set to 1 means that the word is already learned.

See Also
m_nNumArrDim
MarkAsLearned()
size_t* CVocAdmin::m_pBitArrLearnedStack
private

Learned bit array stack with m_nNumArrDim dimensions.

See Also
m_nNumArrDim
m_npBitArrLearned
MarkAsLearnedStack()

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

Get Vocatra at SourceForge.net. Fast, secure and Free Open Source software downloads Generated for Vocatra by doxygen