1 /**
2 * @file Boundary.cpp
3 * @brief Implementation of the Boundary class.
4 * @author SBMLTeam
5 *
6 * <!--------------------------------------------------------------------------
7 * This file is part of libSBML. Please visit http://sbml.org for more
8 * information about SBML, and the latest version of libSBML.
9 *
10 * Copyright (C) 2020 jointly by the following organizations:
11 * 1. California Institute of Technology, Pasadena, CA, USA
12 * 2. University of Heidelberg, Heidelberg, Germany
13 * 3. University College London, London, UK
14 *
15 * Copyright (C) 2019 jointly by the following organizations:
16 * 1. California Institute of Technology, Pasadena, CA, USA
17 * 2. University of Heidelberg, Heidelberg, Germany
18 *
19 * Copyright (C) 2013-2018 jointly by the following organizations:
20 * 1. California Institute of Technology, Pasadena, CA, USA
21 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
22 * 3. University of Heidelberg, Heidelberg, Germany
23 *
24 * Copyright (C) 2009-2013 jointly by the following organizations:
25 * 1. California Institute of Technology, Pasadena, CA, USA
26 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
27 *
28 * Copyright (C) 2006-2008 by the California Institute of Technology,
29 * Pasadena, CA, USA
30 *
31 * Copyright (C) 2002-2005 jointly by the following organizations:
32 * 1. California Institute of Technology, Pasadena, CA, USA
33 * 2. Japan Science and Technology Agency, Japan
34 *
35 * This library is free software; you can redistribute it and/or modify it
36 * under the terms of the GNU Lesser General Public License as published by the
37 * Free Software Foundation. A copy of the license agreement is provided in the
38 * file named "LICENSE.txt" included with this software distribution and also
39 * available online as http://sbml.org/software/libsbml/license.html
40 * ------------------------------------------------------------------------ -->
41 */
42 #include <sbml/packages/spatial/sbml/Boundary.h>
43 #include <sbml/packages/spatial/validator/SpatialSBMLError.h>
44
45
46 using namespace std;
47
48
49
50 LIBSBML_CPP_NAMESPACE_BEGIN
51
52
53
54
55 #ifdef __cplusplus
56
57
58 /*
59 * Creates a new Boundary using the given SBML Level, Version and
60 * “spatial” package version.
61 */
Boundary(unsigned int level,unsigned int version,unsigned int pkgVersion)62 Boundary::Boundary(unsigned int level,
63 unsigned int version,
64 unsigned int pkgVersion)
65 : SBase(level, version)
66 , mValue (util_NaN())
67 , mIsSetValue (false)
68 , mElementName("boundary")
69 {
70 setSBMLNamespacesAndOwn(new SpatialPkgNamespaces(level, version,
71 pkgVersion));
72 }
73
74
75 /*
76 * Creates a new Boundary using the given SpatialPkgNamespaces object.
77 */
Boundary(SpatialPkgNamespaces * spatialns)78 Boundary::Boundary(SpatialPkgNamespaces *spatialns)
79 : SBase(spatialns)
80 , mValue (util_NaN())
81 , mIsSetValue (false)
82 , mElementName("boundary")
83 {
84 setElementNamespace(spatialns->getURI());
85 loadPlugins(spatialns);
86 }
87
88
89 /*
90 * Copy constructor for Boundary.
91 */
Boundary(const Boundary & orig)92 Boundary::Boundary(const Boundary& orig)
93 : SBase( orig )
94 , mValue ( orig.mValue )
95 , mIsSetValue ( orig.mIsSetValue )
96 , mElementName ( orig.mElementName )
97 {
98 }
99
100
101 /*
102 * Assignment operator for Boundary.
103 */
104 Boundary&
operator =(const Boundary & rhs)105 Boundary::operator=(const Boundary& rhs)
106 {
107 if (&rhs != this)
108 {
109 SBase::operator=(rhs);
110 mValue = rhs.mValue;
111 mIsSetValue = rhs.mIsSetValue;
112 mElementName = rhs.mElementName;
113 }
114
115 return *this;
116 }
117
118
119 /*
120 * Creates and returns a deep copy of this Boundary object.
121 */
122 Boundary*
clone() const123 Boundary::clone() const
124 {
125 return new Boundary(*this);
126 }
127
128
129 /*
130 * Destructor for Boundary.
131 */
~Boundary()132 Boundary::~Boundary()
133 {
134 }
135
136
137 /*
138 * Returns the value of the "id" attribute of this Boundary.
139 */
140 const std::string&
getId() const141 Boundary::getId() const
142 {
143 return mId;
144 }
145
146
147 /*
148 * Returns the value of the "name" attribute of this Boundary.
149 */
150 const std::string&
getName() const151 Boundary::getName() const
152 {
153 return mName;
154 }
155
156
157 /*
158 * Returns the value of the "value" attribute of this Boundary.
159 */
160 double
getValue() const161 Boundary::getValue() const
162 {
163 return mValue;
164 }
165
166
167 /*
168 * Predicate returning @c true if this Boundary's "id" attribute is set.
169 */
170 bool
isSetId() const171 Boundary::isSetId() const
172 {
173 return (mId.empty() == false);
174 }
175
176
177 /*
178 * Predicate returning @c true if this Boundary's "name" attribute is set.
179 */
180 bool
isSetName() const181 Boundary::isSetName() const
182 {
183 return (mName.empty() == false);
184 }
185
186
187 /*
188 * Predicate returning @c true if this Boundary's "value" attribute is set.
189 */
190 bool
isSetValue() const191 Boundary::isSetValue() const
192 {
193 return mIsSetValue;
194 }
195
196
197 /*
198 * Sets the value of the "id" attribute of this Boundary.
199 */
200 int
setId(const std::string & id)201 Boundary::setId(const std::string& id)
202 {
203 return SyntaxChecker::checkAndSetSId(id, mId);
204 }
205
206
207 /*
208 * Sets the value of the "name" attribute of this Boundary.
209 */
210 int
setName(const std::string & name)211 Boundary::setName(const std::string& name)
212 {
213 mName = name;
214 return LIBSBML_OPERATION_SUCCESS;
215 }
216
217
218 /*
219 * Sets the value of the "value" attribute of this Boundary.
220 */
221 int
setValue(double value)222 Boundary::setValue(double value)
223 {
224 mValue = value;
225 mIsSetValue = true;
226 return LIBSBML_OPERATION_SUCCESS;
227 }
228
229
230 /*
231 * Unsets the value of the "id" attribute of this Boundary.
232 */
233 int
unsetId()234 Boundary::unsetId()
235 {
236 mId.erase();
237
238 if (mId.empty() == true)
239 {
240 return LIBSBML_OPERATION_SUCCESS;
241 }
242 else
243 {
244 return LIBSBML_OPERATION_FAILED;
245 }
246 }
247
248
249 /*
250 * Unsets the value of the "name" attribute of this Boundary.
251 */
252 int
unsetName()253 Boundary::unsetName()
254 {
255 mName.erase();
256
257 if (mName.empty() == true)
258 {
259 return LIBSBML_OPERATION_SUCCESS;
260 }
261 else
262 {
263 return LIBSBML_OPERATION_FAILED;
264 }
265 }
266
267
268 /*
269 * Unsets the value of the "value" attribute of this Boundary.
270 */
271 int
unsetValue()272 Boundary::unsetValue()
273 {
274 mValue = util_NaN();
275 mIsSetValue = false;
276
277 if (isSetValue() == false)
278 {
279 return LIBSBML_OPERATION_SUCCESS;
280 }
281 else
282 {
283 return LIBSBML_OPERATION_FAILED;
284 }
285 }
286
287
288 /*
289 * Returns the XML element name of this Boundary object.
290 */
291 const std::string&
getElementName() const292 Boundary::getElementName() const
293 {
294 return mElementName;
295 }
296
297
298
299 /** @cond doxygenLibsbmlInternal */
300
301 /*
302 * Sets the XML name of this Boundary object.
303 */
304 void
setElementName(const std::string & name)305 Boundary::setElementName(const std::string& name)
306 {
307 mElementName = name;
308 }
309
310 /** @endcond */
311
312
313 /*
314 * Returns the libSBML type code for this Boundary object.
315 */
316 int
getTypeCode() const317 Boundary::getTypeCode() const
318 {
319 return SBML_SPATIAL_BOUNDARY;
320 }
321
322
323 /*
324 * Predicate returning @c true if all the required attributes for this Boundary
325 * object have been set.
326 */
327 bool
hasRequiredAttributes() const328 Boundary::hasRequiredAttributes() const
329 {
330 bool allPresent = true;
331
332 if (isSetId() == false)
333 {
334 allPresent = false;
335 }
336
337 if (isSetValue() == false)
338 {
339 allPresent = false;
340 }
341
342 return allPresent;
343 }
344
345
346
347 /** @cond doxygenLibsbmlInternal */
348
349 /*
350 * Write any contained elements
351 */
352 void
writeElements(XMLOutputStream & stream) const353 Boundary::writeElements(XMLOutputStream& stream) const
354 {
355 SBase::writeElements(stream);
356
357 SBase::writeExtensionElements(stream);
358 }
359
360 /** @endcond */
361
362
363
364 /** @cond doxygenLibsbmlInternal */
365
366 /*
367 * Accepts the given SBMLVisitor
368 */
369 bool
accept(SBMLVisitor & v) const370 Boundary::accept(SBMLVisitor& v) const
371 {
372 return v.visit(*this);
373 }
374
375 /** @endcond */
376
377
378
379 /** @cond doxygenLibsbmlInternal */
380
381 /*
382 * Sets the parent SBMLDocument
383 */
384 void
setSBMLDocument(SBMLDocument * d)385 Boundary::setSBMLDocument(SBMLDocument* d)
386 {
387 SBase::setSBMLDocument(d);
388 }
389
390 /** @endcond */
391
392
393
394 /** @cond doxygenLibsbmlInternal */
395
396 /*
397 * Enables/disables the given package with this element
398 */
399 void
enablePackageInternal(const std::string & pkgURI,const std::string & pkgPrefix,bool flag)400 Boundary::enablePackageInternal(const std::string& pkgURI,
401 const std::string& pkgPrefix,
402 bool flag)
403 {
404 SBase::enablePackageInternal(pkgURI, pkgPrefix, flag);
405 }
406
407 /** @endcond */
408
409
410
411 /** @cond doxygenLibsbmlInternal */
412
413 /*
414 * Gets the value of the "attributeName" attribute of this Boundary.
415 */
416 int
getAttribute(const std::string & attributeName,bool & value) const417 Boundary::getAttribute(const std::string& attributeName, bool& value) const
418 {
419 int return_value = SBase::getAttribute(attributeName, value);
420
421 return return_value;
422 }
423
424 /** @endcond */
425
426
427
428 /** @cond doxygenLibsbmlInternal */
429
430 /*
431 * Gets the value of the "attributeName" attribute of this Boundary.
432 */
433 int
getAttribute(const std::string & attributeName,int & value) const434 Boundary::getAttribute(const std::string& attributeName, int& value) const
435 {
436 int return_value = SBase::getAttribute(attributeName, value);
437
438 return return_value;
439 }
440
441 /** @endcond */
442
443
444
445 /** @cond doxygenLibsbmlInternal */
446
447 /*
448 * Gets the value of the "attributeName" attribute of this Boundary.
449 */
450 int
getAttribute(const std::string & attributeName,double & value) const451 Boundary::getAttribute(const std::string& attributeName, double& value) const
452 {
453 int return_value = SBase::getAttribute(attributeName, value);
454
455 if (return_value == LIBSBML_OPERATION_SUCCESS)
456 {
457 return return_value;
458 }
459
460 if (attributeName == "value")
461 {
462 value = getValue();
463 return_value = LIBSBML_OPERATION_SUCCESS;
464 }
465
466 return return_value;
467 }
468
469 /** @endcond */
470
471
472
473 /** @cond doxygenLibsbmlInternal */
474
475 /*
476 * Gets the value of the "attributeName" attribute of this Boundary.
477 */
478 int
getAttribute(const std::string & attributeName,unsigned int & value) const479 Boundary::getAttribute(const std::string& attributeName,
480 unsigned int& value) const
481 {
482 int return_value = SBase::getAttribute(attributeName, value);
483
484 return return_value;
485 }
486
487 /** @endcond */
488
489
490
491 /** @cond doxygenLibsbmlInternal */
492
493 /*
494 * Gets the value of the "attributeName" attribute of this Boundary.
495 */
496 int
getAttribute(const std::string & attributeName,std::string & value) const497 Boundary::getAttribute(const std::string& attributeName,
498 std::string& value) const
499 {
500 int return_value = SBase::getAttribute(attributeName, value);
501
502 if (return_value == LIBSBML_OPERATION_SUCCESS)
503 {
504 return return_value;
505 }
506
507 if (attributeName == "id")
508 {
509 value = getId();
510 return_value = LIBSBML_OPERATION_SUCCESS;
511 }
512 else if (attributeName == "name")
513 {
514 value = getName();
515 return_value = LIBSBML_OPERATION_SUCCESS;
516 }
517
518 return return_value;
519 }
520
521 /** @endcond */
522
523
524
525 /** @cond doxygenLibsbmlInternal */
526
527 /*
528 * Predicate returning @c true if this Boundary's attribute "attributeName" is
529 * set.
530 */
531 bool
isSetAttribute(const std::string & attributeName) const532 Boundary::isSetAttribute(const std::string& attributeName) const
533 {
534 bool value = SBase::isSetAttribute(attributeName);
535
536 if (attributeName == "id")
537 {
538 value = isSetId();
539 }
540 else if (attributeName == "name")
541 {
542 value = isSetName();
543 }
544 else if (attributeName == "value")
545 {
546 value = isSetValue();
547 }
548
549 return value;
550 }
551
552 /** @endcond */
553
554
555
556 /** @cond doxygenLibsbmlInternal */
557
558 /*
559 * Sets the value of the "attributeName" attribute of this Boundary.
560 */
561 int
setAttribute(const std::string & attributeName,bool value)562 Boundary::setAttribute(const std::string& attributeName, bool value)
563 {
564 int return_value = SBase::setAttribute(attributeName, value);
565
566 return return_value;
567 }
568
569 /** @endcond */
570
571
572
573 /** @cond doxygenLibsbmlInternal */
574
575 /*
576 * Sets the value of the "attributeName" attribute of this Boundary.
577 */
578 int
setAttribute(const std::string & attributeName,int value)579 Boundary::setAttribute(const std::string& attributeName, int value)
580 {
581 int return_value = SBase::setAttribute(attributeName, value);
582
583 return return_value;
584 }
585
586 /** @endcond */
587
588
589
590 /** @cond doxygenLibsbmlInternal */
591
592 /*
593 * Sets the value of the "attributeName" attribute of this Boundary.
594 */
595 int
setAttribute(const std::string & attributeName,double value)596 Boundary::setAttribute(const std::string& attributeName, double value)
597 {
598 int return_value = SBase::setAttribute(attributeName, value);
599
600 if (attributeName == "value")
601 {
602 return_value = setValue(value);
603 }
604
605 return return_value;
606 }
607
608 /** @endcond */
609
610
611
612 /** @cond doxygenLibsbmlInternal */
613
614 /*
615 * Sets the value of the "attributeName" attribute of this Boundary.
616 */
617 int
setAttribute(const std::string & attributeName,unsigned int value)618 Boundary::setAttribute(const std::string& attributeName, unsigned int value)
619 {
620 int return_value = SBase::setAttribute(attributeName, value);
621
622 return return_value;
623 }
624
625 /** @endcond */
626
627
628
629 /** @cond doxygenLibsbmlInternal */
630
631 /*
632 * Sets the value of the "attributeName" attribute of this Boundary.
633 */
634 int
setAttribute(const std::string & attributeName,const std::string & value)635 Boundary::setAttribute(const std::string& attributeName,
636 const std::string& value)
637 {
638 int return_value = SBase::setAttribute(attributeName, value);
639
640 if (attributeName == "id")
641 {
642 return_value = setId(value);
643 }
644 else if (attributeName == "name")
645 {
646 return_value = setName(value);
647 }
648
649 return return_value;
650 }
651
652 /** @endcond */
653
654
655
656 /** @cond doxygenLibsbmlInternal */
657
658 /*
659 * Unsets the value of the "attributeName" attribute of this Boundary.
660 */
661 int
unsetAttribute(const std::string & attributeName)662 Boundary::unsetAttribute(const std::string& attributeName)
663 {
664 int value = SBase::unsetAttribute(attributeName);
665
666 if (attributeName == "id")
667 {
668 value = unsetId();
669 }
670 else if (attributeName == "name")
671 {
672 value = unsetName();
673 }
674 else if (attributeName == "value")
675 {
676 value = unsetValue();
677 }
678
679 return value;
680 }
681
682 /** @endcond */
683
684
685
686 /** @cond doxygenLibsbmlInternal */
687
688 /*
689 * Adds the expected attributes for this element
690 */
691 void
addExpectedAttributes(ExpectedAttributes & attributes)692 Boundary::addExpectedAttributes(ExpectedAttributes& attributes)
693 {
694 SBase::addExpectedAttributes(attributes);
695
696 attributes.add("id");
697
698 attributes.add("name");
699
700 attributes.add("value");
701 }
702
703 /** @endcond */
704
705
706
707 /** @cond doxygenLibsbmlInternal */
708
709 /*
710 * Reads the expected attributes into the member data variables
711 */
712 void
readAttributes(const XMLAttributes & attributes,const ExpectedAttributes & expectedAttributes)713 Boundary::readAttributes(const XMLAttributes& attributes,
714 const ExpectedAttributes& expectedAttributes)
715 {
716 unsigned int level = getLevel();
717 unsigned int version = getVersion();
718 unsigned int pkgVersion = getPackageVersion();
719 unsigned int numErrs;
720 bool assigned = false;
721 SBMLErrorLog* log = getErrorLog();
722
723 SBase::readAttributes(attributes, expectedAttributes);
724
725 if (log)
726 {
727 numErrs = log->getNumErrors();
728
729 for (int n = numErrs-1; n >= 0; n--)
730 {
731 if (log->getError(n)->getErrorId() == UnknownPackageAttribute)
732 {
733 const std::string details = log->getError(n)->getMessage();
734 log->remove(UnknownPackageAttribute);
735 log->logPackageError("spatial", SpatialBoundaryAllowedAttributes,
736 pkgVersion, level, version, details, getLine(), getColumn());
737 }
738 else if (log->getError(n)->getErrorId() == UnknownCoreAttribute)
739 {
740 const std::string details = log->getError(n)->getMessage();
741 log->remove(UnknownCoreAttribute);
742 log->logPackageError("spatial", SpatialBoundaryAllowedCoreAttributes,
743 pkgVersion, level, version, details, getLine(), getColumn());
744 }
745 }
746 }
747
748 //
749 // id SId (use = "required" )
750 //
751
752 assigned = attributes.readInto("id", mId);
753
754 if (assigned == true)
755 {
756 if (mId.empty() == true)
757 {
758 logEmptyString(mId, level, version, "<Boundary>");
759 }
760 else if (SyntaxChecker::isValidSBMLSId(mId) == false)
761 {
762 log->logPackageError("spatial", SpatialIdSyntaxRule, pkgVersion, level,
763 version, "The id on the <" + getElementName() + "> is '" + mId + "', "
764 "which does not conform to the syntax.", getLine(), getColumn());
765 }
766 }
767 else
768 {
769 std::string message = "Spatial attribute 'id' is missing from the "
770 "<Boundary> element.";
771 log->logPackageError("spatial", SpatialBoundaryAllowedAttributes,
772 pkgVersion, level, version, message, getLine(), getColumn());
773 }
774
775 //
776 // name string (use = "optional" )
777 //
778
779 assigned = attributes.readInto("name", mName);
780
781 if (assigned == true)
782 {
783 if (mName.empty() == true)
784 {
785 logEmptyString(mName, level, version, "<Boundary>");
786 }
787 }
788
789 //
790 // value double (use = "required" )
791 //
792
793 numErrs = log->getNumErrors();
794 mIsSetValue = attributes.readInto("value", mValue);
795
796 if ( mIsSetValue == false)
797 {
798 if (log->getNumErrors() == numErrs + 1 &&
799 log->contains(XMLAttributeTypeMismatch))
800 {
801 log->remove(XMLAttributeTypeMismatch);
802 std::string message = "Spatial attribute 'value' from the <Boundary> "
803 "element must be an integer.";
804 log->logPackageError("spatial", SpatialBoundaryValueMustBeDouble,
805 pkgVersion, level, version, message, getLine(), getColumn());
806 }
807 else
808 {
809 std::string message = "Spatial attribute 'value' is missing from the "
810 "<Boundary> element.";
811 log->logPackageError("spatial", SpatialBoundaryAllowedAttributes,
812 pkgVersion, level, version, message, getLine(), getColumn());
813 }
814 }
815 }
816
817 /** @endcond */
818
819
820
821 /** @cond doxygenLibsbmlInternal */
822
823 /*
824 * Writes the attributes to the stream
825 */
826 void
writeAttributes(XMLOutputStream & stream) const827 Boundary::writeAttributes(XMLOutputStream& stream) const
828 {
829 SBase::writeAttributes(stream);
830
831 if (isSetId() == true)
832 {
833 stream.writeAttribute("id", getPrefix(), mId);
834 }
835
836 if (isSetName() == true)
837 {
838 stream.writeAttribute("name", getPrefix(), mName);
839 }
840
841 if (isSetValue() == true)
842 {
843 stream.writeAttribute("value", getPrefix(), mValue);
844 }
845
846 SBase::writeExtensionAttributes(stream);
847 }
848
849 /** @endcond */
850
851
852
853
854 #endif /* __cplusplus */
855
856
857 /*
858 * Creates a new Boundary_t using the given SBML Level, Version and
859 * “spatial” package version.
860 */
861 LIBSBML_EXTERN
862 Boundary_t *
Boundary_create(unsigned int level,unsigned int version,unsigned int pkgVersion)863 Boundary_create(unsigned int level,
864 unsigned int version,
865 unsigned int pkgVersion)
866 {
867 return new Boundary(level, version, pkgVersion);
868 }
869
870
871 /*
872 * Creates and returns a deep copy of this Boundary_t object.
873 */
874 LIBSBML_EXTERN
875 Boundary_t*
Boundary_clone(const Boundary_t * b)876 Boundary_clone(const Boundary_t* b)
877 {
878 if (b != NULL)
879 {
880 return static_cast<Boundary_t*>(b->clone());
881 }
882 else
883 {
884 return NULL;
885 }
886 }
887
888
889 /*
890 * Frees this Boundary_t object.
891 */
892 LIBSBML_EXTERN
893 void
Boundary_free(Boundary_t * b)894 Boundary_free(Boundary_t* b)
895 {
896 if (b != NULL)
897 {
898 delete b;
899 }
900 }
901
902
903 /*
904 * Returns the value of the "id" attribute of this Boundary_t.
905 */
906 LIBSBML_EXTERN
907 char *
Boundary_getId(const Boundary_t * b)908 Boundary_getId(const Boundary_t * b)
909 {
910 if (b == NULL)
911 {
912 return NULL;
913 }
914
915 return b->getId().empty() ? NULL : safe_strdup(b->getId().c_str());
916 }
917
918
919 /*
920 * Returns the value of the "name" attribute of this Boundary_t.
921 */
922 LIBSBML_EXTERN
923 char *
Boundary_getName(const Boundary_t * b)924 Boundary_getName(const Boundary_t * b)
925 {
926 if (b == NULL)
927 {
928 return NULL;
929 }
930
931 return b->getName().empty() ? NULL : safe_strdup(b->getName().c_str());
932 }
933
934
935 /*
936 * Returns the value of the "value" attribute of this Boundary_t.
937 */
938 LIBSBML_EXTERN
939 double
Boundary_getValue(const Boundary_t * b)940 Boundary_getValue(const Boundary_t * b)
941 {
942 return (b != NULL) ? b->getValue() : util_NaN();
943 }
944
945
946 /*
947 * Predicate returning @c 1 (true) if this Boundary_t's "id" attribute is set.
948 */
949 LIBSBML_EXTERN
950 int
Boundary_isSetId(const Boundary_t * b)951 Boundary_isSetId(const Boundary_t * b)
952 {
953 return (b != NULL) ? static_cast<int>(b->isSetId()) : 0;
954 }
955
956
957 /*
958 * Predicate returning @c 1 (true) if this Boundary_t's "name" attribute is
959 * set.
960 */
961 LIBSBML_EXTERN
962 int
Boundary_isSetName(const Boundary_t * b)963 Boundary_isSetName(const Boundary_t * b)
964 {
965 return (b != NULL) ? static_cast<int>(b->isSetName()) : 0;
966 }
967
968
969 /*
970 * Predicate returning @c 1 (true) if this Boundary_t's "value" attribute is
971 * set.
972 */
973 LIBSBML_EXTERN
974 int
Boundary_isSetValue(const Boundary_t * b)975 Boundary_isSetValue(const Boundary_t * b)
976 {
977 return (b != NULL) ? static_cast<int>(b->isSetValue()) : 0;
978 }
979
980
981 /*
982 * Sets the value of the "id" attribute of this Boundary_t.
983 */
984 LIBSBML_EXTERN
985 int
Boundary_setId(Boundary_t * b,const char * id)986 Boundary_setId(Boundary_t * b, const char * id)
987 {
988 return (b != NULL) ? b->setId(id) : LIBSBML_INVALID_OBJECT;
989 }
990
991
992 /*
993 * Sets the value of the "name" attribute of this Boundary_t.
994 */
995 LIBSBML_EXTERN
996 int
Boundary_setName(Boundary_t * b,const char * name)997 Boundary_setName(Boundary_t * b, const char * name)
998 {
999 return (b != NULL) ? b->setName(name) : LIBSBML_INVALID_OBJECT;
1000 }
1001
1002
1003 /*
1004 * Sets the value of the "value" attribute of this Boundary_t.
1005 */
1006 LIBSBML_EXTERN
1007 int
Boundary_setValue(Boundary_t * b,double value)1008 Boundary_setValue(Boundary_t * b, double value)
1009 {
1010 return (b != NULL) ? b->setValue(value) : LIBSBML_INVALID_OBJECT;
1011 }
1012
1013
1014 /*
1015 * Unsets the value of the "id" attribute of this Boundary_t.
1016 */
1017 LIBSBML_EXTERN
1018 int
Boundary_unsetId(Boundary_t * b)1019 Boundary_unsetId(Boundary_t * b)
1020 {
1021 return (b != NULL) ? b->unsetId() : LIBSBML_INVALID_OBJECT;
1022 }
1023
1024
1025 /*
1026 * Unsets the value of the "name" attribute of this Boundary_t.
1027 */
1028 LIBSBML_EXTERN
1029 int
Boundary_unsetName(Boundary_t * b)1030 Boundary_unsetName(Boundary_t * b)
1031 {
1032 return (b != NULL) ? b->unsetName() : LIBSBML_INVALID_OBJECT;
1033 }
1034
1035
1036 /*
1037 * Unsets the value of the "value" attribute of this Boundary_t.
1038 */
1039 LIBSBML_EXTERN
1040 int
Boundary_unsetValue(Boundary_t * b)1041 Boundary_unsetValue(Boundary_t * b)
1042 {
1043 return (b != NULL) ? b->unsetValue() : LIBSBML_INVALID_OBJECT;
1044 }
1045
1046
1047 /*
1048 * Predicate returning @c 1 (true) if all the required attributes for this
1049 * Boundary_t object have been set.
1050 */
1051 LIBSBML_EXTERN
1052 int
Boundary_hasRequiredAttributes(const Boundary_t * b)1053 Boundary_hasRequiredAttributes(const Boundary_t * b)
1054 {
1055 return (b != NULL) ? static_cast<int>(b->hasRequiredAttributes()) : 0;
1056 }
1057
1058
1059
1060
1061 LIBSBML_CPP_NAMESPACE_END
1062
1063
1064