Is there any tool that generates set and get methods for a class automatically.
Just I create classes very frequently and would like to have a tool which for each class-member wil generate the following functions automatically:
Member_Type getMemberName() const; //in header file
Member_Type getMemberName() const //in source file
{
return member;
}
void setMemberName(const Member_Type & val); //in header
void setMemberName(const Member_Type & val) //in source file
{
member = val;
}
I have met a macro like this but did not like the idea:
#define GETSETVAR(type, name) \
private: \
type name; \
public: \
const type& get##name##() const { return name; } \
void set##name##(const type& newval) { name = newval; }
May be someone knows how to do that with MS Visual Studio, or eny other tool?