24 fs <<
"#include \"phoenix_check_stream.h\"" << std::endl;
90 PString name(classConfig.
getName());
94 fs <<
"PHOENIX_CHECK_STREAM_ENUM("<<name<<
"::"<<name<<
")" << std::endl << std::endl;
97 if(listTemplate.size() != 0lu){
98 fs <<
"///@brief Generic "<<name<<
" check function" << std::endl;
100 fs <<
"struct CheckStream<"<<fullName << mode.
defTemplate<<
">{" << std::endl;
101 fs <<
"\tstatic bool check_stream(const std::string & fieldDescription, const "<<fullName << mode.
defTemplate<<
" & data, const "<<fullName << mode.
defTemplate<<
" & reference, std::ostream & out);" << std::endl;
102 fs <<
"\t\tbool b(true);" << std::endl;
104 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
105 fs <<
"\t\tb &= CheckStream<"<<it->getType()<<
">::check_stream(fieldDescription + \"\\n- "<<name<<
"::"<<it->getName()<<
"\", data.get"<<it->getName().firstToUpper()<<
"(), reference.get"<<it->getName().firstToUpper()<<
"(), out);" << std::endl;
107 fs <<
"\t\treturn b;" << std::endl;
108 fs <<
"\t}" << std::endl;
109 fs <<
"};" << std::endl;
111 fs <<
"///@brief Generic "<<name<<
" Check function" << std::endl;
112 fs <<
"template<>" << std::endl;
113 fs <<
"struct CheckStream<"<<fullName<<
">{" << std::endl;
114 fs <<
"\tstatic bool check_stream(const std::string & fieldDescription, const "<<fullName<<
" & data, const "<<fullName<<
" & reference, std::ostream & out);" << std::endl;
115 fs <<
"};" << std::endl;
117 fs << std::endl << std::endl;
128 PString name(classConfig.
getName());
131 if(listTemplate.size() == 0lu){
132 fs <<
"///Check Stream for a "<<name<<
"" << std::endl;
133 fs <<
"/**\t@param fieldDescription : description of the field to be checked" << std::endl;
134 fs <<
" * \t@param data : data to be checked" << std::endl;
135 fs <<
" * \t@param reference : reference of the check" << std::endl;
136 fs <<
" * \t@param out : ostream used to collect feed back in case of error (std::cerr or a logger)" << std::endl;
137 fs <<
" * \t@return true on success, false otherwise" << std::endl;
138 fs <<
"*/" << std::endl;
139 fs <<
"bool CheckStream<"<<fullName<<
">::check_stream(const std::string & fieldDescription, const "<<fullName<<
" & data, const "<<fullName<<
" & reference, std::ostream & out){" << std::endl;
140 fs <<
"\tbool b(true);" << std::endl;
142 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
143 fs <<
"\tb &= CheckStream<"<<it->getType()<<
">::check_stream(fieldDescription + \"\\n- "<<name<<
"::"<<it->getName()<<
"\", data.get"<<it->getName().firstToUpper()<<
"(), reference.get"<<it->getName().firstToUpper()<<
"(), out);" << std::endl;
145 fs <<
"\treturn b;" << std::endl;
146 fs <<
"}" << std::endl;
148 fs << std::endl << std::endl;
std::vector< PClassAttribute > PVecClassAttribute
virtual void privateMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of private methods.
virtual void privateMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of private methods.
virtual void publicMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of public methods.
virtual void publicMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of public methods.
virtual void classExtraFunctionDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of extra functions.
CppTraitCheckStream()
Consctructor of CppTraitCheckStream.
virtual ~CppTraitCheckStream()
Desctructor of CppTraitCheckStream.
virtual void protectedMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of protected methods.
virtual void headerExtraInclude(std::ofstream &fs, const GeneratorMode &mode) const
Add extra include on the header.
virtual void protectedMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of protected methods.
virtual void classExtraFunctionImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of extra functions.
Class to describe a basic class.
PString getFullName() const
Returns the full name of the class including the namespace.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.
const PVecString & getListTemplate() const
Returns the list of the template of the class.
const PString & getName() const
Returns the class name.
bool getIsEnum() const
Say if the current PClassConfig is an enum.
PString defTemplate
Template definition for the class header.
PString templateDeclaration
Template declaration of the method implementation.
bool enableCheckStream
True to enable check stream interface generator.