18PString
getter_createGetterDecl(
const PString & varType,
const PString & varName,
const PString & className,
bool isConst,
bool isPtr){
19 PString functionDecl(
"");
20 functionDecl +=
makeVarType(varType,
false, isConst, !isConst, isPtr) +
" ";
21 if(className !=
"") functionDecl += className +
"::";
22 functionDecl +=
"get" + varName.firstToUpper() +
"()";
42 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
43 fs <<
"\t\t" <<
getter_createGetterDecl(it->getType(), it->getName(),
"",
true, it->getIsPointer()) <<
" const;" << std::endl;
44 fs <<
"\t\t" <<
getter_createGetterDecl(it->getType(), it->getName(),
"",
false, it->getIsPointer()) <<
";" << std::endl;
56 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
57 fs <<
"///Gets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
58 fs <<
"/**\t@return " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
59 fs <<
"*/" << std::endl;
62 fs <<
"\treturn p_" << it->getName() <<
";" << std::endl;
63 fs <<
"}" << std::endl << std::endl;
64 fs <<
"///Gets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
65 fs <<
"/**\t@return " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
66 fs <<
"*/" << std::endl;
69 fs <<
"\treturn p_" << it->getName() <<
";" << std::endl;
70 fs <<
"}" << std::endl << std::endl;
PString getter_createGetterDecl(const PString &varType, const PString &varName, const PString &className, bool isConst, bool isPtr)
Creates a function decl for setters.
std::vector< PClassAttribute > PVecClassAttribute
CppTraitGetter()
Consctructor of CppTraitGetter.
virtual ~CppTraitGetter()
Desctructor of CppTraitGetter.
virtual void publicMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of methods.
virtual void publicMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of methods.
Class to describe a basic class.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.
const PString & getName() const
Returns the class name.
bool getIsEnum() const
Say if the current PClassConfig is an enum.
bool enableGetter
True to enable getters trait generator.
PString defTemplate
Template definition for the class header.
PString templateDeclaration
Template declaration of the method implementation.
PString makeVarType(const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr)
Makes the var type by taking account of the type.