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