diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-11-08 16:39:31 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-11-08 16:39:31 +0100 |
| commit | e93ebc73fdf0e09b3391336a5697794593f5669e (patch) | |
| tree | b906baca876c8b8d1caf1b8e7d57fcfa4eddaf29 /src/IML/MemberAddress.cs | |
| parent | 4f00292638f779871aa907cda821ed7a752a9de9 (diff) | |
IML parser wip
Diffstat (limited to 'src/IML/MemberAddress.cs')
| -rw-r--r-- | src/IML/MemberAddress.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/IML/MemberAddress.cs b/src/IML/MemberAddress.cs new file mode 100644 index 00000000..85a346e4 --- /dev/null +++ b/src/IML/MemberAddress.cs @@ -0,0 +1,57 @@ +// +// MemberAddress.cs +// +// Author: +// Jean-Philippe Bruyère <jp.bruyere@hotmail.com> +// +// Copyright (c) 2016 jp +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +using System; +namespace Crow.IML +{ + /// <summary> + /// Address member of a node + /// </summary> + public struct MemberAddress + { + public NodeAddress Address; + public string Name; + + public MemberAddress (NodeAddress _address, string _member) + { + Address = _address; + Name = _member; + } + + #region Equality Compare + public override bool Equals (object obj) + { + return obj is MemberAddress && this == (MemberAddress)obj; + } + public override int GetHashCode () + { + return Address.GetHashCode () ^ Name.GetHashCode (); + } + public static bool operator == (MemberAddress x, MemberAddress y) + { + return x.Address == y.Address && x.Name == y.Name; + } + public static bool operator != (MemberAddress x, MemberAddress y) + { + return !(x == y); + } + #endregion + } +} |