aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-01 14:31:30 +0000
committerJeff Ames2008-05-01 14:31:30 +0000
commitd51ce47b2d7635b17f3dd429158e8f59b78b83aa (patch)
treed3595bd5194199184059aa398b91a51dc6c799cf /OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs
parent* Looks like I had the bamboo build right in the first place - it was just th... (diff)
downloadopensim-SC-d51ce47b2d7635b17f3dd429158e8f59b78b83aa.zip
opensim-SC-d51ce47b2d7635b17f3dd429158e8f59b78b83aa.tar.gz
opensim-SC-d51ce47b2d7635b17f3dd429158e8f59b78b83aa.tar.bz2
opensim-SC-d51ce47b2d7635b17f3dd429158e8f59b78b83aa.tar.xz
Update svn properties. Minor formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs98
1 files changed, 49 insertions, 49 deletions
diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs
index 2c72bb9..453a2b7 100644
--- a/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs
+++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs
@@ -1,50 +1,50 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using OpenSim.Framework; 3using OpenSim.Framework;
4 4
5namespace OpenSim.Region.Environment.Modules.Grid.Interregion 5namespace OpenSim.Region.Environment.Modules.Grid.Interregion
6{ 6{
7 public class RemotingObject : MarshalByRefObject 7 public class RemotingObject : MarshalByRefObject
8 { 8 {
9 private readonly Location[] m_coords; 9 private readonly Location[] m_coords;
10 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>(); 10 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>();
11 11
12 public RemotingObject(Dictionary<Type, Object> myInterfaces, Location[] coords) 12 public RemotingObject(Dictionary<Type, Object> myInterfaces, Location[] coords)
13 { 13 {
14 m_interfaces = myInterfaces; 14 m_interfaces = myInterfaces;
15 m_coords = coords; 15 m_coords = coords;
16 } 16 }
17 17
18 public Location[] GetLocations() 18 public Location[] GetLocations()
19 { 19 {
20 return (Location[]) m_coords.Clone(); 20 return (Location[]) m_coords.Clone();
21 } 21 }
22 22
23 public string[] GetInterfaces() 23 public string[] GetInterfaces()
24 { 24 {
25 string[] interfaces = new string[m_interfaces.Count]; 25 string[] interfaces = new string[m_interfaces.Count];
26 int i = 0; 26 int i = 0;
27 27
28 foreach (KeyValuePair<Type, object> pair in m_interfaces) 28 foreach (KeyValuePair<Type, object> pair in m_interfaces)
29 { 29 {
30 interfaces[i++] = pair.Key.FullName; 30 interfaces[i++] = pair.Key.FullName;
31 } 31 }
32 32
33 return interfaces; 33 return interfaces;
34 } 34 }
35 35
36 /// <summary> 36 /// <summary>
37 /// Returns a registered interface availible to neighbouring regions. 37 /// Returns a registered interface availible to neighbouring regions.
38 /// </summary> 38 /// </summary>
39 /// <typeparam name="T">The type of interface you wish to request</typeparam> 39 /// <typeparam name="T">The type of interface you wish to request</typeparam>
40 /// <returns>A MarshalByRefObject inherited from this region inheriting the interface requested.</returns> 40 /// <returns>A MarshalByRefObject inherited from this region inheriting the interface requested.</returns>
41 /// <remarks>All registered interfaces <b>MUST</b> inherit from MarshalByRefObject and use only serialisable types.</remarks> 41 /// <remarks>All registered interfaces <b>MUST</b> inherit from MarshalByRefObject and use only serialisable types.</remarks>
42 public T RequestInterface<T>() 42 public T RequestInterface<T>()
43 { 43 {
44 if (m_interfaces.ContainsKey(typeof (T))) 44 if (m_interfaces.ContainsKey(typeof (T)))
45 return (T) m_interfaces[typeof (T)]; 45 return (T) m_interfaces[typeof (T)];
46 46
47 throw new NotSupportedException("No such interface registered."); 47 throw new NotSupportedException("No such interface registered.");
48 } 48 }
49 } 49 }
50} \ No newline at end of file 50} \ No newline at end of file