MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / Function

Class Function

src/attributes.cpp:245–286  ·  view source on GitHub ↗

Function info

Source from the content-addressed store, hash-verified

243
244 // Function info
245 class Function {
246 public:
247 Function() {}
248 Function(const Type& type,
249 const std::string& name,
250 const std::vector<Argument>& arguments)
251 : type_(type), name_(name), arguments_(arguments)
252 {
253 }
254
255 Function renamedTo(const std::string& name) const { // #nocov start
256 return Function(type(), name, arguments());
257 }
258
259 std::string signature() const { return signature(name()); }
260 std::string signature(const std::string& name) const;
261
262 bool isHidden() const {
263 return name().find_first_of('.') == 0;
264 } // #nocov end
265
266 bool empty() const { return name().empty(); }
267
268 bool operator==(const Function& other) const { // #nocov start
269 return type_ == other.type_ &&
270 name_ == other.name_ &&
271 arguments_ == other.arguments_;
272 }; // #nocov end
273
274 bool operator!=(const Function& other) const {
275 return !(*this == other);
276 };
277
278 const Type& type() const { return type_; }
279 const std::string& name() const { return name_; }
280 const std::vector<Argument>& arguments() const { return arguments_; }
281
282 private:
283 Type type_;
284 std::string name_;
285 std::vector<Argument> arguments_;
286 };
287
288 // Attribute parameter (with optional value)
289 class Param {

Callers 10

function_Function · 0.85
function_cons_envFunction · 0.85
function_cons_nsFunction · 0.85
runit_GenericMatrix_rowFunction · 0.85
runit_lang_fixedcallFunction · 0.85
renamedToMethod · 0.85
parseFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected