PhoenixGenerator  2.0.4
Set of tools to generate code
Loading...
Searching...
No Matches
wrapper_generator_struct.h File Reference
+ Include dependency graph for wrapper_generator_struct.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool wrapper_generator_class_full (const PWrapperTraitBackendManager &manager, const ProjectParam &projectParam)
 Generate the full sources and related unit tests from configuration.
 

Function Documentation

◆ wrapper_generator_class_full()

bool wrapper_generator_class_full ( const PWrapperTraitBackendManager & manager,
const ProjectParam & projectParam )

Generate the full sources and related unit tests from configuration.

Parameters
manager: PTraitBackendManager which handles all trait backend
projectParam: description of classes and how and where to generate sources and test
Returns
true on success, false otherwise

Definition at line 525 of file wrapper_generator_struct.cpp.

525 {
526 bool b(true);
527 b &= projectParam.outputSourceDir.createDirectory();
528 b &= projectParam.outputTestDir.createDirectory();
529 ProjectParam updatedParam(projectParam);
530 updatedParam.mode.moduleName = "py"+updatedParam.name.toLower();
531 for(const PDataConfig & config : updatedParam.vecDataConfig){
532 PPath baseFileName = config.getFileName().getFileName().eraseExtension();
533 b &= wrapper_generator_class_cpp(manager, config.getVecClassConfig(), updatedParam.outputSourceDir, baseFileName, updatedParam.mode, config.getVecInclude());
534 b &= wrapper_generator_class_cpp_test(manager, updatedParam.outputTestDir, updatedParam.mode.moduleName, config.getVecClassConfig(), updatedParam.mode);
535 }
536 PPath outputModuleSrc = updatedParam.outputSourceDir / PPath(updatedParam.mode.moduleName) / PPath(updatedParam.name.toLower() + "_module.cpp");
537 b &= project_wrapper_moduleGeneratorMain(outputModuleSrc, updatedParam);
538 b &= project_wrapper_generator_setuppy(manager, updatedParam, updatedParam.outputProjectDir / PPath("setup.py"), updatedParam.version);
539 return b;
540}
Class to describe a basic class.
Definition PDataConfig.h:17
const PVecClassConfig & getVecClassConfig() const
Get the vector of all config class of the current pdata file.
const PPath & getFileName() const
Get the file name of the current PDataConfig.
const PVecPath & getVecInclude() const
Get the vector of all include files of the current pdata file.
Set of parameters to generate a project.
PPath outputTestDir
Output path of the unit tests.
PPath outputSourceDir
Output path of the sources.
bool project_wrapper_moduleGeneratorMain(const PPath &fileName, const ProjectParam &projectParam)
Create the main wrapper module.
bool wrapper_generator_class_cpp_test(const PWrapperTraitBackendManager &manager, const PPath &testDirectory, const PString &moduleName, const std::vector< PClassConfig > &vecClassConfig, const GeneratorMode &mode)
Generate the test for all class inside the module.
bool wrapper_generator_class_cpp(const PWrapperTraitBackendManager &manager, const std::vector< PClassConfig > &vecClassConfig, const PPath &outputSourceDir, const PPath &baseFileName, const GeneratorMode &mode, const PVecPath &vecInclude)
Creates wrapper header and source files.
bool project_wrapper_generator_setuppy(const PWrapperTraitBackendManager &manager, const ProjectParam &projectParam, const PPath &fileNameSetup, const PString &projectVersion)
Create the readme of the project directory.

References PDataConfig::getFileName(), PDataConfig::getVecClassConfig(), PDataConfig::getVecInclude(), ProjectParam::mode, GeneratorMode::moduleName, ProjectParam::name, ProjectParam::outputProjectDir, ProjectParam::outputSourceDir, ProjectParam::outputTestDir, project_wrapper_generator_setuppy(), project_wrapper_moduleGeneratorMain(), ProjectParam::vecDataConfig, ProjectParam::version, wrapper_generator_class_cpp(), and wrapper_generator_class_cpp_test().

Referenced by simple_project_generate_source().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: