Skip to content

Commit

Permalink
Added missing 'virtual' on Joint getType methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Koval committed May 25, 2015
1 parent fb0ce92 commit 71cd7b3
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dart/dynamics/BallJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BallJoint : public MultiDofJoint<3>
virtual ~BallJoint();

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/EulerJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class EulerJoint : public MultiDofJoint<3>
EulerJoint& operator=(const EulerJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/FreeJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class FreeJoint : public MultiDofJoint<6>
Properties getFreeJointProperties() const;

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
3 changes: 3 additions & 0 deletions dart/dynamics/Joint.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ class Joint : public virtual common::Subject
/// Get joint name
const std::string& getName() const;

/// Gets a string representing the joint type
virtual const std::string& getType() const = 0;

/// Set actuator type
void setActuatorType(ActuatorType _actuatorType);

Expand Down
15 changes: 0 additions & 15 deletions dart/dynamics/MultiDofJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,21 +945,6 @@ MultiDofJoint<DOF>& MultiDofJoint<DOF>::operator=(
return *this;
}

//==============================================================================
template <size_t DOF>
const std::string& MultiDofJoint<DOF>::getType() const
{
return getStaticType();
}

template <size_t DOF>
const std::string& MultiDofJoint<DOF>::getStaticType()
{
static const std::string name = "MultiDofJoint<" + std::to_string(DOF) + ">";

return name;
}

//==============================================================================
template <size_t DOF>
DegreeOfFreedom* MultiDofJoint<DOF>::getDof(size_t _index)
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/PlanarJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PlanarJoint : public MultiDofJoint<3>
PlanarJoint& operator=(const PlanarJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/PrismaticJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class PrismaticJoint : public SingleDofJoint
PrismaticJoint& operator=(const PrismaticJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/RevoluteJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class RevoluteJoint : public SingleDofJoint
RevoluteJoint& operator=(const RevoluteJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/ScrewJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ScrewJoint : public SingleDofJoint
ScrewJoint& operator=(const ScrewJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/TranslationalJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TranslationalJoint : public MultiDofJoint<3>
Properties getTranslationalJointProperties() const;

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/UniversalJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class UniversalJoint : public MultiDofJoint<2>
UniversalJoint& operator=(const UniversalJoint& _otherJoint);

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/WeldJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class WeldJoint : public ZeroDofJoint
Properties getWeldJointProperties() const;

// Documentation inherited
const std::string& getType() const override;
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();
Expand Down

0 comments on commit 71cd7b3

Please sign in to comment.