Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I. To compile an abstract template class AbstractCell - a descriptor of a cell;
- Articles (protected):
- int m_row; // order
- int m_col; // column
- T m_value; // value of any type
- Construction:
- - Understandable
- -Explicity
- Virtual Features:
- -Accessor / value mutant of any type
- virtual T getValue () const = 0;
- virtual void setValue (const T & value) = 0;
- II. To create a template class CCellDescr - descriptor of a table cell of any type,
- successor to AbstractCell.
- Public members:
- Construction:
- - Understandable
- -Explicity
- -Copping
- Features:
- getRow, getCol, T getValue ()
- void setValue (const T & value)
- Operator:
- -To discharge into a stream;
- III. To compile a template class CColumn, a successor to CCellDescr for
- a description of a column of data of any type;
- Private members:
- column name
- vector from CCellDescr
- Public member:
- static int m_iCounter - static variable consecutive counter
- Construction:
- - Understandable
- -Explicible (column name)
- Features:
- - Add a cell to the specified row
- - returns the value in the specified order
- - returns the vector size
- - returns the column name
- - static function to generate consecutive numbers
- Exceptions:
- When trying to access (add / read) beyond the dimension
- IV.Main function:
- 1. Create 2 CColumn objects for two types of data: string and int
- 2. Initializes the data in objects with random values โโof both types
- 3. Outputs information from the console output objects using the output operator.
- 4. Handles access errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement