added get and set methods

I hope this syntax is correct for c++...?