Using C++ with the Create

1 reply [Last post]
Title: NooBot
Joined: 02/25/2013
BotPoints: 8
User offline. Last seen 9 years 28 weeks ago.

I figured the code for controlling the Create using C++ would be something like

Create createObject;

However, the constructor for the Create class is private so there is an error. I was wondering if anyone had gotten this working or knows how to do it.

I think I found the solution but I won't be able to test it until tomorrow. After looking at create.cpp more I found the instance() function which returns a pointer to the static create object. So to control the create I think you would do something like:

Create* createObj = Create::instance();

Beta's picture
Title: The Magnificent
Joined: 02/24/2012
BotPoints: 266
User offline. Last seen 8 years 32 weeks ago.

This is correct usage. For more information about this pattern, see the wikipedia page on singletons.

Let me know if you have any more questions about the create c++ library. It's pretty expansive.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.