CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
model_library_processor.hpp
1 #ifndef CPPAD_CG_MODEL_LIBRARY_PROCESSOR_INCLUDED
2 #define CPPAD_CG_MODEL_LIBRARY_PROCESSOR_INCLUDED
3 /* --------------------------------------------------------------------------
4  * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5  * Copyright (C) 2013 Ciengis
6  * Copyright (C) 2018 Joao Leal
7  *
8  * CppADCodeGen is distributed under multiple licenses:
9  *
10  * - Eclipse Public License Version 1.0 (EPL1), and
11  * - GNU General Public License Version 3 (GPL3).
12  *
13  * EPL1 terms and conditions can be found in the file "epl-v10.txt", while
14  * terms and conditions for the GPL3 can be found in the file "gpl3.txt".
15  * ----------------------------------------------------------------------------
16  * Author: Joao Leal
17  */
18 
19 namespace CppAD {
20 namespace cg {
21 
27 template<class Base>
28 class ModelLibraryProcessor {
29 protected:
30  ModelLibraryCSourceGen<Base>* modelLibraryHelper_;
31 public:
32 
33  inline explicit ModelLibraryProcessor(ModelLibraryCSourceGen<Base>& modelLibraryHelper) :
34  modelLibraryHelper_(&modelLibraryHelper) {
35  }
36 
37  inline virtual ~ModelLibraryProcessor() = default;
38 
39 protected:
40 
41  inline const std::map<std::string, std::string>& getLibrarySources() {
42  return modelLibraryHelper_->getLibrarySources();
43  }
44 
45  inline const std::map<std::string, std::string>& getSources(ModelCSourceGen<Base>& model) {
46  return model.getSources(modelLibraryHelper_->getMultiThreading(), modelLibraryHelper_);
47  }
48 
49 };
50 
51 } // END cg namespace
52 } // END CppAD namespace
53 
54 #endif