mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 18:29:53 +00:00
csharp: add license, rename filename/namespace.
This commit is contained in:
parent
33498d3673
commit
6cfea98501
28 changed files with 427 additions and 205 deletions
|
|
@ -1,44 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace msgpack
|
||||
{
|
||||
public static class ReflectionCache
|
||||
{
|
||||
static Dictionary<Type, ReflectionCacheEntry> _cache;
|
||||
|
||||
static ReflectionCache ()
|
||||
{
|
||||
_cache = new Dictionary<Type,ReflectionCacheEntry> ();
|
||||
}
|
||||
|
||||
public static ReflectionCacheEntry Lookup (Type type)
|
||||
{
|
||||
ReflectionCacheEntry entry;
|
||||
lock (_cache) {
|
||||
if (_cache.TryGetValue (type, out entry))
|
||||
return entry;
|
||||
}
|
||||
|
||||
entry = new ReflectionCacheEntry (type);
|
||||
lock (_cache) {
|
||||
_cache[type] = entry;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
public static void RemoveCache (Type type)
|
||||
{
|
||||
lock (_cache) {
|
||||
_cache.Remove (type);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Clear ()
|
||||
{
|
||||
lock (_cache) {
|
||||
_cache.Clear ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue