3using System.Threading.Tasks;
15 private readonly
string boxId = Guid.NewGuid().ToString();
19 private DateTime elapses;
39 public string BoxId => this.boxId;
78 internal set => this.elapses = value;
82 public override bool Equals(
object obj)
86 (this.min?.Equals(Obj.Min) ?? Obj.Min is
null) &&
87 (this.max?.
Equals(Obj.Max) ?? Obj.Max is
null);
93 int Result = this.min?.GetHashCode() ?? 0;
94 Result ^= Result << 5 ^ (this.max?.GetHashCode() ?? 0);
106 return !Location.LiesOutside(this.min, this.max,
false,
false);
117 return !Location.LiesOutside(this.min, this.max,
false,
false, IgnoreAltitude);
128 return this.SendEvent(Reference, Sender,
"added");
139 return this.SendEvent(Reference, Sender,
"updated");
150 return this.SendEvent(Reference, Sender,
"removed");
156 StringBuilder Xml =
new StringBuilder();
159 Xml.Append(EventName);
160 Xml.Append(
" xmlns='");
162 Xml.Append(
"' id='");
169 Xml.Append(EventName);
Helps with common XML-related tasks.
static string Encode(string s)
Encodes a string for use in XML.
XmppAddress MainDomain
Main/principal domain address
Contains information about one XMPP address.
override string ToString()
object.ToString()
static readonly XmppAddress Empty
Empty address.
Task< bool > SendMessage(string Type, string Id, string From, string To, string Language, string ContentXml)
Sends a Message stanza to a recipient.
Contains information about a position in a geo-spatial coordinate system.
const string NamespaceGeoSpatialNeuroFoundationV1
urn:nf:iot:geo:1.0
Represents a Geo-spatial subscription.
GeoPosition Min
Lower-left corner of bounding box.
bool LongitudeWrapped
If the bounding box is longitude-wrapped, i.e. if the box passes the +-180 degrees longitude.
DateTime Elapses
When subscription elapses.
Task ObjectUpdated(PersistedGeoSpatialObjectReference Reference, GeoSpatialComponent Sender)
Geo-spatial object has been updated within the area defined by the subscription.
bool Contains(GeoPosition Location)
If the bounding box contains a location.
bool IncludeMin
If the min latitude/longitude/altitude should be considered as included in the boundoing box.
override bool Equals(object obj)
XmppAddress From
Address of owner of subscription.
bool Contains(GeoPosition Location, bool IgnoreAltitude)
If the bounding box contains a location.
Task ObjectAdded(PersistedGeoSpatialObjectReference Reference, GeoSpatialComponent Sender)
Geo-spatial object has been added within the area defined by the subscription.
GeoPosition Max
Upper-right corner of bounding box.
GeoSubscription(XmppAddress From, GeoPosition Min, GeoPosition Max, DateTime Elapses)
Represents a Geo-spatial subscription.
bool IncludeMax
If the max latitude/longitude/altitude should be considered as included in the boundoing box.
override int GetHashCode()
string BoxId
The ID of the geo-spatial bounding box.
Task ObjectRemoved(PersistedGeoSpatialObjectReference Reference, GeoSpatialComponent Sender)
Geo-spatial object has been removed within the area defined by the subscription.
A persisted or persistable geo-spatial object reference.
void Serialize(StringBuilder Xml)
Serializes a geo-spatial object reference to XML.
Service Module hosting the XMPP broker and its components.
Interface for a geo-spatial bounding box using the Mercator Projection.