-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
whisker 4 beginning of create_fims_rcpp_interface
Started translating code from create_fims_rcpp_interface to a whisker template. Added example of how to run this in the roxygen of create_fims_rcpp_interface Still need to fix to match what the current files look like rather than what the old cat() template says we should have. Also maybe do not need all of the fed to the function. Co-authored-by: Chris Legault <chris.legault@noaa.gov>
- Loading branch information
1 parent
bf9932a
commit 3025158
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class {{{ interface_name }}} : public {{{ base_class }}} { | ||
public: | ||
|
||
/**< static id of the {{{ interface_name }}} object */ | ||
|
||
{{{#parameters}}} | ||
Parameter {{{value}}} /**{{{comment}}}*/ | ||
{{{/parameters}}} | ||
|
||
{{{ interface_name }}}() : {{{ base_class }}}() {} | ||
|
||
virtual ~{{{interface_name}}}() {} | ||
|
||
virtual uint32_t get_id() { return this->id; } | ||
|
||
virtual double evaluate( {{{evaluate_parameter_type}}} {{{#evaluate_parameter}}}) | ||
fims::{{{model}}} <double> object; | ||
{{{#parameters}}} | ||
object.{{{value}}}; = this->{{{value}}}.value; | ||
{{{/parameters}}} | ||
return object.evaluate( {{{evaluate_parameter_type}}} ); | ||
|
||
virtual bool add_to_fims_tmb() | ||
{{{#types}}} | ||
std::shared_ptr<fims::Information< {{{values}}} | ||
fims::Information< {{{values}}} >::GetInstance(); | ||
|
||
std::shared_ptr<fims::{{{model}}}< {{{values}}} > > {{{mtypes}}} | ||
std::make_shared<fims:: {{{model}}} < {{{values}}} > >(); | ||
|
||
|
||
{{{mtypes}}} ->id = this->id; | ||
{{{/types}}} | ||
{{{/evaluate_parameter}}} | ||
} |