The preferred solution there is to use "Has A" rather than "Is A" and
reduce the size of the language.  On all code bases that I have worked on,
private inheritance has been ruled as something to avoid.


On Thu, Apr 17, 2014 at 6:28 PM, DjScribbles <notifications@github.com>wrote:

> In examples/CppCheesyVisionSample/CheesyVisionRobot/jankyTask.h:
>
> > + public:
> > +  /**
> > +   * @brief Constructor which takes an optional taskname. In the absence of a task name,
> > +   *        a task name will be created based upon the current system-time.
> > +   */
> > +  JankyTask(const char* taskName = NULL, UINT32 priority = Task::kDefaultPriority);
> > +  virtual ~JankyTask();
> > +
> > +  /**
> > +   * @brief PRIVATE- Do not call this function externally as it's only passed to the constructor to initialize the object.
> > +   *
> > +   * This function sets up an operating-system task which will perpetually loop the Run() function.
> > +   * @note When running, loops wait 2ms between calls to Run(). During pause, loop waits 50ms.
> > +   * @param JankyTask the given JankyTask object to run.
> > +   */
> > +  static void JankyPrivateStarterTask(JankyTask* task);
>
> This is class reused throughout our code, in most contexts, the Run
> function should be public, however in this context it would open the class
> up to user error, which is why I chose to use private inheritance instead.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Team254/CheesyVision/pull/1/files#r11761492>
> .
>