Modifying .CPP files

Hey guys. I want to modify the RobotDrive.CPP file but i can’t find it in the wind river directory. I found the .h File but I need to add a member function to the .CPP file. Can anyone give me the directory path please thanks

~Xtreampb~

Pitt Pirates 2642

You have to download the library from wpi site, the source that comes with windriver is all pre compiled

http://first.wpi.edu/FRC/frcupdates.html

I have the updates and have downloaded the source code. Are you saying that i have to go to where i downloaded the source code, codify the .CPP and the .H files then re-install them?

Thanks

~Xtreampb~

Depending on “how” you want to change it, a good way would be to derive your own new class from RobotDrive and either override the methods you want to behave differently and/or add new methods and data to it. This is the beauty of object oriented programming.

I just want to add a single function to the already used RobotDrive class. I am using one of the previous functions in it, arcade drive, but i want to use a single drive function that uses a single PWM channel (we have more than we need ,24, so i was told i can use as many as i wanted) Even if i wanted to override the current one, i dont know how to do this in wind river. I can do it using Visual C++ (another question i have was could i export these libararys to VC++ libary colection but that is another topic for later)

That is a perfect situation for creating a new class that inherits from RobotDrive.

I would create a class like such:

class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}

and you can still have the other functions!

Generally, if you want all the public members in the base class visible for the “is-a” relationship, you would use public inheritance. You don’t see private inheritance used much.

ok thanks for all of yall’s help. I built my class and have implemented it into the code, unfortuanatly i wasn’t able to test the code before we had to ship it off but i have ran into an error with my deconstructor

error: declaration of 'Our_Drive::~Our_Drive()' outside of class is not definition

i dont have an error about the deconstructor in my header file, just in the CPP file. how do i fix this?

i fixed it, i had placed a simi colon after my function declaration, a rookie mistake:o