Function info
| 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 { |
no outgoing calls
no test coverage detected