Changeset 45
- Timestamp:
- 07/02/04 15:10:33 (4 years ago)
- Files:
-
- trunk/AprSharp/dev/src/AprAllocator.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprArray.cs (modified) (3 diffs)
- trunk/AprSharp/dev/src/AprFile.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprHash.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprHashIndex.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprMemNode.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprPool.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprString.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprThreadMutex.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/AprTimeExp.cs (modified) (1 diff)
- trunk/AprSharp/dev/src/IAprUnmanaged.cs (modified) (1 diff)
- trunk/AprSharp/test/src/AprArrayTest.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/AprSharp/dev/src/AprAllocator.cs
r43 r45 50 50 } 51 51 52 public bool ReferenceEquals(IAprUnmanaged obj) 53 { 54 return(obj.ToIntPtr() == ToIntPtr()); 55 } 56 52 57 public static implicit operator IntPtr(AprAllocator allocator) 53 58 { trunk/AprSharp/dev/src/AprArray.cs
r43 r45 86 86 } 87 87 88 public bool ReferenceEquals(IAprUnmanaged obj) 89 { 90 return(obj.ToIntPtr() == ToIntPtr()); 91 } 92 88 93 public static implicit operator IntPtr(AprArray array) 89 94 { … … 149 154 { 150 155 if(list is AprArray) 151 //return(((AprArray)list).Copy(pool)); 152 return (AprArray)list; 156 return(((AprArray)list).Copy(pool)); 153 157 else 154 158 { … … 165 169 } 166 170 } 167 171 172 public static AprArray CastMake(AprPool pool, ICollection list ) 173 { 174 if(list is AprArray) 175 { 176 if( ((AprArray)list).Pool.ReferenceEquals(pool) ) 177 return ((AprArray)list); 178 } 179 return( Make(pool, list) ); 180 } 181 168 182 public AprArray Copy(AprPool pool) 169 183 { trunk/AprSharp/dev/src/AprFile.cs
r43 r45 92 92 } 93 93 94 public bool ReferenceEquals(IAprUnmanaged obj) 95 { 96 return(obj.ToIntPtr() == ToIntPtr()); 97 } 98 94 99 public static implicit operator IntPtr(AprFile file) 95 100 { trunk/AprSharp/dev/src/AprHash.cs
r43 r45 50 50 } 51 51 52 public bool ReferenceEquals(IAprUnmanaged obj) 53 { 54 return(obj.ToIntPtr() == ToIntPtr()); 55 } 56 52 57 public static implicit operator IntPtr(AprHash hashIndex) 53 58 { trunk/AprSharp/dev/src/AprHashIndex.cs
r43 r45 50 50 } 51 51 52 public bool ReferenceEquals(IAprUnmanaged obj) 53 { 54 return(obj.ToIntPtr() == ToIntPtr()); 55 } 56 52 57 public static implicit operator IntPtr(AprHashIndex hashIndex) 53 58 { trunk/AprSharp/dev/src/AprMemNode.cs
r43 r45 65 65 } 66 66 67 public bool ReferenceEquals(IAprUnmanaged obj) 68 { 69 return(obj.ToIntPtr() == ToIntPtr()); 70 } 71 67 72 public static implicit operator IntPtr(AprMemNode memNode) 68 73 { trunk/AprSharp/dev/src/AprPool.cs
r43 r45 49 49 } 50 50 51 public bool ReferenceEquals(IAprUnmanaged obj) 52 { 53 return(obj.ToIntPtr() == ToIntPtr()); 54 } 55 51 56 public static implicit operator IntPtr(AprPool pool) 52 57 { trunk/AprSharp/dev/src/AprString.cs
r43 r45 81 81 } 82 82 83 public bool ReferenceEquals(IAprUnmanaged obj) 84 { 85 return(obj.ToIntPtr() == ToIntPtr()); 86 } 87 83 88 public static implicit operator IntPtr(AprString str) 84 89 { trunk/AprSharp/dev/src/AprThreadMutex.cs
r43 r45 56 56 } 57 57 58 public bool ReferenceEquals(IAprUnmanaged obj) 59 { 60 return(obj.ToIntPtr() == ToIntPtr()); 61 } 62 58 63 public static implicit operator IntPtr(AprThreadMutex threadMutex) 59 64 { trunk/AprSharp/dev/src/AprTimeExp.cs
r43 r45 77 77 } 78 78 79 public bool ReferenceEquals(IAprUnmanaged obj) 80 { 81 return(obj.ToIntPtr() == ToIntPtr()); 82 } 83 79 84 public static implicit operator IntPtr(AprTimeExp timeExp) 80 85 { trunk/AprSharp/dev/src/IAprUnmanaged.cs
r43 r45 24 24 25 25 void ClearPtr(); 26 27 bool ReferenceEquals(IAprUnmanaged obj); 26 28 } 27 29 } trunk/AprSharp/test/src/AprArrayTest.cs
r43 r45 262 262 a.CopyTo(arr,0); 263 263 264 AprArray b = AprArray.CastMake(p,a); 265 Assert.AreEqual(a.ToIntPtr(),b.ToIntPtr(),"#F19"); 266 267 AprPool sp = AprPool.Create(p); 268 Assert.IsFalse(sp.IsNull,"#F01"); 269 b = AprArray.CastMake(sp,a); 270 Assert.IsFalse(a.ToIntPtr() == b.ToIntPtr(),"#F20"); 271 264 272 Assert.AreEqual("5",a.PopObject().ToString(),"#F03"); 265 273 Assert.AreEqual("4",a.PopObject().ToString(),"#F04"); … … 267 275 Assert.AreEqual("2",a.PopObject().ToString(),"#F06"); 268 276 Assert.AreEqual("1",a.PopObject().ToString(),"#F07"); 277 278 Assert.AreEqual("5",b.PopObject().ToString(),"#F21"); 279 Assert.AreEqual("4",b.PopObject().ToString(),"#F22"); 280 Assert.AreEqual("3",b.PopObject().ToString(),"#F23"); 281 Assert.AreEqual("2",b.PopObject().ToString(),"#F24"); 282 Assert.AreEqual("1",b.PopObject().ToString(),"#F25"); 269 283 270 284 Assert.AreEqual("1",arr[0].ToString(),"#F08");