diff options
author | Adam Frisby | 2008-05-01 16:35:00 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 16:35:00 +0000 |
commit | 13526097f24b7a8ad63b1d482c44b44397fa055f (patch) | |
tree | 7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/Types/UpdateQueue.cs | |
parent | * Breaking all the code, breaking all the code..! (diff) | |
download | opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.zip opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2 opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz |
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly.
* Reformatted code sections.
* Removed redundant code.
Diffstat (limited to 'OpenSim/Region/Environment/Types/UpdateQueue.cs')
-rw-r--r-- | OpenSim/Region/Environment/Types/UpdateQueue.cs | 103 |
1 files changed, 53 insertions, 50 deletions
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs index ec1ffd2..24fe116 100644 --- a/OpenSim/Region/Environment/Types/UpdateQueue.cs +++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs | |||
@@ -34,26 +34,70 @@ using OpenSim.Region.Environment.Scenes; | |||
34 | 34 | ||
35 | namespace OpenSim.Region.Environment.Types | 35 | namespace OpenSim.Region.Environment.Types |
36 | { | 36 | { |
37 | [Serializable] | 37 | [Serializable] |
38 | public class UpdateQueue : ISerializable | 38 | public class UpdateQueue : ISerializable |
39 | { | 39 | { |
40 | private Queue<SceneObjectPart> m_queue; | 40 | private readonly List<LLUUID> m_ids; |
41 | private readonly Queue<SceneObjectPart> m_queue; | ||
41 | 42 | ||
42 | private List<LLUUID> m_ids; | 43 | private readonly object m_syncObject = new object(); |
43 | 44 | ||
44 | private object m_syncObject = new object(); | 45 | public UpdateQueue() |
46 | { | ||
47 | m_queue = new Queue<SceneObjectPart>(); | ||
48 | m_ids = new List<LLUUID>(); | ||
49 | } | ||
50 | |||
51 | protected UpdateQueue(SerializationInfo info, StreamingContext context) | ||
52 | { | ||
53 | //System.Console.WriteLine("UpdateQueue Deserialize BGN"); | ||
54 | |||
55 | if (info == null) | ||
56 | { | ||
57 | throw new ArgumentNullException("info"); | ||
58 | } | ||
59 | |||
60 | m_queue = (Queue<SceneObjectPart>) info.GetValue("m_queue", typeof (Queue<SceneObjectPart>)); | ||
61 | List<Guid> ids_work = (List<Guid>) info.GetValue("m_ids", typeof (List<Guid>)); | ||
62 | |||
63 | foreach (Guid guid in ids_work) | ||
64 | { | ||
65 | m_ids.Add(new LLUUID(guid)); | ||
66 | } | ||
67 | |||
68 | //System.Console.WriteLine("UpdateQueue Deserialize END"); | ||
69 | } | ||
45 | 70 | ||
46 | public int Count | 71 | public int Count |
47 | { | 72 | { |
48 | get { return m_queue.Count; } | 73 | get { return m_queue.Count; } |
49 | } | 74 | } |
50 | 75 | ||
51 | public UpdateQueue() | 76 | #region ISerializable Members |
77 | |||
78 | [SecurityPermission(SecurityAction.LinkDemand, | ||
79 | Flags = SecurityPermissionFlag.SerializationFormatter)] | ||
80 | public virtual void GetObjectData( | ||
81 | SerializationInfo info, StreamingContext context) | ||
52 | { | 82 | { |
53 | m_queue = new Queue<SceneObjectPart>(); | 83 | if (info == null) |
54 | m_ids = new List<LLUUID>(); | 84 | { |
85 | throw new ArgumentNullException("info"); | ||
86 | } | ||
87 | |||
88 | List<Guid> ids_work = new List<Guid>(); | ||
89 | |||
90 | foreach (LLUUID uuid in m_ids) | ||
91 | { | ||
92 | ids_work.Add(uuid.UUID); | ||
93 | } | ||
94 | |||
95 | info.AddValue("m_queue", m_queue); | ||
96 | info.AddValue("m_ids", ids_work); | ||
55 | } | 97 | } |
56 | 98 | ||
99 | #endregion | ||
100 | |||
57 | public void Clear() | 101 | public void Clear() |
58 | { | 102 | { |
59 | lock (m_syncObject) | 103 | lock (m_syncObject) |
@@ -89,46 +133,5 @@ namespace OpenSim.Region.Environment.Types | |||
89 | 133 | ||
90 | return part; | 134 | return part; |
91 | } | 135 | } |
92 | |||
93 | protected UpdateQueue(SerializationInfo info, StreamingContext context) | ||
94 | { | ||
95 | //System.Console.WriteLine("UpdateQueue Deserialize BGN"); | ||
96 | |||
97 | if (info == null) | ||
98 | { | ||
99 | throw new ArgumentNullException("info"); | ||
100 | } | ||
101 | |||
102 | m_queue = (Queue<SceneObjectPart>)info.GetValue("m_queue", typeof(Queue<SceneObjectPart>)); | ||
103 | List<Guid> ids_work = (List<Guid>)info.GetValue("m_ids", typeof(List<Guid>)); | ||
104 | |||
105 | foreach (Guid guid in ids_work) | ||
106 | { | ||
107 | m_ids.Add(new LLUUID(guid)); | ||
108 | } | ||
109 | |||
110 | //System.Console.WriteLine("UpdateQueue Deserialize END"); | ||
111 | } | ||
112 | |||
113 | [SecurityPermission(SecurityAction.LinkDemand, | ||
114 | Flags = SecurityPermissionFlag.SerializationFormatter)] | ||
115 | public virtual void GetObjectData( | ||
116 | SerializationInfo info, StreamingContext context) | ||
117 | { | ||
118 | if (info == null) | ||
119 | { | ||
120 | throw new ArgumentNullException("info"); | ||
121 | } | ||
122 | |||
123 | List<Guid> ids_work = new List<Guid>(); | ||
124 | |||
125 | foreach (LLUUID uuid in m_ids) | ||
126 | { | ||
127 | ids_work.Add(uuid.UUID); | ||
128 | } | ||
129 | |||
130 | info.AddValue("m_queue", m_queue); | ||
131 | info.AddValue("m_ids", ids_work); | ||
132 | } | ||
133 | } | 136 | } |
134 | } | 137 | } \ No newline at end of file |