Code:
IOCheckList::IOCheckList(unsigned int *checkBits, int row,
int col, int NoOfChecks, const char *displayChars,
void (*help)(IOScreen *)):IOField(row,col){
int i = 0;
this->NoOfChecks = NoOfChecks;
strcpy(this->displayChars,displayChars);
for(;i<NoOfChecks;i++){
*checkBits|= (1 << i);
}
data = (void*)checkBits;
editable = 1;
}
Public constructor:
IOCheckList(unsigned int *checkBits, int row, int col, int NoOfChecks,
const char *displayChars,
void (*help)(IOScreen *) = NULL);
this constructor like other IOField’s children passes the values of row and col to the parent constructor. Afterwards it sets the “data” attribute to the value of checkBits parameter. NoOfChecks and displayChars parameters are IOCheckList specific values and are copied into corresponding attributes of the class.. NoOfChecks is the number of checkboxes that are displayed on the screen and also the number of corresponding bits in *checkBits that is tied to the values of the checkboxes. Therefore if the value of NoOfChecks is 5, then five checkboxes will be display()ed and five first bits of *checkBits will be set. the three characters at displayChars will be copied into the displayChars attribute of the class. These characters will be used to show a check box.
Does my code correspond correctly with the requirements? I am a bit flaky on the bit and pointer stuff.