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 |
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.
CVocAdmin::CVocAdmin | ( | const size_t & | nNumWords, |
const bool & | bDebug | ||
) |
Constructor.
This constructor initializes a bit array with numWords positions. and sets the debug mode.
nNumWords | size from the learning bit array. |
bDebug | enable or disable the debug mode. |
CVocAdmin::~CVocAdmin | ( | ) |
Destructor.
This destructor releases the allocated memory.
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.
bRandom | enable or disable the random mode. |
|
private |
Helper function.
This function initializes a second learning bit array. CVocAdmin will need this array, if the stack mode is enabled.
bool CVocAdmin::IsFinished | ( | ) |
Is learning process finished function.
This function returns true, if every position in the learning bit array is 1.
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.
idx | learned position in the current array. |
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.
idx | learned position in the current array stack. |
|
private |
Helper function.
This function prints the learning bit array to the standard output, if the debug mode is enabled.
References CVocatraInfo::GetName().
|
private |
Number of array dimensions in m_pBitArrLearned and m_pBitArrLearnedStack.
|
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.
|
private |
Learned bit array stack with m_nNumArrDim dimensions.
Generated for Vocatra by |