24 fs <<
"#include \"phoenix_type_stream.h\"" << std::endl;
74 PString name(classConfig.
getName());
78 name = name +
"::" + name;
82 if(listTemplate.size() != 0LU){
83 fs <<
"///Get the name of the class " << name << std::endl;
84 fs <<
"/**\t@return name of the class " << name << std::endl;
85 fs <<
"*/" << std::endl;
87 fs <<
"std::string phoenix_getTypeName<"<<fullName << mode.
defTemplate <<
" >(){" << std::endl;
88 fs <<
"\treturn \""<<name<<
"\"";
90 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
91 fs <<
" + phoenix_getTypeToStr<"<<it->split(
' ').back()<<
">()";
94 fs <<
";" << std::endl;
95 fs <<
"}" << std::endl << std::endl;
98 fs <<
"template<>" << std::endl;
100 fs <<
"std::string phoenix_getTypeName<"<<(classConfig.
getIsEnum() ? name : fullName)<<
">();" << std::endl << std::endl;
111 PString name(classConfig.
getName());
113 fs <<
"///Get the name of the class " << name <<
" for PhoenixTypeStream" << std::endl;
114 fs <<
"/**\t@return name of the class " << name <<
" for PhoenixTypeStream" << std::endl;
115 fs <<
"*/" << std::endl;
118 name = name +
"::" + name;
122 if(listTemplate.size() == 0LU){
123 fs <<
"template<>" << std::endl;
127 fs <<
"std::string phoenix_getTypeName<"<<fullName << mode.
defTemplate <<
" >(){" << std::endl;
128 fs <<
"\treturn \""<<name<<
"\"";
129 if(listTemplate.size() != 0LU){
131 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
132 fs <<
" + phoenix_getTypeToStr<"<<it->split(
' ').back()<<
">()";
136 fs <<
";" << std::endl;
137 fs <<
"}" << std::endl << std::endl;
147 PString name(classConfig.
getName());
148 fs <<
"///Check TypeStream of class "+name+
"\n";
149 fs <<
"void check"+name+
"TypeStream(){\n";
151 name = name +
"::" + name;
153 fs <<
"\t"<<mode.
assertCall<<
"(phoenix_getTypeToStr<"<<name<<
">() == \""<<name<<
"\");\n";
164 PString name(classConfig.
getName());
165 fs <<
"\tcheck"+name+
"TypeStream();\n";
virtual ~CppTraitTypeStream()
Desctructor of CppTraitTypeStream.
virtual void privateMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of private methods.
virtual void classExtraFunctionImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of extra functions.
virtual void protectedMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of protected methods.
virtual void privateMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of private methods.
virtual void classExtraFunctionDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of extra functions.
virtual void testCallFunction(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Call of the test function.
virtual void testFunction(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of test function.
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.
CppTraitTypeStream()
Consctructor of CppTraitTypeStream.
Class to describe a basic class.
PString getFullName() const
Returns the full name of the class including the namespace.
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.
PString assertCall
Assert to be used.
bool enableTypeStream
True to enable type stream interface generator.