DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

Collections

Introduction

It is common to want to keep a collection of instances of items of the same type. This will allow to the same item to be reused, rather than create another item that is identically configured.

In particular, we will want to keep a collection of waveforms, a collection of envelopes, and a collection of instruments.

Our collections will require a unique name for each item in a collection. For example, “Cello” and “Violin” are different names we could use for two separate instruments. However, if we tried to store another “Violin” in the collection, it would overwrite the old item with the new one.

Assignment

In this assignment, you will create classes to represent collections of waveforms, envelopes, and instruments. These classes will be capable of storing and retrieving items. They will also allow for the collection to be iterated over.

Iterators

For each of our collections we will provide a begin and end method to allow for iteration over the collection. These methods will use the underlying iterators for the standard library class we are using for storage.

Programming Requirements

Create library-waveform/Waveforms.{h,cpp}

Waveforms Class

Data Members:

The Waveforms class should contain data members to track the following information. These data members should be protected or private. They are not allowed to be public.

public Type Definitions:

public Methods:

Update library-waveform/Makefile

Add Waveforms.{h,cpp} in the appropriate places to add them to the library and install the header file.

Create library-envelope/Envelopes.{h,cpp}

Envelopes Class

Data Members:

The Envelopes class should contain data members to track the following information. These data members should be protected or private. They are not allowed to be public.

public Type Definitions:

public Methods:

Update library-envelope/Makefile

Add Envelopes.{h,cpp} in the appropriate places to add them to the library and install the header file.

Create library-instrument/Instrumentarium.{h,cpp}

Instrumentarium Class

Data Members:

The Instrumentarium class should contain data members to track the following information. These data members should be protected or private. They are not allowed to be public.

public Type Definitions:

public Methods:

Update library-instrument/Makefile

Add Instrumentarium.{h,cpp} in the appropriate places to add them to the library and install the header file.

Additional Documentation

TBA

Grading Instructions

To receive credit for this assignment:

Extra Challenges (Not Required)

TBA

Last Updated 10/23/2024