1 /** 2 * @file SedAnalysis.h 3 * @brief Definition of the SedAnalysis 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 SedAnalysis 35 * @sbmlbrief{sedml} TODO:Definition of the SedAnalysis class. 36 */ 37 38 39 #ifndef SedAnalysis_H__ 40 #define SedAnalysis_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/SedSimulation.h> 54 #include <sbml/common/libsbml-namespace.h> 55 56 57 LIBSEDML_CPP_NAMESPACE_BEGIN 58 59 60 class LIBSEDML_EXTERN SedAnalysis : public SedSimulation 61 { 62 63 public: 64 65 /** 66 * Creates a new SedAnalysis using the given SED-ML Level and @ p version 67 * values. 68 * 69 * @param level an unsigned int, the SED-ML Level to assign to this 70 * SedAnalysis. 71 * 72 * @param version an unsigned int, the SED-ML Version to assign to this 73 * SedAnalysis. 74 * 75 * @copydetails doc_note_setting_lv_pkg 76 */ 77 SedAnalysis(unsigned int level = SEDML_DEFAULT_LEVEL, 78 unsigned int version = SEDML_DEFAULT_VERSION); 79 80 81 /** 82 * Creates a new SedAnalysis using the given SedNamespaces object @p 83 * sedmlns. 84 * 85 * @param sedmlns the SedNamespaces object. 86 * 87 * @copydetails doc_note_setting_lv_pkg 88 */ 89 SedAnalysis(SedNamespaces *sedmlns); 90 91 92 /** 93 * Copy constructor for SedAnalysis. 94 * 95 * @param orig the SedAnalysis instance to copy. 96 */ 97 SedAnalysis(const SedAnalysis& orig); 98 99 100 /** 101 * Assignment operator for SedAnalysis. 102 * 103 * @param rhs the SedAnalysis object whose values are to be used as the 104 * basis of the assignment. 105 */ 106 SedAnalysis& operator=(const SedAnalysis& rhs); 107 108 109 /** 110 * Creates and returns a deep copy of this SedAnalysis object. 111 * 112 * @return a (deep) copy of this SedAnalysis object. 113 */ 114 virtual SedAnalysis* clone() const; 115 116 117 /** 118 * Destructor for SedAnalysis. 119 */ 120 virtual ~SedAnalysis(); 121 122 123 /** 124 * Returns the XML element name of this SedAnalysis object. 125 * 126 * For SedAnalysis, the XML element name is always @c "analysis". 127 * 128 * @return the name of this element, i.e. @c "analysis". 129 */ 130 virtual const std::string& getElementName() const; 131 132 133 /** 134 * Returns the libSEDML type code for this SedAnalysis object. 135 * 136 * @copydetails doc_what_are_typecodes 137 * 138 * @return the SED-ML type code for this object: 139 * @sedmlconstant{SEDML_SIMULATION_ANALYSIS, SedTypeCode_t}. 140 * 141 * @copydetails doc_warning_typecodes_not_unique 142 * 143 * @see getElementName() 144 */ 145 virtual int getTypeCode() const; 146 147 148 /** 149 * Predicate returning @c true if all the required attributes for this 150 * SedAnalysis object have been set. 151 * 152 * @return @c true to indicate that all the required attributes of this 153 * SedAnalysis have been set, otherwise @c false is returned. 154 */ 155 virtual bool hasRequiredAttributes() const; 156 157 158 159 /** @cond doxygenLibSEDMLInternal */ 160 161 /** 162 * Write any contained elements 163 */ 164 virtual void writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 165 stream) const; 166 167 /** @endcond */ 168 169 170 171 /** @cond doxygenLibSEDMLInternal */ 172 173 /** 174 * Accepts the given SedVisitor 175 */ 176 virtual bool accept(SedVisitor& v) const; 177 178 /** @endcond */ 179 180 181 182 /** @cond doxygenLibSEDMLInternal */ 183 184 /** 185 * Sets the parent SedDocument 186 */ 187 virtual void setSedDocument(SedDocument* d); 188 189 /** @endcond */ 190 191 192 193 194 #ifndef SWIG 195 196 197 198 /** @cond doxygenLibSEDMLInternal */ 199 200 /** 201 * Gets the value of the "attributeName" attribute of this SedAnalysis. 202 * 203 * @param attributeName, the name of the attribute to retrieve. 204 * 205 * @param value, the address of the value to record. 206 * 207 * @copydetails doc_returns_success_code 208 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 209 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 210 */ 211 virtual int getAttribute(const std::string& attributeName, bool& value) 212 const; 213 214 /** @endcond */ 215 216 217 218 /** @cond doxygenLibSEDMLInternal */ 219 220 /** 221 * Gets the value of the "attributeName" attribute of this SedAnalysis. 222 * 223 * @param attributeName, the name of the attribute to retrieve. 224 * 225 * @param value, the address of the value to record. 226 * 227 * @copydetails doc_returns_success_code 228 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 229 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 230 */ 231 virtual int getAttribute(const std::string& attributeName, int& value) const; 232 233 /** @endcond */ 234 235 236 237 /** @cond doxygenLibSEDMLInternal */ 238 239 /** 240 * Gets the value of the "attributeName" attribute of this SedAnalysis. 241 * 242 * @param attributeName, the name of the attribute to retrieve. 243 * 244 * @param value, the address of the value to record. 245 * 246 * @copydetails doc_returns_success_code 247 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 248 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 249 */ 250 virtual int getAttribute(const std::string& attributeName, 251 double& value) const; 252 253 /** @endcond */ 254 255 256 257 /** @cond doxygenLibSEDMLInternal */ 258 259 /** 260 * Gets the value of the "attributeName" attribute of this SedAnalysis. 261 * 262 * @param attributeName, the name of the attribute to retrieve. 263 * 264 * @param value, the address of the value to record. 265 * 266 * @copydetails doc_returns_success_code 267 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 268 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 269 */ 270 virtual int getAttribute(const std::string& attributeName, 271 unsigned int& value) const; 272 273 /** @endcond */ 274 275 276 277 /** @cond doxygenLibSEDMLInternal */ 278 279 /** 280 * Gets the value of the "attributeName" attribute of this SedAnalysis. 281 * 282 * @param attributeName, the name of the attribute to retrieve. 283 * 284 * @param value, the address of the value to record. 285 * 286 * @copydetails doc_returns_success_code 287 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 288 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 289 */ 290 virtual int getAttribute(const std::string& attributeName, 291 std::string& value) const; 292 293 /** @endcond */ 294 295 296 297 /** @cond doxygenLibSEDMLInternal */ 298 299 /** 300 * Predicate returning @c true if this SedAnalysis's attribute 301 * "attributeName" is set. 302 * 303 * @param attributeName, the name of the attribute to query. 304 * 305 * @return @c true if this SedAnalysis's attribute "attributeName" has 306 * been set, otherwise @c false is returned. 307 */ 308 virtual bool isSetAttribute(const std::string& attributeName) const; 309 310 /** @endcond */ 311 312 313 314 /** @cond doxygenLibSEDMLInternal */ 315 316 /** 317 * Sets the value of the "attributeName" attribute of this SedAnalysis. 318 * 319 * @param attributeName, the name of the attribute to set. 320 * 321 * @param value, the value of the attribute to set. 322 * 323 * @copydetails doc_returns_success_code 324 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 325 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 326 */ 327 virtual int setAttribute(const std::string& attributeName, bool value); 328 329 /** @endcond */ 330 331 332 333 /** @cond doxygenLibSEDMLInternal */ 334 335 /** 336 * Sets the value of the "attributeName" attribute of this SedAnalysis. 337 * 338 * @param attributeName, the name of the attribute to set. 339 * 340 * @param value, the value of the attribute to set. 341 * 342 * @copydetails doc_returns_success_code 343 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 344 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 345 */ 346 virtual int setAttribute(const std::string& attributeName, int value); 347 348 /** @endcond */ 349 350 351 352 /** @cond doxygenLibSEDMLInternal */ 353 354 /** 355 * Sets the value of the "attributeName" attribute of this SedAnalysis. 356 * 357 * @param attributeName, the name of the attribute to set. 358 * 359 * @param value, the value of the attribute to set. 360 * 361 * @copydetails doc_returns_success_code 362 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 363 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 364 */ 365 virtual int setAttribute(const std::string& attributeName, double value); 366 367 /** @endcond */ 368 369 370 371 /** @cond doxygenLibSEDMLInternal */ 372 373 /** 374 * Sets the value of the "attributeName" attribute of this SedAnalysis. 375 * 376 * @param attributeName, the name of the attribute to set. 377 * 378 * @param value, the value of the attribute to set. 379 * 380 * @copydetails doc_returns_success_code 381 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 382 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 383 */ 384 virtual int setAttribute(const std::string& attributeName, 385 unsigned int value); 386 387 /** @endcond */ 388 389 390 391 /** @cond doxygenLibSEDMLInternal */ 392 393 /** 394 * Sets the value of the "attributeName" attribute of this SedAnalysis. 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, 405 const std::string& value); 406 407 /** @endcond */ 408 409 410 411 /** @cond doxygenLibSEDMLInternal */ 412 413 /** 414 * Unsets the value of the "attributeName" attribute of this SedAnalysis. 415 * 416 * @param attributeName, the name of the attribute to query. 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 unsetAttribute(const std::string& attributeName); 423 424 /** @endcond */ 425 426 427 428 429 #endif /* !SWIG */ 430 431 432 protected: 433 434 435 /** @cond doxygenLibSEDMLInternal */ 436 437 /** 438 * Creates a new object from the next XMLToken on the XMLInputStream 439 */ 440 virtual SedBase* createObject(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& 441 stream); 442 443 /** @endcond */ 444 445 446 447 /** @cond doxygenLibSEDMLInternal */ 448 449 /** 450 * Adds the expected attributes for this element 451 */ 452 virtual void addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER 453 ExpectedAttributes& attributes); 454 455 /** @endcond */ 456 457 458 459 /** @cond doxygenLibSEDMLInternal */ 460 461 /** 462 * Reads the expected attributes into the member data variables 463 */ 464 virtual void readAttributes( 465 const LIBSBML_CPP_NAMESPACE_QUALIFIER 466 XMLAttributes& attributes, 467 const LIBSBML_CPP_NAMESPACE_QUALIFIER 468 ExpectedAttributes& expectedAttributes); 469 470 /** @endcond */ 471 472 473 474 /** @cond doxygenLibSEDMLInternal */ 475 476 /** 477 * Writes the attributes to the stream 478 */ 479 virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 480 stream) const; 481 482 /** @endcond */ 483 484 485 }; 486 487 488 489 LIBSEDML_CPP_NAMESPACE_END 490 491 492 493 494 #endif /* __cplusplus */ 495 496 497 498 499 #ifndef SWIG 500 501 502 503 504 LIBSEDML_CPP_NAMESPACE_BEGIN 505 506 507 508 509 BEGIN_C_DECLS 510 511 512 /** 513 * Creates a new SedAnalysis_t using the given SED-ML Level and @ p version 514 * values. 515 * 516 * @param level an unsigned int, the SED-ML Level to assign to this 517 * SedAnalysis_t. 518 * 519 * @param version an unsigned int, the SED-ML Version to assign to this 520 * SedAnalysis_t. 521 * 522 * @copydetails doc_note_setting_lv_pkg 523 * 524 * @copydetails doc_returned_owned_pointer 525 * 526 * @memberof SedAnalysis_t 527 */ 528 LIBSEDML_EXTERN 529 SedAnalysis_t * 530 SedAnalysis_create(unsigned int level, unsigned int version); 531 532 533 /** 534 * Creates and returns a deep copy of this SedAnalysis_t object. 535 * 536 * @param sss the SedAnalysis_t structure. 537 * 538 * @return a (deep) copy of this SedAnalysis_t object. 539 * 540 * @copydetails doc_returned_owned_pointer 541 * 542 * @memberof SedAnalysis_t 543 */ 544 LIBSEDML_EXTERN 545 SedAnalysis_t* 546 SedAnalysis_clone(const SedAnalysis_t* sss); 547 548 549 /** 550 * Frees this SedAnalysis_t object. 551 * 552 * @param sss the SedAnalysis_t structure. 553 * 554 * @memberof SedAnalysis_t 555 */ 556 LIBSEDML_EXTERN 557 void 558 SedAnalysis_free(SedAnalysis_t* sss); 559 560 561 /** 562 * Predicate returning @c 1 (true) if all the required attributes for this 563 * SedAnalysis_t object have been set. 564 * 565 * @param sss the SedAnalysis_t structure. 566 * 567 * @return @c 1 (true) to indicate that all the required attributes of this 568 * SedAnalysis_t have been set, otherwise @c 0 (false) is returned. 569 * 570 * @memberof SedAnalysis_t 571 */ 572 LIBSEDML_EXTERN 573 int 574 SedAnalysis_hasRequiredAttributes(const SedAnalysis_t * sss); 575 576 577 578 579 END_C_DECLS 580 581 582 583 584 LIBSEDML_CPP_NAMESPACE_END 585 586 587 588 589 #endif /* !SWIG */ 590 591 592 593 594 #endif /* !SedAnalysis_H__ */ 595 596 597