Declare friend class Arduboy2Ex

A friend class named Arduboy2Ex is declared by the Arduboy2 classes.
The intention is to allow a sketch to create an Arduboy2Ex class which would
have access to the private and protected members of the Arduboy2 classes.
It is hoped that this may eliminate the need to create an entire local copy
of the library, in order to extend the functionality, in most circumstances.
This commit is contained in:
Scott Allen 2016-11-22 17:45:38 -05:00
parent 0b0c111757
commit e5a7dc5982
3 changed files with 44 additions and 1 deletions

View File

@ -117,7 +117,7 @@ struct Point
* _minus_ text output. * _minus_ text output.
* *
* This class in inherited by Arduboy2, so if text output functions are * This class in inherited by Arduboy2, so if text output functions are
* requred Arduboy2 should be used instead. * required Arduboy2 should be used instead.
* *
* \note * \note
* \parblock * \parblock
@ -139,10 +139,20 @@ struct Point
* \endcode * \endcode
* \endparblock * \endparblock
* *
* \note
* \parblock
* A friend class named _Arduboy2Ex_ is declared by this class. The intention
* is to allow a sketch to create an _Arduboy2Ex_ class which would have access
* to the private and protected members of the Arduboy2Base class. It is hoped
* that this may eliminate the need to create an entire local copy of the
* library, in order to extend the functionality, in most circumstances.
* \endparblock
*
* \see Arduboy2 * \see Arduboy2
*/ */
class Arduboy2Base : public Arduboy2Core class Arduboy2Base : public Arduboy2Core
{ {
friend class Arduboy2Ex;
friend class Sprites; friend class Sprites;
public: public:
@ -819,10 +829,19 @@ class Arduboy2Base : public Arduboy2Core
* This class is derived from Arduboy2Base. It provides text output functions * This class is derived from Arduboy2Base. It provides text output functions
* in addition to all the functions inherited from Arduboy2Base. * in addition to all the functions inherited from Arduboy2Base.
* *
* \note
* A friend class named _Arduboy2Ex_ is declared by this class. The intention
* is to allow a sketch to create an _Arduboy2Ex_ class which would have access
* to the private and protected members of the Arduboy2 class. It is hoped
* that this may eliminate the need to create an entire local copy of the
* library, in order to extend the functionality, in most circumstances.
*
* \see Arduboy2Base * \see Arduboy2Base
*/ */
class Arduboy2 : public Print, public Arduboy2Base class Arduboy2 : public Print, public Arduboy2Base
{ {
friend class Arduboy2Ex;
public: public:
Arduboy2(); Arduboy2();

View File

@ -60,9 +60,20 @@
* ArduboyTones sound(arduboy.audio.enabled); * ArduboyTones sound(arduboy.audio.enabled);
* \endcode * \endcode
* \endparblock * \endparblock
*
* \note
* \parblock
* A friend class named _Arduboy2Ex_ is declared by this class. The intention
* is to allow a sketch to create an _Arduboy2Ex_ class which would have access
* to the private and protected members of the Arduboy2Audio class. It is hoped
* that this may eliminate the need to create an entire local copy of the
* library, in order to extend the functionality, in most circumstances.
* \endparblock
*/ */
class Arduboy2Audio class Arduboy2Audio
{ {
friend class Arduboy2Ex;
public: public:
/** \brief /** \brief
* Initialize the speaker based on the current mute setting. * Initialize the speaker based on the current mute setting.

View File

@ -145,9 +145,18 @@
* \details * \details
* This class is inherited by Arduboy2Base and thus also Arduboy2, so wouldn't * This class is inherited by Arduboy2Base and thus also Arduboy2, so wouldn't
* normally be used directly by a sketch. * normally be used directly by a sketch.
*
* \note
* A friend class named _Arduboy2Ex_ is declared by this class. The intention
* is to allow a sketch to create an _Arduboy2Ex_ class which would have access
* to the private and protected members of the Arduboy2Core class. It is hoped
* that this may eliminate the need to create an entire local copy of the
* library, in order to extend the functionality, in most circumstances.
*/ */
class Arduboy2Core class Arduboy2Core
{ {
friend class Arduboy2Ex;
public: public:
Arduboy2Core(); Arduboy2Core();
@ -422,18 +431,22 @@ class Arduboy2Core
* to 255 (fully on). * to 255 (fully on).
* *
* \note * \note
* \parblock
* Certain libraries that take control of the hardware timers may interfere * Certain libraries that take control of the hardware timers may interfere
* with the ability of this function to properly control the RGB LED. * with the ability of this function to properly control the RGB LED.
*_ArduboyPlaytune_ is one such library known to do this. *_ArduboyPlaytune_ is one such library known to do this.
* The digitalWriteRGB() function will still work properly in this case. * The digitalWriteRGB() function will still work properly in this case.
* \endparblock
* *
* \note * \note
* \parblock
* Many of the Kickstarter Arduboys were accidentally shipped with the * Many of the Kickstarter Arduboys were accidentally shipped with the
* RGB LED installed incorrectly. For these units, the green LED cannot be * RGB LED installed incorrectly. For these units, the green LED cannot be
* lit. As long as the green led is set to off, setting the red LED will * lit. As long as the green led is set to off, setting the red LED will
* actually control the blue LED and setting the blue LED will actually * actually control the blue LED and setting the blue LED will actually
* control the red LED. If the green LED is turned fully on, none of the * control the red LED. If the green LED is turned fully on, none of the
* LEDs will light. * LEDs will light.
* \endparblock
* *
* \see digitalWriteRGB() * \see digitalWriteRGB()
*/ */