Skip to content

Commit

Permalink
Make various 'get' functions const for annotations.
Browse files Browse the repository at this point in the history
I was trying to 'getYear' on a const Date, and couldn't.

'ModelCreator' get functions were already const.
  • Loading branch information
luciansmith authored and fbergmann committed Sep 7, 2023
1 parent 6e069c0 commit 40ced6e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions src/sbml/annotation/Date.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,71 +316,71 @@ class LIBSBML_EXTERN Date
*
* @return the year from this Date.
*/
unsigned int getYear() { return mYear; }
unsigned int getYear() const { return mYear; }


/**
* Returns the month from this Date.
*
* @return the month from this Date.
*/
unsigned int getMonth() { return mMonth; }
unsigned int getMonth() const { return mMonth; }


/**
* Returns the day from this Date.
*
* @return the day from this Date.
*/
unsigned int getDay() { return mDay; }
unsigned int getDay() const { return mDay; }


/**
* Returns the hour from this Date.
*
* @return the hour from this Date.
*/
unsigned int getHour() { return mHour; }
unsigned int getHour() const { return mHour; }


/**
* Returns the minute from this Date.
*
* @return the minute from this Date.
*/
unsigned int getMinute() { return mMinute; }
unsigned int getMinute() const { return mMinute; }


/**
* Returns the seconds from this Date.
*
* @return the seconds from this Date.
*/
unsigned int getSecond() { return mSecond; }
unsigned int getSecond() const { return mSecond; }


/**
* Returns the sign of the time zone offset from this Date.
*
* @return the sign of the offset from this Date.
*/
unsigned int getSignOffset() { return mSignOffset; }
unsigned int getSignOffset() const { return mSignOffset; }


/**
* Returns the hours of the time zone offset from this Date.
*
* @return the hours of the offset from this Date.
*/
unsigned int getHoursOffset() { return mHoursOffset; }
unsigned int getHoursOffset() const { return mHoursOffset; }


/**
* Returns the minutes of the time zone offset from this Date.
*
* @return the minutes of the offset from this Date.
*/
unsigned int getMinutesOffset() { return mMinutesOffset;}
unsigned int getMinutesOffset() const { return mMinutesOffset;}


/**
Expand All @@ -394,7 +394,7 @@ class LIBSBML_EXTERN Date
*
* @return the date as a string.
*/
const std::string& getDateAsString() { return mDate; }
const std::string& getDateAsString() const { return mDate; }


/**
Expand Down
8 changes: 4 additions & 4 deletions src/sbml/annotation/ModelHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ ModelHistory::getModifiedDate(unsigned int n)
* @return number in List of Creator
*/
unsigned int
ModelHistory::getNumCreators()
ModelHistory::getNumCreators() const
{
return mCreators != NULL ? mCreators->getSize() : 0;
}
Expand All @@ -336,7 +336,7 @@ ModelHistory::getNumCreators()
* @return number in List of modified dates
*/
unsigned int
ModelHistory::getNumModifiedDates()
ModelHistory::getNumModifiedDates() const
{
return mModifiedDates->getSize();
}
Expand All @@ -356,7 +356,7 @@ ModelHistory::getCreator(unsigned int n)
* otherwise.
*/
bool
ModelHistory::isSetCreatedDate()
ModelHistory::isSetCreatedDate() const
{
return mCreatedDate != NULL;
}
Expand All @@ -367,7 +367,7 @@ ModelHistory::isSetCreatedDate()
* otherwise.
*/
bool
ModelHistory::isSetModifiedDate()
ModelHistory::isSetModifiedDate() const
{
return (getNumModifiedDates() != 0);
}
Expand Down
8 changes: 4 additions & 4 deletions src/sbml/annotation/ModelHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class LIBSBML_EXTERN ModelHistory
* @return @c true if the creation date value of this ModelHistory is
* set, @c false otherwise.
*/
bool isSetCreatedDate();
bool isSetCreatedDate() const;


/**
Expand All @@ -216,7 +216,7 @@ class LIBSBML_EXTERN ModelHistory
* @return @c true if the modification date value of this ModelHistory
* object is set, @c false otherwise.
*/
bool isSetModifiedDate();
bool isSetModifiedDate() const;


/**
Expand Down Expand Up @@ -302,7 +302,7 @@ class LIBSBML_EXTERN ModelHistory
*
* @return the number of ModifiedDates in this ModelHistory.
*/
unsigned int getNumModifiedDates();
unsigned int getNumModifiedDates() const;


/**
Expand Down Expand Up @@ -358,7 +358,7 @@ class LIBSBML_EXTERN ModelHistory
*
* @return the number of ModelCreators objects.
*/
unsigned int getNumCreators();
unsigned int getNumCreators() const;


/**
Expand Down

0 comments on commit 40ced6e

Please sign in to comment.