Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I ONLY NEED THE LAST BULLET, ONLY MOVECONSTRUCTOR AND MOVE ASSIGNMENT RecordSet Module Design and code a class named RecordSet that manages a dynamically allocated

I ONLY NEED THE LAST BULLET, ONLY MOVECONSTRUCTOR AND MOVE ASSIGNMENT

RecordSet Module

Design and code a class named RecordSet that manages a dynamically allocated array of std::strings. Your class keeps track of the number of strings currently stored and defines the following member functions:

  • a no-argument default constructor
  • a 1-argument constructor that receives the address of a C-style null terminated string containing the name of a file from which this member function populates the current object. This function
    1. reads the file to count the number of records present (the record delimiter should be a single space ' ')
    2. allocates memory for that number records in the array
    3. re-reads the file and loads the records into the array.
  • a copy constructor
  • a copy assignment operator
  • a destructor
  • size_t size(): a query that returns the number of records stored in the current object.
  • std::string getRecord(size_t): a query that returns the record at the index received as parameter. If the index is invalid, this function should return the empty string.
  • upgrade the RecordSet class to include a move constructor and a move assignment operator.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions