1 /** 2 * @file SedExperimentReference.h 3 * @brief Definition of the SedExperimentReference 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 SedExperimentReference 35 * @sbmlbrief{sedml} TODO:Definition of the SedExperimentReference class. 36 */ 37 38 39 #ifndef SedExperimentReference_H__ 40 #define SedExperimentReference_H__ 41 42 43 #include <sedml/common/extern.h> 44 #include <sedml/common/sedmlfwd.h> 45 46 47 #ifdef __cplusplus 48 49 50 #include <string> 51 52 53 #include <sedml/SedBase.h> 54 #include <sbml/common/libsbml-namespace.h> 55 56 57 LIBSEDML_CPP_NAMESPACE_BEGIN 58 59 60 class LIBSEDML_EXTERN SedExperimentReference : public SedBase 61 { 62 protected: 63 64 /** @cond doxygenLibSEDMLInternal */ 65 66 std::string mExperimentId; 67 68 /** @endcond */ 69 70 public: 71 72 /** 73 * Creates a new SedExperimentReference using the given SED-ML Level and @ p version 74 * values. 75 * 76 * @param level an unsigned int, the SED-ML Level to assign to this 77 * SedExperimentReference. 78 * 79 * @param version an unsigned int, the SED-ML Version to assign to this 80 * SedExperimentReference. 81 * 82 * @copydetails doc_note_setting_lv_pkg 83 */ 84 SedExperimentReference(unsigned int level = SEDML_DEFAULT_LEVEL, 85 unsigned int version = SEDML_DEFAULT_VERSION); 86 87 88 /** 89 * Creates a new SedExperimentReference using the given SedNamespaces object @p 90 * sedmlns. 91 * 92 * @param sedmlns the SedNamespaces object. 93 * 94 * @copydetails doc_note_setting_lv_pkg 95 */ 96 SedExperimentReference(SedNamespaces *sedmlns); 97 98 99 /** 100 * Copy constructor for SedExperimentReference. 101 * 102 * @param orig the SedExperimentReference instance to copy. 103 */ 104 SedExperimentReference(const SedExperimentReference& orig); 105 106 107 /** 108 * Assignment operator for SedExperimentReference. 109 * 110 * @param rhs the SedExperimentReference object whose values are to be used as the 111 * basis of the assignment. 112 */ 113 SedExperimentReference& operator=(const SedExperimentReference& rhs); 114 115 116 /** 117 * Creates and returns a deep copy of this SedExperimentReference object. 118 * 119 * @return a (deep) copy of this SedExperimentReference object. 120 */ 121 virtual SedExperimentReference* clone() const; 122 123 124 /** 125 * Destructor for SedExperimentReference. 126 */ 127 virtual ~SedExperimentReference(); 128 129 130 /** 131 * Returns the value of the "experimentId" attribute of this 132 * SedExperimentReference. 133 * 134 * @return the value of the "experimentId" attribute of this SedExperimentReference 135 * as a string. 136 */ 137 const std::string& getExperimentId() const; 138 139 140 /** 141 * Predicate returning @c true if this SedExperimentReference's "experimentId" 142 * attribute is set. 143 * 144 * @return @c true if this SedExperimentReference's "experimentId" attribute has 145 * been set, otherwise @c false is returned. 146 */ 147 bool isSetExperimentId() const; 148 149 150 /** 151 * Sets the value of the "experimentId" attribute of this SedExperimentReference. 152 * 153 * @param experimentId std::string& value of the "experimentId" attribute to 154 * be set. 155 * 156 * @copydetails doc_returns_success_code 157 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 158 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 159 * OperationReturnValues_t} 160 */ 161 int setExperimentId(const std::string& experimentId); 162 163 164 /** 165 * Unsets the value of the "experimentId" attribute of this SedExperimentReference. 166 * 167 * @copydetails doc_returns_success_code 168 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 169 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 170 */ 171 int unsetExperimentId(); 172 173 174 /** 175 * @copydoc doc_renamesidref_common 176 */ 177 virtual void renameSIdRefs(const std::string& oldid, 178 const std::string& newid); 179 180 181 /** 182 * Returns the XML element name of this SedExperimentReference object. 183 * 184 * For SedExperimentReference, the XML element name is always @c "experimentReference". 185 * 186 * @return the name of this element, i.e. @c "experimentReference". 187 */ 188 virtual const std::string& getElementName() const; 189 190 191 /** 192 * Returns the libSEDML type code for this SedExperimentReference object. 193 * 194 * @copydetails doc_what_are_typecodes 195 * 196 * @return the SED-ML type code for this object: 197 * @sedmlconstant{SEDML_EXPERIMENT_REFERENCE, SedTypeCode_t}. 198 * 199 * @copydetails doc_warning_typecodes_not_unique 200 * 201 * @see getElementName() 202 */ 203 virtual int getTypeCode() const; 204 205 206 /** 207 * Predicate returning @c true if all the required attributes for this 208 * SedExperimentReference object have been set. 209 * 210 * @return @c true to indicate that all the required attributes of this 211 * SedExperimentReference have been set, otherwise @c false is returned. 212 */ 213 virtual bool hasRequiredAttributes() const; 214 215 216 217 /** @cond doxygenLibSEDMLInternal */ 218 219 /** 220 * Write any contained elements 221 */ 222 virtual void writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 223 stream) const; 224 225 /** @endcond */ 226 227 228 229 /** @cond doxygenLibSEDMLInternal */ 230 231 /** 232 * Accepts the given SedVisitor 233 */ 234 virtual bool accept(SedVisitor& v) const; 235 236 /** @endcond */ 237 238 239 240 /** @cond doxygenLibSEDMLInternal */ 241 242 /** 243 * Sets the parent SedDocument 244 */ 245 virtual void setSedDocument(SedDocument* d); 246 247 /** @endcond */ 248 249 250 251 252 #ifndef SWIG 253 254 255 256 /** @cond doxygenLibSEDMLInternal */ 257 258 /** 259 * Gets the value of the "attributeName" attribute of this SedExperimentReference. 260 * 261 * @param attributeName, the name of the attribute to retrieve. 262 * 263 * @param value, the address of the value to record. 264 * 265 * @copydetails doc_returns_success_code 266 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 267 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 268 */ 269 virtual int getAttribute(const std::string& attributeName, bool& value) 270 const; 271 272 /** @endcond */ 273 274 275 276 /** @cond doxygenLibSEDMLInternal */ 277 278 /** 279 * Gets the value of the "attributeName" attribute of this SedExperimentReference. 280 * 281 * @param attributeName, the name of the attribute to retrieve. 282 * 283 * @param value, the address of the value to record. 284 * 285 * @copydetails doc_returns_success_code 286 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 287 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 288 */ 289 virtual int getAttribute(const std::string& attributeName, int& value) const; 290 291 /** @endcond */ 292 293 294 295 /** @cond doxygenLibSEDMLInternal */ 296 297 /** 298 * Gets the value of the "attributeName" attribute of this SedExperimentReference. 299 * 300 * @param attributeName, the name of the attribute to retrieve. 301 * 302 * @param value, the address of the value to record. 303 * 304 * @copydetails doc_returns_success_code 305 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 306 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 307 */ 308 virtual int getAttribute(const std::string& attributeName, 309 double& value) const; 310 311 /** @endcond */ 312 313 314 315 /** @cond doxygenLibSEDMLInternal */ 316 317 /** 318 * Gets the value of the "attributeName" attribute of this SedExperimentReference. 319 * 320 * @param attributeName, the name of the attribute to retrieve. 321 * 322 * @param value, the address of the value to record. 323 * 324 * @copydetails doc_returns_success_code 325 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 326 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 327 */ 328 virtual int getAttribute(const std::string& attributeName, 329 unsigned int& value) const; 330 331 /** @endcond */ 332 333 334 335 /** @cond doxygenLibSEDMLInternal */ 336 337 /** 338 * Gets the value of the "attributeName" attribute of this SedExperimentReference. 339 * 340 * @param attributeName, the name of the attribute to retrieve. 341 * 342 * @param value, the address of the value to record. 343 * 344 * @copydetails doc_returns_success_code 345 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 346 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 347 */ 348 virtual int getAttribute(const std::string& attributeName, 349 std::string& value) const; 350 351 /** @endcond */ 352 353 354 355 /** @cond doxygenLibSEDMLInternal */ 356 357 /** 358 * Predicate returning @c true if this SedExperimentReference's attribute 359 * "attributeName" is set. 360 * 361 * @param attributeName, the name of the attribute to query. 362 * 363 * @return @c true if this SedExperimentReference's attribute "attributeName" has 364 * been set, otherwise @c false is returned. 365 */ 366 virtual bool isSetAttribute(const std::string& attributeName) const; 367 368 /** @endcond */ 369 370 371 372 /** @cond doxygenLibSEDMLInternal */ 373 374 /** 375 * Sets the value of the "attributeName" attribute of this SedExperimentReference. 376 * 377 * @param attributeName, the name of the attribute to set. 378 * 379 * @param value, the value of the attribute to set. 380 * 381 * @copydetails doc_returns_success_code 382 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 383 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 384 */ 385 virtual int setAttribute(const std::string& attributeName, bool value); 386 387 /** @endcond */ 388 389 390 391 /** @cond doxygenLibSEDMLInternal */ 392 393 /** 394 * Sets the value of the "attributeName" attribute of this SedExperimentReference. 395 * 396 * @param attributeName, the name of the attribute to set. 397 * 398 * @param value, the value of the attribute to set. 399 * 400 * @copydetails doc_returns_success_code 401 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 402 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 403 */ 404 virtual int setAttribute(const std::string& attributeName, int value); 405 406 /** @endcond */ 407 408 409 410 /** @cond doxygenLibSEDMLInternal */ 411 412 /** 413 * Sets the value of the "attributeName" attribute of this SedExperimentReference. 414 * 415 * @param attributeName, the name of the attribute to set. 416 * 417 * @param value, the value of the attribute to set. 418 * 419 * @copydetails doc_returns_success_code 420 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 421 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 422 */ 423 virtual int setAttribute(const std::string& attributeName, double value); 424 425 /** @endcond */ 426 427 428 429 /** @cond doxygenLibSEDMLInternal */ 430 431 /** 432 * Sets the value of the "attributeName" attribute of this SedExperimentReference. 433 * 434 * @param attributeName, the name of the attribute to set. 435 * 436 * @param value, the value of the attribute to set. 437 * 438 * @copydetails doc_returns_success_code 439 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 440 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 441 */ 442 virtual int setAttribute(const std::string& attributeName, 443 unsigned int value); 444 445 /** @endcond */ 446 447 448 449 /** @cond doxygenLibSEDMLInternal */ 450 451 /** 452 * Sets the value of the "attributeName" attribute of this SedExperimentReference. 453 * 454 * @param attributeName, the name of the attribute to set. 455 * 456 * @param value, the value of the attribute to set. 457 * 458 * @copydetails doc_returns_success_code 459 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 460 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 461 */ 462 virtual int setAttribute(const std::string& attributeName, 463 const std::string& value); 464 465 /** @endcond */ 466 467 468 469 /** @cond doxygenLibSEDMLInternal */ 470 471 /** 472 * Unsets the value of the "attributeName" attribute of this 473 * SedExperimentReference. 474 * 475 * @param attributeName, the name of the attribute to query. 476 * 477 * @copydetails doc_returns_success_code 478 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 479 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 480 */ 481 virtual int unsetAttribute(const std::string& attributeName); 482 483 /** @endcond */ 484 485 486 487 488 #endif /* !SWIG */ 489 490 491 protected: 492 493 494 /** @cond doxygenLibSEDMLInternal */ 495 496 /** 497 * Adds the expected attributes for this element 498 */ 499 virtual void addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER 500 ExpectedAttributes& attributes); 501 502 /** @endcond */ 503 504 505 506 /** @cond doxygenLibSEDMLInternal */ 507 508 /** 509 * Reads the expected attributes into the member data variables 510 */ 511 virtual void readAttributes( 512 const LIBSBML_CPP_NAMESPACE_QUALIFIER 513 XMLAttributes& attributes, 514 const LIBSBML_CPP_NAMESPACE_QUALIFIER 515 ExpectedAttributes& expectedAttributes); 516 517 /** @endcond */ 518 519 520 521 /** @cond doxygenLibSEDMLInternal */ 522 523 /** 524 * Writes the attributes to the stream 525 */ 526 virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 527 stream) const; 528 529 /** @endcond */ 530 531 532 }; 533 534 535 536 LIBSEDML_CPP_NAMESPACE_END 537 538 539 540 541 #endif /* __cplusplus */ 542 543 544 545 546 #ifndef SWIG 547 548 549 550 551 LIBSEDML_CPP_NAMESPACE_BEGIN 552 553 554 555 556 BEGIN_C_DECLS 557 558 559 /** 560 * Creates a new SedExperimentReference_t using the given SED-ML Level and @ p version 561 * values. 562 * 563 * @param level an unsigned int, the SED-ML Level to assign to this 564 * SedExperimentReference_t. 565 * 566 * @param version an unsigned int, the SED-ML Version to assign to this 567 * SedExperimentReference_t. 568 * 569 * @copydetails doc_note_setting_lv_pkg 570 * 571 * @copydetails doc_returned_owned_pointer 572 * 573 * @memberof SedExperimentReference_t 574 */ 575 LIBSEDML_EXTERN 576 SedExperimentReference_t * 577 SedExperimentReference_create(unsigned int level, unsigned int version); 578 579 580 /** 581 * Creates and returns a deep copy of this SedExperimentReference_t object. 582 * 583 * @param ser the SedExperimentReference_t structure. 584 * 585 * @return a (deep) copy of this SedExperimentReference_t object. 586 * 587 * @copydetails doc_returned_owned_pointer 588 * 589 * @memberof SedExperimentReference_t 590 */ 591 LIBSEDML_EXTERN 592 SedExperimentReference_t* 593 SedExperimentReference_clone(const SedExperimentReference_t* ser); 594 595 596 /** 597 * Frees this SedExperimentReference_t object. 598 * 599 * @param ser the SedExperimentReference_t structure. 600 * 601 * @memberof SedExperimentReference_t 602 */ 603 LIBSEDML_EXTERN 604 void 605 SedExperimentReference_free(SedExperimentReference_t* ser); 606 607 608 /** 609 * Returns the value of the "experimentId" attribute of this 610 * SedExperimentReference_t. 611 * 612 * @param ser the SedExperimentReference_t structure whose experimentId is sought. 613 * 614 * @return the value of the "experimentId" attribute of this SedExperimentReference_t 615 * as a pointer to a string. 616 * 617 * @copydetails doc_returned_owned_char 618 * 619 * @memberof SedExperimentReference_t 620 */ 621 LIBSEDML_EXTERN 622 char * 623 SedExperimentReference_getExperimentId(const SedExperimentReference_t * ser); 624 625 626 /** 627 * Predicate returning @c 1 (true) if this SedExperimentReference_t's "experimentId" 628 * attribute is set. 629 * 630 * @param ser the SedExperimentReference_t structure. 631 * 632 * @return @c 1 (true) if this SedExperimentReference_t's "experimentId" attribute 633 * has been set, otherwise @c 0 (false) is returned. 634 * 635 * @memberof SedExperimentReference_t 636 */ 637 LIBSEDML_EXTERN 638 int 639 SedExperimentReference_isSetExperimentId(const SedExperimentReference_t * ser); 640 641 642 /** 643 * Sets the value of the "experimentId" attribute of this SedExperimentReference_t. 644 * 645 * @param ser the SedExperimentReference_t structure. 646 * 647 * @param experimentId const char * value of the "experimentId" attribute to be 648 * set. 649 * 650 * @copydetails doc_returns_success_code 651 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 652 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 653 * OperationReturnValues_t} 654 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 655 * 656 * @memberof SedExperimentReference_t 657 */ 658 LIBSEDML_EXTERN 659 int 660 SedExperimentReference_setExperimentId(SedExperimentReference_t * ser, 661 const char * experimentId); 662 663 664 /** 665 * Unsets the value of the "experimentId" attribute of this SedExperimentReference_t. 666 * 667 * @param ser the SedExperimentReference_t structure. 668 * 669 * @copydetails doc_returns_success_code 670 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 671 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 672 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 673 * 674 * @memberof SedExperimentReference_t 675 */ 676 LIBSEDML_EXTERN 677 int 678 SedExperimentReference_unsetExperimentId(SedExperimentReference_t * ser); 679 680 681 /** 682 * Predicate returning @c 1 (true) if all the required attributes for this 683 * SedExperimentReference_t object have been set. 684 * 685 * @param ser the SedExperimentReference_t structure. 686 * 687 * @return @c 1 (true) to indicate that all the required attributes of this 688 * SedExperimentReference_t have been set, otherwise @c 0 (false) is returned. 689 * 690 * @memberof SedExperimentReference_t 691 */ 692 LIBSEDML_EXTERN 693 int 694 SedExperimentReference_hasRequiredAttributes(const SedExperimentReference_t * ser); 695 696 697 698 699 END_C_DECLS 700 701 702 703 704 LIBSEDML_CPP_NAMESPACE_END 705 706 707 708 709 #endif /* !SWIG */ 710 711 712 713 714 #endif /* !SedExperimentReference_H__ */ 715 716 717