PhoenixGenerator  2.0.0
Set of tools to generate code
PClassGenerator.h
Go to the documentation of this file.
1 
2 /***************************************
3  Auteur : Pierre Aubert
4  Mail : pierre.aubert@lapp.in2p3.fr
5  Licence : CeCILL-C
6 ****************************************/
7 
8 #ifndef __PCLASS_GENERATOR_H__
9 #define __PCLASS_GENERATOR_H__
10 
11 #include <fstream>
12 #include "PPath.h"
13 
16  public:
18  virtual ~PClassGenerator();
19 
20  bool saveFileImplDef(const PPath & baseFileName);
21  bool saveFileDef(const PPath & fileNameInclude, const PPath & fileNameSource);
22  bool saveFileImpl(const PPath & fileNameSource, const PPath & fileNameInclude);
23 
24  bool saveClassDef(std::ofstream & fs);
25  bool saveClassImpl(std::ofstream & fs);
26 
27  void setClassName(const PString & className);
28  void setTemplateDefVar(const PString & templateDef);
29 
30  private:
32 
33  void saveTemplateDefinition(std::ofstream & fs);
34  void saveTemplateEndDefinition(std::ofstream & fs, const PPath & fileNameSource);
35 
36  void saveTemplateBeginImpl(std::ofstream & fs, const PPath & fileNameInclude);
37  void saveTemplateEndImpl(std::ofstream & fs);
38 
39  void saveConstructorDef(std::ofstream & fs);
40  void saveConstructorImpl(std::ofstream & fs);
41  void saveDestructorDef(std::ofstream & fs);
42  void saveDestructorImpl(std::ofstream & fs);
43 
44  void saveInitialisationFunctionDef(std::ofstream & fs);
45  void saveInitialisationFunctionImpl(std::ofstream & fs);
46 
47  void saveCopyContructorDef(std::ofstream & fs);
48  void saveCopyContructorImpl(std::ofstream & fs);
49  void saveCopyEqualOperatorDef(std::ofstream & fs);
50  void saveCopyEqualOperatorImpl(std::ofstream & fs);
51  void saveCopyFunctionDef(std::ofstream & fs);
52  void saveCopyFunctionImpl(std::ofstream & fs);
53 
54 
71 
72 };
73 
74 
75 
76 
77 
78 #endif
79 
Class generator.
virtual ~PClassGenerator()
Destructor of PClassGenerator.
bool saveFileImplDef(const PPath &baseFileName)
Saves both files include and sources of the class.
bool saveClassImpl(std::ofstream &fs)
Saves class implementation.
PString p_className
Name of the class.
bool p_useTemplate
Says if we need to use template.
void setClassName(const PString &className)
Set the class name.
void saveCopyFunctionImpl(std::ofstream &fs)
Saves the implementation of the copy function.
void saveDestructorDef(std::ofstream &fs)
Saves the defition of the destructor.
PString p_classBrief
Brief description of the class.
void saveConstructorImpl(std::ofstream &fs)
Saves the implementation of the constructor.
void saveCopyContructorDef(std::ofstream &fs)
Saves the defition of the copy constructor.
PString p_templateListVar
Template list var.
void saveInitialisationFunctionDef(std::ofstream &fs)
Saves the definition of the initialisation function.
bool saveFileImpl(const PPath &fileNameSource, const PPath &fileNameInclude)
Saves class implementation.
bool p_useCopyFunction
True if we need to use a copy function.
void saveCopyFunctionDef(std::ofstream &fs)
Saves the defition of the copy function.
PString p_classNameSpace
Namespace of the class.
void saveTemplateBeginImpl(std::ofstream &fs, const PPath &fileNameInclude)
Saves class implementation.
bool saveFileDef(const PPath &fileNameInclude, const PPath &fileNameSource)
Saves class definition.
void saveConstructorDef(std::ofstream &fs)
Saves the defition of the constructor.
PClassGenerator()
Constructor of PClassGenerator.
void saveTemplateDefinition(std::ofstream &fs)
Saves the template defition.
void setTemplateDefVar(const PString &templateDef)
Set the template definition.
void saveCopyEqualOperatorImpl(std::ofstream &fs)
Saves the implementation of the equal operator constructor.
void saveCopyEqualOperatorDef(std::ofstream &fs)
Saves the defition of the equal operator constructor.
void saveInitialisationFunctionImpl(std::ofstream &fs)
Saves the implementation of the initialisation function.
void saveTemplateEndImpl(std::ofstream &fs)
Saves class implementation template end.
bool saveClassDef(std::ofstream &fs)
Saves class definition.
void saveTemplateEndDefinition(std::ofstream &fs, const PPath &fileNameSource)
Saves the template defition.
PString p_templateDefVar
Template def var.
void saveDestructorImpl(std::ofstream &fs)
Saves the implementation of the destructor.
void initialisationPClassGenerator()
Initialisation function of PClassGenerator.
PString p_classTypeName
Name of the class type (with template if there is one)
void saveCopyContructorImpl(std::ofstream &fs)
Saves the implementation of the copy constructor.
Path of a directory or a file.
Definition: PPath.h:17
Extends the std::string.
Definition: PString.h:16