Bug 77150 - Add template for C++ accessor (setter and getter) methods
Summary: Add template for C++ accessor (setter and getter) methods
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-10 04:08 UTC by Steven T. Hatton
Modified: 2004-12-16 23:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven T. Hatton 2004-03-10 04:08:43 UTC
Version:           3.0.90-CVS (using KDE 3.2 BRANCH >= 20040204, SuSE)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:          Linux (i686) release 2.4.21-99-default

I decided to make this formal. You can backtrack through the mailing list from here:

http://lists.kde.org/?l=kdevelop-devel&m=107886709010442&w=2

> 
> Does someone have a paradigm for this they would like to share?

Sascha Herrmann <starfox899 () web ! de>

Hi,
i wont claim to set up a paradigm but in my eyes that should look like:

class test {
public:
     test();
     ~test();
     // get...
     const double& getSize() const;
     // set... (for "big" structures or whenever copying takes to long)
     void setSize(const double& newValue);
     // maybe better for standard types
     void setSize(const double newValue);
protected:
     double m_Size;
};

setters should be void because modern error handling should be done with 
exceptions (that`s what i think!). To improve things further we should 
create a template for get/setters so anybody can choose his favorite style.

Alexander Dymo <cloudtemple () mksat ! net>

I like this one ;)

public:
	void setMemberName(const type &memberName)
	type memberName() const
private:
	type m_memberName;
Comment 1 Alexander Dymo 2004-12-16 23:52:25 UTC
Implemented in CVS by Jonas Jacobi.