1 /** 2 * @file SedLeastSquareObjectiveFunction.h 3 * @brief Definition of the SedLeastSquareObjectiveFunction class. 4 * @author DEVISER 5 * 6 * <!-------------------------------------------------------------------------- 7 * This file is part of libSEDML. Please visit http://sed-ml.org for more 8 * information about SED-ML. The latest version of libSEDML can be found on 9 * github: https://github.com/fbergmann/libSEDML/ 10 * 11 12 * Copyright (c) 2013-2019, Frank T. Bergmann 13 * All rights reserved. 14 * 15 16 * Redistribution and use in source and binary forms, with or without 17 * modification, are permitted provided that the following conditions are met: 18 * 19 20 * 1. Redistributions of source code must retain the above copyright notice, 21 * this 22 * list of conditions and the following disclaimer. 23 * 2. Redistributions in binary form must reproduce the above copyright notice, 24 * this list of conditions and the following disclaimer in the documentation 25 * and/or other materials provided with the distribution. 26 * 27 * This library is free software; you can redistribute it and/or modify it 28 * under the terms of the GNU Lesser General Public License as published by the 29 * Free Software Foundation. A copy of the license agreement is provided in the 30 * file named "LICENSE.txt" included with this software distribution and also 31 * available online as http://sbml.org/software/libsbml/license.html 32 * ------------------------------------------------------------------------ --> 33 * 34 * @class SedLeastSquareObjectiveFunction 35 * @sbmlbrief{sedml} TODO:Definition of the SedLeastSquareObjectiveFunction 36 * class. 37 */ 38 39 40 #ifndef SedLeastSquareObjectiveFunction_H__ 41 #define SedLeastSquareObjectiveFunction_H__ 42 43 44 #include <sedml/common/extern.h> 45 #include <sedml/common/sedmlfwd.h> 46 47 48 #ifdef __cplusplus 49 50 51 #include <string> 52 53 54 #include <sedml/SedObjective.h> 55 #include <sbml/common/libsbml-namespace.h> 56 57 58 LIBSEDML_CPP_NAMESPACE_BEGIN 59 60 61 class LIBSEDML_EXTERN SedLeastSquareObjectiveFunction : public SedObjective 62 { 63 64 public: 65 66 /** 67 * Creates a new SedLeastSquareObjectiveFunction using the given SED-ML Level 68 * and @ p version values. 69 * 70 * @param level an unsigned int, the SED-ML Level to assign to this 71 * SedLeastSquareObjectiveFunction. 72 * 73 * @param version an unsigned int, the SED-ML Version to assign to this 74 * SedLeastSquareObjectiveFunction. 75 * 76 * @copydetails doc_note_setting_lv_pkg 77 */ 78 SedLeastSquareObjectiveFunction(unsigned int level = SEDML_DEFAULT_LEVEL, 79 unsigned int version = 80 SEDML_DEFAULT_VERSION); 81 82 83 /** 84 * Creates a new SedLeastSquareObjectiveFunction using the given 85 * SedNamespaces object @p sedmlns. 86 * 87 * @param sedmlns the SedNamespaces object. 88 * 89 * @copydetails doc_note_setting_lv_pkg 90 */ 91 SedLeastSquareObjectiveFunction(SedNamespaces *sedmlns); 92 93 94 /** 95 * Copy constructor for SedLeastSquareObjectiveFunction. 96 * 97 * @param orig the SedLeastSquareObjectiveFunction instance to copy. 98 */ 99 SedLeastSquareObjectiveFunction(const SedLeastSquareObjectiveFunction& orig); 100 101 102 /** 103 * Assignment operator for SedLeastSquareObjectiveFunction. 104 * 105 * @param rhs the SedLeastSquareObjectiveFunction object whose values are to 106 * be used as the basis of the assignment. 107 */ 108 SedLeastSquareObjectiveFunction& operator=(const 109 SedLeastSquareObjectiveFunction& rhs); 110 111 112 /** 113 * Creates and returns a deep copy of this SedLeastSquareObjectiveFunction 114 * object. 115 * 116 * @return a (deep) copy of this SedLeastSquareObjectiveFunction object. 117 */ 118 virtual SedLeastSquareObjectiveFunction* clone() const; 119 120 121 /** 122 * Destructor for SedLeastSquareObjectiveFunction. 123 */ 124 virtual ~SedLeastSquareObjectiveFunction(); 125 126 127 /** 128 * Returns the XML element name of this SedLeastSquareObjectiveFunction 129 * object. 130 * 131 * For SedLeastSquareObjectiveFunction, the XML element name is always 132 * @c "leastSquareObjectiveFunction". 133 * 134 * @return the name of this element, i.e. @c "leastSquareObjectiveFunction". 135 */ 136 virtual const std::string& getElementName() const; 137 138 139 /** 140 * Returns the libSEDML type code for this SedLeastSquareObjectiveFunction 141 * object. 142 * 143 * @copydetails doc_what_are_typecodes 144 * 145 * @return the SED-ML type code for this object: 146 * @sedmlconstant{SEDML_LEAST_SQUARE_OBJECTIVE, SedTypeCode_t}. 147 * 148 * @copydetails doc_warning_typecodes_not_unique 149 * 150 * @see getElementName() 151 */ 152 virtual int getTypeCode() const; 153 154 155 /** 156 * Predicate returning @c true if all the required attributes for this 157 * SedLeastSquareObjectiveFunction object have been set. 158 * 159 * @return @c true to indicate that all the required attributes of this 160 * SedLeastSquareObjectiveFunction have been set, otherwise @c false is 161 * returned. 162 */ 163 virtual bool hasRequiredAttributes() const; 164 165 166 167 /** @cond doxygenLibSEDMLInternal */ 168 169 /** 170 * Write any contained elements 171 */ 172 virtual void writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 173 stream) const; 174 175 /** @endcond */ 176 177 178 179 /** @cond doxygenLibSEDMLInternal */ 180 181 /** 182 * Accepts the given SedVisitor 183 */ 184 virtual bool accept(SedVisitor& v) const; 185 186 /** @endcond */ 187 188 189 190 /** @cond doxygenLibSEDMLInternal */ 191 192 /** 193 * Sets the parent SedDocument 194 */ 195 virtual void setSedDocument(SedDocument* d); 196 197 /** @endcond */ 198 199 200 201 202 #ifndef SWIG 203 204 205 206 /** @cond doxygenLibSEDMLInternal */ 207 208 /** 209 * Gets the value of the "attributeName" attribute of this 210 * SedLeastSquareObjectiveFunction. 211 * 212 * @param attributeName, the name of the attribute to retrieve. 213 * 214 * @param value, the address of the value to record. 215 * 216 * @copydetails doc_returns_success_code 217 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 218 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 219 */ 220 virtual int getAttribute(const std::string& attributeName, bool& value) 221 const; 222 223 /** @endcond */ 224 225 226 227 /** @cond doxygenLibSEDMLInternal */ 228 229 /** 230 * Gets the value of the "attributeName" attribute of this 231 * SedLeastSquareObjectiveFunction. 232 * 233 * @param attributeName, the name of the attribute to retrieve. 234 * 235 * @param value, the address of the value to record. 236 * 237 * @copydetails doc_returns_success_code 238 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 239 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 240 */ 241 virtual int getAttribute(const std::string& attributeName, int& value) const; 242 243 /** @endcond */ 244 245 246 247 /** @cond doxygenLibSEDMLInternal */ 248 249 /** 250 * Gets the value of the "attributeName" attribute of this 251 * SedLeastSquareObjectiveFunction. 252 * 253 * @param attributeName, the name of the attribute to retrieve. 254 * 255 * @param value, the address of the value to record. 256 * 257 * @copydetails doc_returns_success_code 258 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 259 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 260 */ 261 virtual int getAttribute(const std::string& attributeName, 262 double& value) const; 263 264 /** @endcond */ 265 266 267 268 /** @cond doxygenLibSEDMLInternal */ 269 270 /** 271 * Gets the value of the "attributeName" attribute of this 272 * SedLeastSquareObjectiveFunction. 273 * 274 * @param attributeName, the name of the attribute to retrieve. 275 * 276 * @param value, the address of the value to record. 277 * 278 * @copydetails doc_returns_success_code 279 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 280 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 281 */ 282 virtual int getAttribute(const std::string& attributeName, 283 unsigned int& value) const; 284 285 /** @endcond */ 286 287 288 289 /** @cond doxygenLibSEDMLInternal */ 290 291 /** 292 * Gets the value of the "attributeName" attribute of this 293 * SedLeastSquareObjectiveFunction. 294 * 295 * @param attributeName, the name of the attribute to retrieve. 296 * 297 * @param value, the address of the value to record. 298 * 299 * @copydetails doc_returns_success_code 300 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 301 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 302 */ 303 virtual int getAttribute(const std::string& attributeName, 304 std::string& value) const; 305 306 /** @endcond */ 307 308 309 310 /** @cond doxygenLibSEDMLInternal */ 311 312 /** 313 * Predicate returning @c true if this SedLeastSquareObjectiveFunction's 314 * attribute "attributeName" is set. 315 * 316 * @param attributeName, the name of the attribute to query. 317 * 318 * @return @c true if this SedLeastSquareObjectiveFunction's attribute 319 * "attributeName" has been set, otherwise @c false is returned. 320 */ 321 virtual bool isSetAttribute(const std::string& attributeName) const; 322 323 /** @endcond */ 324 325 326 327 /** @cond doxygenLibSEDMLInternal */ 328 329 /** 330 * Sets the value of the "attributeName" attribute of this 331 * SedLeastSquareObjectiveFunction. 332 * 333 * @param attributeName, the name of the attribute to set. 334 * 335 * @param value, the value of the attribute to set. 336 * 337 * @copydetails doc_returns_success_code 338 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 339 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 340 */ 341 virtual int setAttribute(const std::string& attributeName, bool value); 342 343 /** @endcond */ 344 345 346 347 /** @cond doxygenLibSEDMLInternal */ 348 349 /** 350 * Sets the value of the "attributeName" attribute of this 351 * SedLeastSquareObjectiveFunction. 352 * 353 * @param attributeName, the name of the attribute to set. 354 * 355 * @param value, the value of the attribute to set. 356 * 357 * @copydetails doc_returns_success_code 358 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 359 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 360 */ 361 virtual int setAttribute(const std::string& attributeName, int value); 362 363 /** @endcond */ 364 365 366 367 /** @cond doxygenLibSEDMLInternal */ 368 369 /** 370 * Sets the value of the "attributeName" attribute of this 371 * SedLeastSquareObjectiveFunction. 372 * 373 * @param attributeName, the name of the attribute to set. 374 * 375 * @param value, the value of the attribute to set. 376 * 377 * @copydetails doc_returns_success_code 378 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 379 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 380 */ 381 virtual int setAttribute(const std::string& attributeName, double value); 382 383 /** @endcond */ 384 385 386 387 /** @cond doxygenLibSEDMLInternal */ 388 389 /** 390 * Sets the value of the "attributeName" attribute of this 391 * SedLeastSquareObjectiveFunction. 392 * 393 * @param attributeName, the name of the attribute to set. 394 * 395 * @param value, the value of the attribute to set. 396 * 397 * @copydetails doc_returns_success_code 398 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 399 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 400 */ 401 virtual int setAttribute(const std::string& attributeName, 402 unsigned int value); 403 404 /** @endcond */ 405 406 407 408 /** @cond doxygenLibSEDMLInternal */ 409 410 /** 411 * Sets the value of the "attributeName" attribute of this 412 * SedLeastSquareObjectiveFunction. 413 * 414 * @param attributeName, the name of the attribute to set. 415 * 416 * @param value, the value of the attribute to set. 417 * 418 * @copydetails doc_returns_success_code 419 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 420 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 421 */ 422 virtual int setAttribute(const std::string& attributeName, 423 const std::string& value); 424 425 /** @endcond */ 426 427 428 429 /** @cond doxygenLibSEDMLInternal */ 430 431 /** 432 * Unsets the value of the "attributeName" attribute of this 433 * SedLeastSquareObjectiveFunction. 434 * 435 * @param attributeName, the name of the attribute to query. 436 * 437 * @copydetails doc_returns_success_code 438 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 439 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 440 */ 441 virtual int unsetAttribute(const std::string& attributeName); 442 443 /** @endcond */ 444 445 446 447 448 #endif /* !SWIG */ 449 450 451 protected: 452 453 454 /** @cond doxygenLibSEDMLInternal */ 455 456 /** 457 * Creates a new object from the next XMLToken on the XMLInputStream 458 */ 459 virtual SedBase* createObject(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& 460 stream); 461 462 /** @endcond */ 463 464 465 466 /** @cond doxygenLibSEDMLInternal */ 467 468 /** 469 * Adds the expected attributes for this element 470 */ 471 virtual void addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER 472 ExpectedAttributes& attributes); 473 474 /** @endcond */ 475 476 477 478 /** @cond doxygenLibSEDMLInternal */ 479 480 /** 481 * Reads the expected attributes into the member data variables 482 */ 483 virtual void readAttributes( 484 const LIBSBML_CPP_NAMESPACE_QUALIFIER 485 XMLAttributes& attributes, 486 const LIBSBML_CPP_NAMESPACE_QUALIFIER 487 ExpectedAttributes& expectedAttributes); 488 489 /** @endcond */ 490 491 492 493 /** @cond doxygenLibSEDMLInternal */ 494 495 /** 496 * Writes the attributes to the stream 497 */ 498 virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 499 stream) const; 500 501 /** @endcond */ 502 503 504 }; 505 506 507 508 LIBSEDML_CPP_NAMESPACE_END 509 510 511 512 513 #endif /* __cplusplus */ 514 515 516 517 518 #ifndef SWIG 519 520 521 522 523 LIBSEDML_CPP_NAMESPACE_BEGIN 524 525 526 527 528 BEGIN_C_DECLS 529 530 531 /** 532 * Creates a new SedLeastSquareObjectiveFunction_t using the given SED-ML Level 533 * and @ p version values. 534 * 535 * @param level an unsigned int, the SED-ML Level to assign to this 536 * SedLeastSquareObjectiveFunction_t. 537 * 538 * @param version an unsigned int, the SED-ML Version to assign to this 539 * SedLeastSquareObjectiveFunction_t. 540 * 541 * @copydetails doc_note_setting_lv_pkg 542 * 543 * @copydetails doc_returned_owned_pointer 544 * 545 * @memberof SedLeastSquareObjectiveFunction_t 546 */ 547 LIBSEDML_EXTERN 548 SedLeastSquareObjectiveFunction_t * 549 SedLeastSquareObjectiveFunction_create(unsigned int level, 550 unsigned int version); 551 552 553 /** 554 * Creates and returns a deep copy of this SedLeastSquareObjectiveFunction_t 555 * object. 556 * 557 * @param slsof the SedLeastSquareObjectiveFunction_t structure. 558 * 559 * @return a (deep) copy of this SedLeastSquareObjectiveFunction_t object. 560 * 561 * @copydetails doc_returned_owned_pointer 562 * 563 * @memberof SedLeastSquareObjectiveFunction_t 564 */ 565 LIBSEDML_EXTERN 566 SedLeastSquareObjectiveFunction_t* 567 SedLeastSquareObjectiveFunction_clone(const SedLeastSquareObjectiveFunction_t* 568 slsof); 569 570 571 /** 572 * Frees this SedLeastSquareObjectiveFunction_t object. 573 * 574 * @param slsof the SedLeastSquareObjectiveFunction_t structure. 575 * 576 * @memberof SedLeastSquareObjectiveFunction_t 577 */ 578 LIBSEDML_EXTERN 579 void 580 SedLeastSquareObjectiveFunction_free(SedLeastSquareObjectiveFunction_t* slsof); 581 582 583 /** 584 * Predicate returning @c 1 (true) if all the required attributes for this 585 * SedLeastSquareObjectiveFunction_t object have been set. 586 * 587 * @param slsof the SedLeastSquareObjectiveFunction_t structure. 588 * 589 * @return @c 1 (true) to indicate that all the required attributes of this 590 * SedLeastSquareObjectiveFunction_t have been set, otherwise @c 0 (false) is 591 * returned. 592 * 593 * @memberof SedLeastSquareObjectiveFunction_t 594 */ 595 LIBSEDML_EXTERN 596 int 597 SedLeastSquareObjectiveFunction_hasRequiredAttributes(const 598 SedLeastSquareObjectiveFunction_t * slsof); 599 600 601 602 603 END_C_DECLS 604 605 606 607 608 LIBSEDML_CPP_NAMESPACE_END 609 610 611 612 613 #endif /* !SWIG */ 614 615 616 617 618 #endif /* !SedLeastSquareObjectiveFunction_H__ */ 619 620 621