Skip to content

Commit

Permalink
Adding const to getters
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Mar 10, 2016
1 parent 7dbd73d commit 317e259
Show file tree
Hide file tree
Showing 107 changed files with 1,838 additions and 1,846 deletions.
6 changes: 3 additions & 3 deletions include/vrv/accid.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class Accid : public LayerElement, public PositionInterface, public AttAccidenta
Accid();
virtual ~Accid();
virtual void Reset();
virtual std::string GetClassName() { return "Accid"; };
virtual ClassId Is() { return ACCID; };
virtual std::string GetClassName() const { return "Accid"; };
virtual ClassId Is() const { return ACCID; };
///@}

virtual PositionInterface *GetPositionInterface() { return dynamic_cast<PositionInterface *>(this); }

/** Override the method since alignment is required */
virtual bool HasToBeAligned() { return true; };
virtual bool HasToBeAligned() const { return true; };

//----------//
// Functors //
Expand Down
59 changes: 30 additions & 29 deletions include/vrv/aligner.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SystemAligner : public Object {
// constructors and destructors
SystemAligner();
virtual ~SystemAligner();
virtual ClassId Is() { return SYSTEM_ALIGNER; }
virtual ClassId Is() const { return SYSTEM_ALIGNER; }

int GetStaffAlignmentCount() const { return (int)m_children.size(); };

Expand All @@ -74,21 +74,22 @@ class SystemAligner : public Object {
* Get bottom StaffAlignment for the system.
* For each SystemAligner, we keep a StaffAlignment for the bottom position.
*/
StaffAlignment *GetBottomAlignment() { return m_bottomAlignment; };
StaffAlignment *GetBottomAlignment() const { return m_bottomAlignment; };

/**
* Get the StaffAlignment at index idx.
* Creates the StaffAlignment if not there yet.
* Checks the they are created incrementally (without gap).
* If a staff is passed, it will be used for initializing m_staffN and m_staffSize of the aligner.
* (no const since the bottom alignment is temporarily removed)
*/
StaffAlignment *GetStaffAlignment(int idx, Staff *staff = NULL);

/**
* Get the StaffAlignment for the staffN.
* Return NULL if not found.
*/
StaffAlignment *GetStaffAlignmentForStaffN(int staffN);
StaffAlignment *GetStaffAlignmentForStaffN(int staffN) const;

private:
//
Expand Down Expand Up @@ -117,17 +118,17 @@ class StaffAlignment : public Object {
///@{
StaffAlignment();
virtual ~StaffAlignment();
virtual ClassId Is() { return STAFF_ALIGNMENT; }
virtual ClassId Is() const { return STAFF_ALIGNMENT; }
///@}

void SetYRel(int yRel) { m_yRel = yRel; };
int GetYRel() { return m_yRel; };
int GetYRel() const { return m_yRel; };

void SetYShift(int yShift);
int GetYShift() { return m_yShift; };
int GetYShift() const { return m_yShift; };

void SetMaxHeight(int max_height);
int GetMaxHeight() { return m_maxHeight; };
int GetMaxHeight() const { return m_maxHeight; };

/**
* @name Set and get verse count.
Expand All @@ -136,24 +137,24 @@ class StaffAlignment : public Object {
*/
///@{
void SetVerseCount(int verse_count);
int GetVerseCount() { return m_verseCount; };
int GetVerseCount() const { return m_verseCount; };

/**
* @name Setter and getter for above or below dir/dynam/hairpin
*/
///@{
void SetDirAbove() { m_dirAbove = true; };
bool GetDirAbove() { return m_dirAbove; };
bool GetDirAbove() const { return m_dirAbove; };
void SetDirBelow() { m_dirBelow = true; };
bool GetDirBelow() { return m_dirBelow; };
bool GetDirBelow() const { return m_dirBelow; };
void SetDynamAbove() { m_dynamAbove = true; };
bool GetDynamAbove() { return m_dynamAbove; };
bool GetDynamAbove() const { return m_dynamAbove; };
void SetDynamBelow() { m_dynamBelow = true; };
bool GetDynamBelow() { return m_dynamBelow; };
bool GetDynamBelow() const { return m_dynamBelow; };
void SetHairpinAbove() { m_hairpinAbove = true; };
bool GetHairpinAbove() { return m_hairpinAbove; };
bool GetHairpinAbove() const { return m_hairpinAbove; };
void SetHairpinBelow() { m_hairpinBelow = true; };
bool GetHairpinBelow() { return m_hairpinBelow; };
bool GetHairpinBelow() const { return m_hairpinBelow; };
///@}

void SetCurrentBoundingBox(FloatingElement *element, int x, int y);
Expand All @@ -163,7 +164,7 @@ class StaffAlignment : public Object {
* Used for accessing the staff @n, the size, etc.
*/
///@{
Staff *GetStaff() { return m_staff; };
Staff *GetStaff() const { return m_staff; };
void SetStaff(Staff *staff) { m_staff = staff; };
///@}

Expand Down Expand Up @@ -237,31 +238,31 @@ class Alignment : public Object {
Alignment();
Alignment(double time, AlignmentType type = ALIGNMENT_DEFAULT);
virtual ~Alignment();
virtual ClassId Is() { return ALIGNMENT; }
virtual ClassId Is() const { return ALIGNMENT; }

void SetXRel(int x_rel);
int GetXRel() { return m_xRel; };
int GetXRel() const { return m_xRel; };

void SetXShift(int xShift);
int GetXShift() { return m_xShift; };
int GetXShift() const { return m_xShift; };

void SetMaxWidth(int maxWidth);
int GetMaxWidth() { return m_maxWidth; };
int GetMaxWidth() const { return m_maxWidth; };

/**
* @name Set and get the time value of the alignment
*/
///@{
void SetTime(double time) { m_time = time; };
double GetTime() { return m_time; };
double GetTime() const { return m_time; };
///@}

/**
* @name Set and get the type of the alignment
*/
///@{
void SetType(AlignmentType type) { m_type = type; };
AlignmentType GetType() { return m_type; };
AlignmentType GetType() const { return m_type; };
///@}

/**
Expand All @@ -273,7 +274,7 @@ class Alignment : public Object {
/**
* Returns true if the aligner has a GraceAligner
*/
bool HasGraceAligner() { return (m_graceAligner != NULL); };
bool HasGraceAligner() const { return (m_graceAligner != NULL); };

/**
* Correct the X alignment of grace notes once the content of a system has been aligned and laid out.
Expand Down Expand Up @@ -359,7 +360,7 @@ class MeasureAligner : public Object {
// constructors and destructors
MeasureAligner();
virtual ~MeasureAligner();
virtual ClassId Is() { return MEASURE_ALIGNER; }
virtual ClassId Is() const { return MEASURE_ALIGNER; }

int GetAlignmentCount() const { return (int)m_children.size(); };

Expand All @@ -382,22 +383,22 @@ class MeasureAligner : public Object {
*/
///@{
void SetNonJustifiableMargin(int margin) { m_nonJustifiableLeftMargin = margin; };
int GetNonJustifiableMargin() { return m_nonJustifiableLeftMargin; };
int GetNonJustifiableMargin() const { return m_nonJustifiableLeftMargin; };
///@}

/**
* Get left Alignment for the measure.
* For each MeasureAligner, we keep and Alignment for the left position.
* The Alignment time will be always 0.0 and will appear first in the list.
*/
Alignment *GetLeftAlignment() { return m_leftAlignment; };
Alignment *GetLeftAlignment() const { return m_leftAlignment; };

/**
* Get right Alignment for the measure.
* For each MeasureAligner, we keep and Alignment for the right position.
* The Alignment time will be increased whenever necessary when values are added.
*/
Alignment *GetRightAlignment() { return m_rightAlignment; };
Alignment *GetRightAlignment() const { return m_rightAlignment; };

/**
* Correct the X alignment once the the content of a system has been aligned and laid out.
Expand Down Expand Up @@ -453,7 +454,7 @@ class GraceAligner : public MeasureAligner {
// constructors and destructors
GraceAligner();
virtual ~GraceAligner();
virtual ClassId Is() { return GRACE_ALIGNER; }
virtual ClassId Is() const { return GRACE_ALIGNER; }

/**
* Because the grace notes appear from left to right but need to be aligned
Expand All @@ -473,7 +474,7 @@ class GraceAligner : public MeasureAligner {
*/
///@{
void SetWidth(int totalWidth) { m_totalWidth = totalWidth; };
int GetWidth() { return m_totalWidth; };
int GetWidth() const { return m_totalWidth; };
///@}

private:
Expand Down Expand Up @@ -507,7 +508,7 @@ class TimestampAligner : public Object {
// constructors and destructors
TimestampAligner();
virtual ~TimestampAligner();
virtual ClassId Is() { return TIMESTAMP_ALIGNER; }
virtual ClassId Is() const { return TIMESTAMP_ALIGNER; }

/**
* Reset the aligner (clear the content)
Expand Down
4 changes: 2 additions & 2 deletions include/vrv/anchoredtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class AnchoredText : public FloatingElement, public TextDirInterface {
AnchoredText();
virtual ~AnchoredText();
virtual void Reset();
virtual std::string GetClassName() { return "AnchoredText"; };
virtual ClassId Is() { return ANCHORED_TEXT; };
virtual std::string GetClassName() const { return "AnchoredText"; };
virtual ClassId Is() const { return ANCHORED_TEXT; };
///@}

virtual TextDirInterface *GetTextDirInterface() { return dynamic_cast<TextDirInterface *>(this); }
Expand Down
78 changes: 39 additions & 39 deletions include/vrv/att.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,85 +68,85 @@ class Att : public AttConverter {
* Idem for getting attributes as strings
*/
// static void GetAnalysis(Object *element, ArrayOfStrAttr *attributes);
static void GetCmn(Object *element, ArrayOfStrAttr *attributes);
static void GetCmn(const Object *element, ArrayOfStrAttr *attributes);
// static void GetCmnornaments(Object *element, ArrayOfStrAttr *attributes);
static void GetCritapp(Object *element, ArrayOfStrAttr *attributes);
static void GetCritapp(const Object *element, ArrayOfStrAttr *attributes);
// static void GetEdittrans(Object *element, ArrayOfStrAttr *attributes);
// static void GetFacsimile(Object *element, ArrayOfStrAttr *attributes);
// static void GetFigtable(Object *element, ArrayOfStrAttr *attributes);
// static void GetHarmony(Object *element, ArrayOfStrAttr *attributes);
// static void GetHeader(Object *element, ArrayOfStrAttr *attributes);
// static void GetLyrics(Object *element, ArrayOfStrAttr *attributes);
static void GetMei(Object *element, ArrayOfStrAttr *attributes);
static void GetMensural(Object *element, ArrayOfStrAttr *attributes);
static void GetMei(const Object *element, ArrayOfStrAttr *attributes);
static void GetMensural(const Object *element, ArrayOfStrAttr *attributes);
// static void GetMidi(Object *element, ArrayOfStrAttr *attributes);
static void GetPagebased(Object *element, ArrayOfStrAttr *attributes);
static void GetPagebased(const Object *element, ArrayOfStrAttr *attributes);
// static void GetPerformance(Object *element, ArrayOfStrAttr *attributes);
// static void GetNeumes(Object *element, ArrayOfStrAttr *attributes);
static void GetShared(Object *element, ArrayOfStrAttr *attributes);
static void GetShared(const Object *element, ArrayOfStrAttr *attributes);
// static void GetTablature(Object *element, ArrayOfStrAttr *attributes);
// static void GetUsersymbols(Object *element, ArrayOfStrAttr *attributes);
///@}

public:
/** Dummy string converter */
std::string StrToStr(std::string str);
std::string StrToStr(std::string str) const;

/** @name Basic converters for writing */
///@{
std::string DblToStr(double data);
std::string IntToStr(int data);
std::string DblToStr(double data) const;
std::string IntToStr(int data) const;
///@}

/** @name Basic converters for reading */
///@{
double StrToDbl(std::string value);
int StrToInt(std::string value);
double StrToDbl(std::string value) const;
int StrToInt(std::string value) const;
///@}

/** @name Converters for writing and reading */
///@{
std::string BeatrptRendToStr(data_BEATRPT_REND data);
data_BEATRPT_REND StrToBeatrptRend(std::string value);
std::string BeatrptRendToStr(data_BEATRPT_REND data) const;
data_BEATRPT_REND StrToBeatrptRend(std::string value) const;

std::string DurationToStr(data_DURATION data);
data_DURATION StrToDuration(std::string value);
std::string DurationToStr(data_DURATION data) const;
data_DURATION StrToDuration(std::string value) const;

std::string KeysignatureToStr(data_KEYSIGNATURE data);
data_KEYSIGNATURE StrToKeysignature(std::string value);
std::string KeysignatureToStr(data_KEYSIGNATURE data) const;
data_KEYSIGNATURE StrToKeysignature(std::string value) const;

std::string MeasurebeatToStr(data_MEASUREBEAT data);
data_MEASUREBEAT StrToMeasurebeat(std::string value);
std::string MeasurebeatToStr(data_MEASUREBEAT data) const;
data_MEASUREBEAT StrToMeasurebeat(std::string value) const;

std::string ModusmaiorToStr(data_MODUSMAIOR data);
data_MODUSMAIOR StrToModusmaior(std::string value);
std::string ModusmaiorToStr(data_MODUSMAIOR data) const;
data_MODUSMAIOR StrToModusmaior(std::string value) const;

std::string ModusminorToStr(data_MODUSMINOR data);
data_MODUSMINOR StrToModusminor(std::string value);
std::string ModusminorToStr(data_MODUSMINOR data) const;
data_MODUSMINOR StrToModusminor(std::string value) const;

std::string OctaveDisToStr(data_OCTAVE_DIS data);
data_OCTAVE_DIS StrToOctaveDis(std::string value);
std::string OctaveDisToStr(data_OCTAVE_DIS data) const;
data_OCTAVE_DIS StrToOctaveDis(std::string value) const;

std::string OrientationToStr(data_ORIENTATION data);
data_ORIENTATION StrToOrientation(std::string value);
std::string OrientationToStr(data_ORIENTATION data) const;
data_ORIENTATION StrToOrientation(std::string value) const;

std::string PitchnameToStr(data_PITCHNAME data);
data_PITCHNAME StrToPitchname(std::string value);
std::string PitchnameToStr(data_PITCHNAME data) const;
data_PITCHNAME StrToPitchname(std::string value) const;

std::string ProlatioToStr(data_PROLATIO data);
data_PROLATIO StrToProlatio(std::string value);
std::string ProlatioToStr(data_PROLATIO data) const;
data_PROLATIO StrToProlatio(std::string value) const;

std::string StemdirectionToStr(data_STEMDIRECTION data);
data_STEMDIRECTION StrToStemdirection(std::string value);
std::string StemdirectionToStr(data_STEMDIRECTION data) const;
data_STEMDIRECTION StrToStemdirection(std::string value) const;

std::string TempusToStr(data_TEMPUS data);
data_TEMPUS StrToTempus(std::string value);
std::string TempusToStr(data_TEMPUS data) const;
data_TEMPUS StrToTempus(std::string value) const;

std::string TieToStr(data_TIE data);
data_TIE StrToTie(std::string value);
std::string TieToStr(data_TIE data) const;
data_TIE StrToTie(std::string value) const;

std::string XsdPosintlistToStr(xsd_posIntList data);
xsd_posIntList StrToXsdPosintlist(std::string value);
std::string XsdPosintlistToStr(xsd_posIntList data) const;
xsd_posIntList StrToXsdPosintlist(std::string value) const;
///@}
};

Expand Down
16 changes: 8 additions & 8 deletions include/vrv/barline.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class BarLine : public LayerElement, public AttBarLineLog {
BarLine();
virtual ~BarLine();
virtual void Reset();
virtual Object *Clone() { return new BarLine(*this); };
virtual std::string GetClassName() { return "BarLine"; };
virtual ClassId Is() { return BARLINE; };
virtual Object *Clone() const { return new BarLine(*this); };
virtual std::string GetClassName() const { return "BarLine"; };
virtual ClassId Is() const { return BARLINE; };
///@}

/** Override the method since alignment is required */
virtual bool HasToBeAligned() { return true; };
virtual bool HasToBeAligned() const { return true; };

/**
* Use to set the alignment for the Measure BarLine members.
Expand All @@ -47,7 +47,7 @@ class BarLine : public LayerElement, public AttBarLineLog {
/*
* Return true if the barLine type requires repetition dots to be drawn.
*/
bool HasRepetitionDots();
bool HasRepetitionDots() const;

private:
//
Expand All @@ -72,9 +72,9 @@ class BarLineAttr : public BarLine {
///@{
BarLineAttr();
virtual ~BarLineAttr();
virtual Object *Clone() { return new BarLineAttr(*this); };
virtual std::string GetClassName() { return "BarLineAttr"; };
virtual ClassId Is() { return BARLINE_ATTR; };
virtual Object *Clone() const { return new BarLineAttr(*this); };
virtual std::string GetClassName() const { return "BarLineAttr"; };
virtual ClassId Is() const { return BARLINE_ATTR; };
///@}
};

Expand Down
Loading

0 comments on commit 317e259

Please sign in to comment.