From 129298f6b4775f43b32ac09b31405b75f7cae08f Mon Sep 17 00:00:00 2001 From: David Bommes Date: Mon, 14 Jun 2010 17:05:07 +0000 Subject: [PATCH] added | and |= operator for UpdateType git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9514 383ad7c9-94d9-4d36-a494-682f7c89f535 --- common/UpdateType.cc | 18 +++++++++++++++++- common/UpdateType.hh | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/common/UpdateType.cc b/common/UpdateType.cc index 7d105282..00320266 100644 --- a/common/UpdateType.cc +++ b/common/UpdateType.cc @@ -37,6 +37,22 @@ bool UpdateType::operator==(const UpdateType& _type) const { return ((type_ & _type.type_).any()); }; +UpdateType +UpdateType::operator|(const UpdateType& _type) const +{ + return (type_ | _type.type_); +} + + +UpdateType& +UpdateType::operator|=(const UpdateType& _type) +{ + type_ |= _type.type_; + + return(*this); +} + + /// Check if this update contains the given UpdateType bool UpdateType::contains( const UpdateType& _type ) const { @@ -203,4 +219,4 @@ QString updateTypeName(UpdateType _id) { /// Return the number of registered types uint updateTypeCount() { return updateTypes.size(); -} \ No newline at end of file +} diff --git a/common/UpdateType.hh b/common/UpdateType.hh index edf5ff3c..11700ad2 100644 --- a/common/UpdateType.hh +++ b/common/UpdateType.hh @@ -16,6 +16,10 @@ class DLLEXPORT UpdateType { /// Exact compare operator bool operator==(const UpdateType& _type) const; + + UpdateType operator|(const UpdateType& _type) const; + + UpdateType& operator|=(const UpdateType& _type); UpdateType& operator++(); -- GitLab