Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make operators const (fix #10) #12

Merged
merged 1 commit into from
Aug 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/actionlib/client/client_goal_handle_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void ClientGoalHandle<ActionSpec>::cancel()
}

template<class ActionSpec>
bool ClientGoalHandle<ActionSpec>::operator==(const ClientGoalHandle<ActionSpec>& rhs)
bool ClientGoalHandle<ActionSpec>::operator==(const ClientGoalHandle<ActionSpec>& rhs) const
{
// Check if both are inactive
if (!active_ && !rhs.active_)
Expand All @@ -272,7 +272,7 @@ bool ClientGoalHandle<ActionSpec>::operator==(const ClientGoalHandle<ActionSpec>
}

template<class ActionSpec>
bool ClientGoalHandle<ActionSpec>::operator!=(const ClientGoalHandle<ActionSpec>& rhs)
bool ClientGoalHandle<ActionSpec>::operator!=(const ClientGoalHandle<ActionSpec>& rhs) const
{
return !(*this==rhs);
}
Expand Down
4 changes: 2 additions & 2 deletions include/actionlib/client/client_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ class ClientGoalHandle
* \brief Check if two goal handles point to the same goal
* \return TRUE if both point to the same goal. Also returns TRUE if both handles are inactive.
*/
bool operator==(const ClientGoalHandle<ActionSpec>& rhs);
bool operator==(const ClientGoalHandle<ActionSpec>& rhs) const;

/**
* \brief !(operator==())
*/
bool operator!=(const ClientGoalHandle<ActionSpec>& rhs);
bool operator!=(const ClientGoalHandle<ActionSpec>& rhs) const;

friend class GoalManager<ActionSpec>;
private:
Expand Down
4 changes: 2 additions & 2 deletions include/actionlib/client_goal_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ class ClientGoalStatus
/**
* \brief Straightforward enum equality check
*/
inline bool operator==(const ClientGoalStatus& rhs)
inline bool operator==(const ClientGoalStatus& rhs) const
{
return state_ == rhs.state_;
}

/**
* \brief Straightforward enum inequality check
*/
inline bool operator!=(const ClientGoalStatus& rhs)
inline bool operator!=(const ClientGoalStatus& rhs) const
{
return !(state_ == rhs.state_);
}
Expand Down
2 changes: 1 addition & 1 deletion include/actionlib/managed_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ManagedList
/**
* \brief Checks if two handles point to the same list elem
*/
bool operator==(const Handle& rhs)
bool operator==(const Handle& rhs) const
{
assert(valid_);
assert(rhs.valid_);
Expand Down
4 changes: 2 additions & 2 deletions include/actionlib/server/server_goal_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ namespace actionlib {
* @param other The ServerGoalHandle to compare to
* @return True if the ServerGoalHandles refer to the same goal, false otherwise
*/
bool operator==(const ServerGoalHandle& other);
bool operator==(const ServerGoalHandle& other) const;

/**
* @brief != operator for ServerGoalHandles
* @param other The ServerGoalHandle to compare to
* @return True if the ServerGoalHandles refer to different goals, false otherwise
*/
bool operator!=(const ServerGoalHandle& other);
bool operator!=(const ServerGoalHandle& other) const;

private:
/**
Expand Down
4 changes: 2 additions & 2 deletions include/actionlib/server/server_goal_handle_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace actionlib {
}

template <class ActionSpec>
bool ServerGoalHandle<ActionSpec>::operator==(const ServerGoalHandle& other){
bool ServerGoalHandle<ActionSpec>::operator==(const ServerGoalHandle& other) const{
if(!goal_ && !other.goal_)
return true;

Expand All @@ -304,7 +304,7 @@ namespace actionlib {
}

template <class ActionSpec>
bool ServerGoalHandle<ActionSpec>::operator!=(const ServerGoalHandle& other){
bool ServerGoalHandle<ActionSpec>::operator!=(const ServerGoalHandle& other) const{
return !(*this == other);
}

Expand Down