PhoenixHPCProxy  0.8.0
Lightweight HPC proxy
Loading...
Searching...
No Matches
backend.h File Reference
+ Include dependency graph for backend.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool cpp_backend (PSource &source, const PString &libName, const PPath &outputDir)
 Save a vector of PSource in the output directory.
 
bool cpp_backend (PVecSource &vecSource, const PString &libName, const PPath &outputDir)
 Save a vector of PSource in the output directory.
 
PString cpp_licenceSaveStr ()
 Get the licence in string.
 
PString getUpdateFunction (const PPath &fileName)
 Get the update type name of the given file.
 

Function Documentation

◆ cpp_backend() [1/2]

bool cpp_backend ( PSource & source,
const PString & libName,
const PPath & outputDir )

Save a vector of PSource in the output directory.

Parameters
source: source to be saved
libName: filename to a binary library
outputDir: output directory where to save PSource
Returns
true on success, false otherwise

Definition at line 190 of file backend.cpp.

190 {
191 PString headerSrc(cpp_backendHeader(source));
192 PString sourceSrc(cpp_backendSource(source, libName));
193 PPath baseFileName(source.getName().eraseExtension());
194 PPath outputHeaderFile(outputDir / baseFileName + PString(".h"));
195 PPath outputSourceFile(outputDir / baseFileName + PString(".cpp"));
196 if(!outputHeaderFile.saveFileContent(headerSrc)){
197 std::cerr << "cpp_backend : cannot save header file '"<<outputHeaderFile<<"'" << std::endl;
198 return false;
199 }
200 std::cout << "cpp_backend : create header file '"<<outputHeaderFile<<"'" <<std::endl;
201 if(!outputSourceFile.saveFileContent(sourceSrc)){
202 std::cerr << "cpp_backend : cannot save source file '"<<outputSourceFile<<"'" << std::endl;
203 return false;
204 }
205 std::cout << "cpp_backend : create source file '"<<outputSourceFile<<"'" <<std::endl;
206 return true;
207}
PString cpp_backendHeader(PSource &source)
Save the header of the given PSource.
Definition backend.cpp:107
PString cpp_backendSource(PSource &source, const PString &libName)
Save the source of the given PSource.
Definition backend.cpp:158
const PPath & getName() const
Gets the name of the PSource.
Definition PRepr.cpp:337

References cpp_backendHeader(), cpp_backendSource(), and PSource::getName().

Referenced by cpp_backend(), and createSourceFromConfig().

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

◆ cpp_backend() [2/2]

bool cpp_backend ( PVecSource & vecSource,
const PString & libName,
const PPath & outputDir )

Save a vector of PSource in the output directory.

Parameters
vecSource: vector of source
libName: filename to a binary library
outputDir: output directory where to save PSource
Returns
true on success, false otherwise

Definition at line 215 of file backend.cpp.

215 {
216 bool b(true);
217 for(PVecSource::iterator it(vecSource.begin()); it != vecSource.end(); ++it){
218 b &= cpp_backend(*it, libName, outputDir);
219 }
220 return b;
221}
bool cpp_backend(PSource &source, const PString &libName, const PPath &outputDir)
Save a vector of PSource in the output directory.
Definition backend.cpp:190

References cpp_backend().

+ Here is the call graph for this function:

◆ cpp_licenceSaveStr()

PString cpp_licenceSaveStr ( )

Get the licence in string.

Returns
licence in string

Definition at line 12 of file backend.cpp.

12 {
13 PString body("");
14 body += "/***************************************\n";
15 body += "\tAuteur : Pierre Aubert\n";
16 body += "\tMail : pierre.aubert@lapp.in2p3.fr\n";
17 body += "\tLicence : CeCILL-C\n";
18 body += "****************************************/\n\n\n";
19
20 body += "//Warning : this file has been generated automatically by the phoenix_hpc_proxy program\n";
21 body += "//You can find it at https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/PhoenixHPCProxy\n";
22 body += "//Do NOT modify it\n\n\n";
23 return body;
24}

Referenced by cpp_backendHeader(), cpp_backendProxyLoaderHeader(), cpp_backendProxyLoaderSource(), and cpp_backendSource().

+ Here is the caller graph for this function:

◆ getUpdateFunction()

PString getUpdateFunction ( const PPath & fileName)

Get the update type name of the given file.

Parameters
fileName: file name
Returns
corresponding function name

Definition at line 46 of file backend.cpp.

46 {
47 return "update_" + fileName.eraseExtension();
48}

Referenced by cpp_backendHeader(), cpp_backendProxyLoaderUpdateSource(), and cpp_backendSource().

+ Here is the caller graph for this function: