24 fs <<
"#include \"phoenix_data_stream.h\"" << std::endl;
34 PString name(classConfig.
getName());
36 fs <<
"\t\t///Load the current "<<name<<
" with a stream" << std::endl;
37 fs <<
"\t\t/** @param[out] ds : stream to be used" << std::endl;
38 fs <<
"\t\t * @return true on success, false otherwise" << std::endl;
39 fs <<
"\t\t*/" << std::endl;
40 fs <<
"\t\ttemplate<typename Stream, DataStreamMode::DataStreamMode Mode>" << std::endl;
41 fs <<
"\t\tbool readWriteStream(Stream & ds){" << std::endl;
42 fs <<
"\t\t\tbool b(true);" << std::endl;
45 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
46 fs <<
"\t\t\tb &= DataStream<Stream, Mode, "<<it->getType()<<
" >::data_stream(ds, p_" << it->getName() <<
");" << std::endl;
49 fs <<
"\t\t\treturn b;" << std::endl;
50 fs <<
"\t\t}" << std::endl << std::endl;
106 PString name(classConfig.
getName());
108 fs <<
"PHOENIX_DATA_STREAM_ENUM("<<name<<
"::"<<name<<
")" << std::endl << std::endl;
111 fs <<
"///@brief Generic "<<name<<
" serialisation/deserialisation, load/save and size function for PhoenixDataStream" << std::endl;
112 fs <<
"template<typename Stream, DataStreamMode::DataStreamMode Mode>" << std::endl;
113 fs <<
"struct DataStream<Stream, Mode, "<<name<<
">{" << std::endl;
114 fs <<
"\t///Generic function to load/save/serialise/deserialise "<<name << std::endl;
115 fs <<
"\t/**\t@param[out] ds : stream to be used" << std::endl;
116 fs <<
"\t * \t@param data : "<<name<<
" to be used" << std::endl;
117 fs <<
"\t * \t@return true on success, false otherwise" << std::endl;
118 fs <<
"\t*/" << std::endl;
119 fs <<
"\tstatic bool data_stream(Stream & ds, "<<name<<
" & data){" << std::endl;
120 fs <<
"\t\treturn data.readWriteStream<Stream, Mode>(ds);" << std::endl;
121 fs <<
"\t}" << std::endl;
122 fs <<
"};" << std::endl << std::endl;
std::vector< PClassAttribute > PVecClassAttribute
virtual void protectedMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of protected methods.
virtual void publicMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of public methods.
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 classExtraFunctionImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of extra functions.
CppTraitDataStream()
Consctructor of CppTraitDataStream.
virtual void classExtraFunctionDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of extra functions.
virtual ~CppTraitDataStream()
Desctructor of CppTraitDataStream.
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.
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 enableDataStream
True to enable data stream interface generator.