diff options
author | Charles E. Rolke <chug@apache.org> | 2011-04-26 20:38:06 +0000 |
---|---|---|
committer | Charles E. Rolke <chug@apache.org> | 2011-04-26 20:38:06 +0000 |
commit | 3916dc4c7309d7c71123eb7dd08a9f12f30c1727 (patch) | |
tree | d069cf4e2db8fe1fd924a7ee340eb556b4f2e762 | |
parent | 1b07a80e85386a223b5661c0391e8dd8b2c598c3 (diff) | |
download | qpid-python-3916dc4c7309d7c71123eb7dd08a9f12f30c1727.tar.gz |
QPID-3226 Define more intuitive equality operators for Duration instances
Add == and != operators for Duration class.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1096898 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/bindings/qpid/dotnet/src/Duration.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Duration.h b/qpid/cpp/bindings/qpid/dotnet/src/Duration.h index 213c338a59..d4239fae88 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Duration.h +++ b/qpid/cpp/bindings/qpid/dotnet/src/Duration.h @@ -81,7 +81,17 @@ namespace Messaging { Duration ^ result = gcnew Duration(multiplier * dur->Milliseconds);
return result;
}
- };
+
+ static bool operator == (Duration ^ a, Duration ^ b)
+ {
+ return a->Milliseconds == b->Milliseconds;
+ }
+
+ static bool operator != (Duration ^ a, Duration ^ b)
+ {
+ return a->Milliseconds != b->Milliseconds;
+ }
+};
public ref class DurationConstants sealed
{
|