The reference is your key to a comprehensive understanding of the Relay Class
<aside> β This is very similar to what you will be doing in data structures. You need a good idea of how Object Oriented Programming works. I would suggest going over some of those concepts before you begin. The purpose of this class is to create a container that stores relays and helps keep those objects in memory. The person coding the actual API does not have to worry too much about organizing relay objects.
</aside>
The relay class provides us with a container to store relay objects. It provides us with functions to add, remove, initialize, find, get, remove, pop, getAll, and update the relays.
Constructor: initializes container.
str: provides a function that is called when you try to print out a relay Container
addRelay(): adds relay to the container
initializeLow: goes through all the relays in the container and sets them to low
getRelayIndex: gets the relay at a particular index
getRelay: gets a relay based on id
<aside> π‘ This returns a Relay object so we will probably have to wait for the team to write that class before we return anything
</aside>
removeRelay: removes relay with a particular ID
popRelay: removes relay based on index
getAllRelays: gets all relays from the database and returns them
<aside> π‘ this function makes use of the database class so we will need to wait for that class to be somewhat done
</aside>
updateRelays: updates the state of a relay in the database
<aside> β You will need to modify some of the existing functions after the database class is done because in addition to adding relays to our internal container, we will need to add them to the database.
</aside>
We will also add a database implementation. However, since that will be worked on while you are coding this class the API is likely not ready. So we will make those changes later. This is one of those challenges in software development that are really annoying and you have to rely on another team to complete their deliverables on time. But we are ECLAIR so weβre chilling!