MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / SetFunctionClosure

Method SetFunctionClosure

Wrapping/R/sitkRCommand.cxx:71–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void
72RCommand::SetFunctionClosure(SEXP FN)
73{
74 if (FN != this->m_FunctionClosure)
75 {
76 if (this->m_FunctionClosure != R_NilValue)
77 {
78 R_ReleaseObject(this->m_FunctionClosure);
79 }
80 this->m_FunctionClosure = FN;
81 R_PreserveObject(this->m_FunctionClosure);
82
83 // set up expression for evaluation
84 SEXP R_fcall;
85 // Rf_lang1 creates an executable pair list with one
86 // element
87 R_fcall = PROTECT(Rf_lang1(this->m_FunctionClosure));
88 this->SetCallbackRCallable(R_fcall);
89 this->SetCallbackREnviron(CLOENV(this->m_FunctionClosure));
90 UNPROTECT(1);
91 }
92}
93
94
95SEXP

Callers

nothing calls this directly

Calls 2

SetCallbackRCallableMethod · 0.95
SetCallbackREnvironMethod · 0.95

Tested by

no test coverage detected