CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::CCompiler< Base > Class Template Referenceabstract
Inheritance diagram for CppAD::cg::CCompiler< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::CCompiler< Base >:
Collaboration graph

Public Member Functions

virtual const std::string & getTemporaryFolder () const =0
 
virtual void setTemporaryFolder (const std::string &tmpFolder)=0
 
virtual bool isSaveToDiskFirst () const =0
 
virtual void setSaveToDiskFirst (bool saveToDiskFirst)=0
 
virtual const std::string & getSourcesFolder () const =0
 
virtual void setSourcesFolder (const std::string &srcFolder)=0
 
virtual const std::set< std::string > & getObjectFiles () const =0
 
virtual const std::set< std::string > & getSourceFiles () const =0
 
virtual bool isVerbose () const =0
 
virtual void setVerbose (bool verbose)=0
 
virtual void compileSources (const std::map< std::string, std::string > &sources, bool posIndepCode, JobTimer *timer=nullptr)=0
 
virtual void buildDynamic (const std::string &library, JobTimer *timer=nullptr)=0
 
virtual void cleanup ()=0
 

Detailed Description

template<class Base>
class CppAD::cg::CCompiler< Base >

C compiler class used to create a dynamic library

Author
Joao Leal

Definition at line 154 of file declare_cg.hpp.

Member Function Documentation

◆ buildDynamic()

template<class Base>
virtual void CppAD::cg::CCompiler< Base >::buildDynamic ( const std::string &  library,
JobTimer timer = nullptr 
)
pure virtual

Creates a dynamic library from the previously compiled object files

Parameters
librarythe path to the dynamic library to be created

Implemented in CppAD::cg::AbstractCCompiler< Base >, CppAD::cg::ClangCompiler< Base >, and CppAD::cg::GccCompiler< Base >.

Referenced by CppAD::cg::DynamicModelLibraryProcessor< Base >::createDynamicLibrary().

◆ cleanup()

template<class Base>
virtual void CppAD::cg::CCompiler< Base >::cleanup ( )
pure virtual

Deletes the previously compiled object files and clears of files to include in a dynamic library

Implemented in CppAD::cg::AbstractCCompiler< Base >, and CppAD::cg::ClangCompiler< Base >.

Referenced by CppAD::cg::DynamicModelLibraryProcessor< Base >::createDynamicLibrary(), and CppAD::cg::DynamicModelLibraryProcessor< Base >::createStaticLibrary().

◆ compileSources()

template<class Base>
virtual void CppAD::cg::CCompiler< Base >::compileSources ( const std::map< std::string, std::string > &  sources,
bool  posIndepCode,
JobTimer timer = nullptr 
)
pure virtual

Compiles the provided C source code.

Parameters
sourcesmaps the names to the content of the source files
posIndepCodewhether or not to create position-independent code for dynamic linking

Implemented in CppAD::cg::AbstractCCompiler< Base >.

Referenced by CppAD::cg::DynamicModelLibraryProcessor< Base >::createDynamicLibrary(), and CppAD::cg::DynamicModelLibraryProcessor< Base >::createStaticLibrary().

◆ getSourcesFolder()

template<class Base>
virtual const std::string& CppAD::cg::CCompiler< Base >::getSourcesFolder ( ) const
pure virtual

Provides the path to a folder where the source files should be created when the option to save files to disk is active.

Returns
path to a folder.

Implemented in CppAD::cg::AbstractCCompiler< Base >.

◆ getTemporaryFolder()

template<class Base>
virtual const std::string& CppAD::cg::CCompiler< Base >::getTemporaryFolder ( ) const
pure virtual

Provides the path to a temporary folder that should not exist (it will be deleted after the dynamic library is created)

Returns
path to a temporary folder.

Implemented in CppAD::cg::AbstractCCompiler< Base >.

◆ setSourcesFolder()

template<class Base>
virtual void CppAD::cg::CCompiler< Base >::setSourcesFolder ( const std::string &  srcFolder)
pure virtual

Defines the path to a folder where the source files should be created when the option to save files to disk is active.

Parameters
srcFolderpath to the folder.

Implemented in CppAD::cg::AbstractCCompiler< Base >.

◆ setTemporaryFolder()

template<class Base>
virtual void CppAD::cg::CCompiler< Base >::setTemporaryFolder ( const std::string &  tmpFolder)
pure virtual

Defines the path to a temporary folder that should not exist (it will be deleted after the dynamic library is created)

Parameters
tmpFolderpath to a temporary folder.

Implemented in CppAD::cg::AbstractCCompiler< Base >.


The documentation for this class was generated from the following files: