Skip to content

Commit

Permalink
Add override to derived virtual methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Sep 27, 2023
1 parent 7d5d73f commit 3504644
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion inc/MicroBitRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ namespace codal
* A background, low priority callback that is triggered whenever the processor is idle.
* Here, we empty our queue of received packets, and pass them onto higher level protocol handlers.
*/
virtual void idleCallback();
virtual void idleCallback() override;

/**
* Determines the number of packets ready to be processed.
Expand Down
2 changes: 1 addition & 1 deletion inc/MicroBitThermometer.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace codal
/**
* Periodic callback from MicroBit idle thread.
*/
virtual void idleCallback();
virtual void idleCallback() override;

private:

Expand Down
14 changes: 7 additions & 7 deletions inc/Mixer2.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MixerChannel : public DataSink
/**
* Deliver the next available ManagedBuffer to our downstream caller.
*/
virtual int pullRequest();
virtual int pullRequest() override;
virtual ~MixerChannel() {};

/**
Expand Down Expand Up @@ -169,27 +169,27 @@ class Mixer2 : public DataSource
/**
* Provide the next available ManagedBuffer to our downstream caller, if available.
*/
virtual ManagedBuffer pull();
virtual ManagedBuffer pull() override;

/**
* Define a downstream component for data stream.
*
* @sink The component that data will be delivered to, when it is availiable
*/
virtual void connect(DataSink &sink);
virtual void connect(DataSink &sink) override;

/**
* Determines if this source is connected to a downstream component
*
* @return true If a downstream is connected
* @return false If a downstream is not connected
*/
bool isConnected();
virtual bool isConnected() override;

/**
* Determines the output format for the Mixer.
*/
virtual int getFormat();
virtual int getFormat() override;

/**
* Defines the output format for the Mixer.
Expand All @@ -199,7 +199,7 @@ class Mixer2 : public DataSource
* DATASTREAM_FORMAT_8BIT_UNSIGNED
* DATASTREAM_FORMAT_8BIT_SIGNED
*/
virtual int setFormat(int format);
virtual int setFormat(int format) override;


/**
Expand Down Expand Up @@ -241,7 +241,7 @@ class Mixer2 : public DataSource
* Determine the sample rate output of this Mixer.
* @return The sample rate (samples per second) of the mixer output.
*/
float getSampleRate();
virtual float getSampleRate() override;

/**
* Defines an optional bit mask to logical OR with each sample.
Expand Down
6 changes: 3 additions & 3 deletions inc/NRF52LedMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace codal
*
* @note Only enables the display if the display is currently disabled.
*/
virtual void enable();
virtual void enable() override;

/**
* Disables the display, which releases control of the GPIO pins used by the display,
Expand All @@ -134,7 +134,7 @@ namespace codal
*
* @note Only disables the display if the display is currently enabled.
*/
virtual void disable();
virtual void disable() override;

/**
* Clears the display of any remaining pixels.
Expand All @@ -154,7 +154,7 @@ namespace codal
*
* @return DEVICE_OK, or DEVICE_INVALID_PARAMETER
*/
int setBrightness(int b);
virtual int setBrightness(int b) override;

/**
* Determines the last ambient light level sensed.
Expand Down
4 changes: 2 additions & 2 deletions inc/SoundEmojiSynthesizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace codal
* @return true If a downstream is connected
* @return false If a downstream is not connected
*/
bool isConnected();
virtual bool isConnected() override;

/**
* Determine the data format of the buffers streamed out of this component.
Expand Down Expand Up @@ -207,7 +207,7 @@ namespace codal
* Determine the sample rate currently in use by this Synthesizer.
* @return the current sample rate, in Hz.
*/
float getSampleRate();
virtual float getSampleRate() override;

/**
* Change the sample rate used by this Synthesizer,
Expand Down
6 changes: 3 additions & 3 deletions inc/SoundOutputPin.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ namespace codal
/**
* Relevant DataSource operations
*/
virtual ManagedBuffer pull();
virtual int getFormat();
virtual ManagedBuffer pull() override;
virtual int getFormat() override;

/**
* Determines if this source is connected to a downstream component
*
* @return true If a downstream is connected
* @return false If a downstream is not connected
*/
bool isConnected();
virtual bool isConnected() override;

private:

Expand Down
2 changes: 1 addition & 1 deletion inc/bluetooth/MicroBitBLEManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class MicroBitBLEManager : public CodalComponent
* Periodic callback in thread context.
* We use this here purely to safely issue a disconnect operation after a pairing operation is complete.
*/
void idleCallback();
virtual void idleCallback() override;

/**
* Stops any currently running BLE advertisements
Expand Down
2 changes: 1 addition & 1 deletion inc/bluetooth/MicroBitEventService.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MicroBitEventService : public MicroBitBLEService, MicroBitComponent
* Periodic callback from MicroBit scheduler.
* If we're no longer connected, remove any registered Message Bus listeners.
*/
virtual void idleCallback();
virtual void idleCallback() override;

/**
* Callback. Invoked when any of our attributes are written via BLE.
Expand Down
2 changes: 1 addition & 1 deletion inc/bluetooth/MicroBitIOPinService.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class MicroBitIOPinService : public MicroBitBLEService, MicroBitComponent
* Check if any of the pins we're watching need updating. Notify any connected
* device with any changes.
*/
virtual void idleCallback();
virtual void idleCallback() override;

private:

Expand Down

0 comments on commit 3504644

Please sign in to comment.