|
From: <ad...@us...> - 2007-02-04 02:54:08
|
Revision: 46
http://svn.sourceforge.net/g3l/?rev=46&view=rev
Author: adamluk
Date: 2007-02-03 18:54:08 -0800 (Sat, 03 Feb 2007)
Log Message:
-----------
Added private class SynchronizeQueue to Collections.Queue.
Added threading support to Logger class.
Modified Paths:
--------------
src/trunk/G3L.Core/Collections/Queue.cs
src/trunk/G3L.Core/G3L.Core.csproj
src/trunk/G3L.Core/bin/Debug/G3L.Core.dll
src/trunk/G3L.Core/bin/Debug/G3L.Core.pdb
src/trunk/G3L.Core/obj/Debug/G3L.Core.dll
src/trunk/G3L.Core/obj/Debug/G3L.Core.pdb
src/trunk/G3L.Data/bin/Debug/G3L.Data.dll
src/trunk/G3L.Data/bin/Debug/G3L.Data.pdb
src/trunk/G3L.Data/obj/Debug/G3L.Data.dll
src/trunk/G3L.Data/obj/Debug/G3L.Data.pdb
src/trunk/G3L.Debug/G3L.Debug.csproj
src/trunk/G3L.Debug/Log/Logger.cs
src/trunk/G3L.Debug/Log/LoggerEventHandler.cs
src/trunk/G3L.Framework/bin/Debug/G3L.Framework.dll
src/trunk/G3L.Framework/bin/Debug/G3L.Framework.pdb
src/trunk/G3L.Framework/obj/Debug/G3L.Framework.dll
src/trunk/G3L.Framework/obj/Debug/G3L.Framework.pdb
src/trunk/G3L.Net/bin/Debug/G3L.Net.dll
src/trunk/G3L.Net/bin/Debug/G3L.Net.pdb
src/trunk/G3L.Net/obj/Debug/G3L.Net.dll
src/trunk/G3L.Net/obj/Debug/G3L.Net.pdb
src/trunk/G3L.UnitTests/obj/Debug/ResolveAssemblyReference.cache
src/trunk/G3L.Util/bin/Debug/G3L.Util.dll
src/trunk/G3L.Util/bin/Debug/G3L.Util.pdb
src/trunk/G3L.Util/obj/Debug/G3L.Util.dll
src/trunk/G3L.Util/obj/Debug/G3L.Util.pdb
src/trunk/G3L.suo
Added Paths:
-----------
src/trunk/G3L.Debug/obj/Debug/ResolveAssemblyReference.cache
Removed Paths:
-------------
src/trunk/G3L.Core/Collections/QueueEnumerator.cs
src/trunk/G3L.Debug/bin/Debug/G3L.Debug.dll
src/trunk/G3L.Debug/bin/Debug/G3L.Debug.pdb
src/trunk/G3L.Debug/obj/Debug/G3L.Debug.dll
src/trunk/G3L.Debug/obj/Debug/G3L.Debug.pdb
src/trunk/G3L.UnitTests/bin/Debug/G3L.Debug.dll
src/trunk/G3L.UnitTests/bin/Debug/G3L.Debug.pdb
src/trunk/G3L.UnitTests/bin/Debug/G3L.UnitTests.dll
src/trunk/G3L.UnitTests/bin/Debug/G3L.UnitTests.pdb
src/trunk/G3L.UnitTests/bin/Debug/csUnit.dll
src/trunk/G3L.UnitTests/obj/Debug/G3L.UnitTests.dll
src/trunk/G3L.UnitTests/obj/Debug/G3L.UnitTests.pdb
Modified: src/trunk/G3L.Core/Collections/Queue.cs
===================================================================
--- src/trunk/G3L.Core/Collections/Queue.cs 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Core/Collections/Queue.cs 2007-02-04 02:54:08 UTC (rev 46)
@@ -4,6 +4,10 @@
namespace G3L.Core.Collections
{
+ /// <summary>
+ /// Generic queue collection.
+ /// </summary>
+ /// <typeparam name="K">Type of object.</typeparam>
[Serializable]
public class Queue<T> : ICollection<T>, IEnumerable<T>, ICloneable
{
@@ -94,13 +98,23 @@
return this.GetEnumerator();
}
- // TODO: Add(T) ICollection method
+ public static Queue<T> Synchronized(Queue<T> queue)
+ {
+ if (queue == null)
+ {
+ throw new ArgumentNullException("queue");
+ }
+
+ return new SynchronizeQueue<T>(queue);
+ }
+
+ // TODO: Add(K) ICollection method
public void Add(T item)
{
throw new Exception("The method or operation is not implemented.");
}
- // TODO: Remove(T) ICollection method
+ // TODO: Remove(K) ICollection method
public bool Remove(T item)
{
throw new Exception("The method or operation is not implemented.");
@@ -197,10 +211,63 @@
return false;
}
+ private class SynchronizeQueue<K> : Queue<K>
+ {
+ private Queue<K> _Queue;
+
+ internal SynchronizeQueue(Queue<K> queue)
+ {
+ this._Queue = queue;
+ }
+
+ public override int Count
+ {
+ get
+ {
+ lock (this._Queue)
+ {
+ return this._Queue.Count;
+ }
+ }
+ }
+
+ public override bool IsSynchronized
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override object SyncRoot
+ {
+ get
+ {
+ return this._Queue.SyncRoot;
+ }
+ }
+
+ public override void CopyTo(K[] destinationArray, int index)
+ {
+ lock (this._Queue)
+ {
+ this._Queue.CopyTo(destinationArray, index);
+ }
+ }
+
+ public override object Clone()
+ {
+ lock (this._Queue)
+ {
+ return this._Queue.Clone();
+ }
+ }
+ }
+
/// <summary>
/// Private Queue Enumerator class.
/// </summary>
- /// <typeparam name="J"></typeparam>
+ /// <typeparam name="J">Type of object.</typeparam>
[Serializable]
private class QueueEnumerator<J> : IEnumerator<J>, ICloneable
{
Deleted: src/trunk/G3L.Core/Collections/QueueEnumerator.cs
===================================================================
--- src/trunk/G3L.Core/Collections/QueueEnumerator.cs 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Core/Collections/QueueEnumerator.cs 2007-02-04 02:54:08 UTC (rev 46)
@@ -1,8 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace G3L.Core.Collections
-{
-
-}
Modified: src/trunk/G3L.Core/G3L.Core.csproj
===================================================================
--- src/trunk/G3L.Core/G3L.Core.csproj 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Core/G3L.Core.csproj 2007-02-04 02:54:08 UTC (rev 46)
@@ -34,7 +34,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Collections\Queue.cs" />
- <Compile Include="Collections\QueueEnumerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Modified: src/trunk/G3L.Core/bin/Debug/G3L.Core.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Core/bin/Debug/G3L.Core.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Core/obj/Debug/G3L.Core.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Core/obj/Debug/G3L.Core.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Data/bin/Debug/G3L.Data.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Data/bin/Debug/G3L.Data.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Data/obj/Debug/G3L.Data.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Data/obj/Debug/G3L.Data.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Debug/G3L.Debug.csproj
===================================================================
--- src/trunk/G3L.Debug/G3L.Debug.csproj 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Debug/G3L.Debug.csproj 2007-02-04 02:54:08 UTC (rev 46)
@@ -39,6 +39,12 @@
<Compile Include="Log\LogMessage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\G3L.Core\G3L.Core.csproj">
+ <Project>{574923D3-CFE4-48A0-9417-5BD8B80B307D}</Project>
+ <Name>G3L.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Modified: src/trunk/G3L.Debug/Log/Logger.cs
===================================================================
--- src/trunk/G3L.Debug/Log/Logger.cs 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Debug/Log/Logger.cs 2007-02-04 02:54:08 UTC (rev 46)
@@ -4,9 +4,13 @@
namespace G3L.Debug.Log
{
+ /// <summary>
+ /// Logger class, responsible for logging.
+ /// </summary>
public class Logger : IDisposable
{
private List<Log> _Loggers;
+ protected LoggerEventHandler _LoggerEventHandler;
public Logger()
{
Modified: src/trunk/G3L.Debug/Log/LoggerEventHandler.cs
===================================================================
--- src/trunk/G3L.Debug/Log/LoggerEventHandler.cs 2007-02-04 02:15:21 UTC (rev 45)
+++ src/trunk/G3L.Debug/Log/LoggerEventHandler.cs 2007-02-04 02:54:08 UTC (rev 46)
@@ -3,6 +3,8 @@
using System.Text;
using System.Threading;
+using G3L.Core;
+
namespace G3L.Debug.Log
{
/// <summary>
@@ -13,11 +15,12 @@
public abstract class LoggerEventHandler
{
private bool _Alive = false;
+ private Queue<EventMessage> _Queue;
private Thread _Dispatcher;
public LoggerEventHandler()
{
-
+ this._Queue;
}
public void Start()
Deleted: src/trunk/G3L.Debug/bin/Debug/G3L.Debug.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.Debug/bin/Debug/G3L.Debug.pdb
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.Debug/obj/Debug/G3L.Debug.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.Debug/obj/Debug/G3L.Debug.pdb
===================================================================
(Binary files differ)
Added: src/trunk/G3L.Debug/obj/Debug/ResolveAssemblyReference.cache
===================================================================
(Binary files differ)
Property changes on: src/trunk/G3L.Debug/obj/Debug/ResolveAssemblyReference.cache
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: src/trunk/G3L.Framework/bin/Debug/G3L.Framework.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Framework/bin/Debug/G3L.Framework.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Framework/obj/Debug/G3L.Framework.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Framework/obj/Debug/G3L.Framework.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Net/bin/Debug/G3L.Net.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Net/bin/Debug/G3L.Net.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Net/obj/Debug/G3L.Net.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Net/obj/Debug/G3L.Net.pdb
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/bin/Debug/G3L.Debug.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/bin/Debug/G3L.Debug.pdb
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/bin/Debug/G3L.UnitTests.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/bin/Debug/G3L.UnitTests.pdb
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/bin/Debug/csUnit.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/obj/Debug/G3L.UnitTests.dll
===================================================================
(Binary files differ)
Deleted: src/trunk/G3L.UnitTests/obj/Debug/G3L.UnitTests.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.UnitTests/obj/Debug/ResolveAssemblyReference.cache
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Util/bin/Debug/G3L.Util.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Util/bin/Debug/G3L.Util.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Util/obj/Debug/G3L.Util.dll
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.Util/obj/Debug/G3L.Util.pdb
===================================================================
(Binary files differ)
Modified: src/trunk/G3L.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|