C# Class IronPython.Runtime.CommonDictionaryStorage

Inheritance: IronPython.Runtime.DictionaryStorage, ISerializable, IDeserializationCallback
ファイルを表示 Open project: jschementi/iron Class Usage Examples

Protected Properties

Property Type Description
_buckets Bucket[]

Public Methods

Method Description
Add ( IronPython.Runtime.DictionaryStorage &storage, object key, object value ) : void
Add ( object key, object value ) : void

Adds a new item to the dictionary, replacing an existing one if it already exists.

AddNoLock ( IronPython.Runtime.DictionaryStorage &storage, object key, object value ) : void
AddNoLock ( object key, object value ) : void
Clear ( ) : void
Clear ( IronPython.Runtime.DictionaryStorage &storage ) : void

Clears the contents of the dictionary.

Clone ( ) : IronPython.Runtime.DictionaryStorage

Clones the storage returning a new DictionaryStorage object.

CommonDictionaryStorage ( ) : System

Creates a new dictionary storage with no buckets

CommonDictionaryStorage ( int count ) : System

Creates a new dictionary storage with no buckets

CommonDictionaryStorage ( object items, bool isHomogeneous ) : System

Creates a new dictionary geting values/keys from the items arary

Contains ( object key ) : bool

Checks to see if the key exists in the dictionary.

CopyTo ( IronPython.Runtime.DictionaryStorage into ) : IronPython.Runtime.DictionaryStorage
CopyTo ( IronPython.Runtime.DictionaryStorage &into ) : void
EnsureCapacityNoLock ( int size ) : void
GetEnumerator ( ) : object>>.IEnumerator
GetItems ( ) : object>>.List
GetKeys ( ) : IEnumerable
GetObjectData ( SerializationInfo info, StreamingContext context ) : void
HasNonStringAttributes ( ) : bool
Remove ( IronPython.Runtime.DictionaryStorage &storage, object key ) : bool

Removes an entry from the dictionary and returns true if the entry was removed or false.

Remove ( object key ) : bool
TryGetValue ( object key, object &value ) : bool

Trys to get the value associated with the given key and returns true if it's found or false if it's not present.

TryRemoveValue ( IronPython.Runtime.DictionaryStorage &storage, object key, object &value ) : bool
TryRemoveValue ( object key, object &value ) : bool

Protected Methods

Method Description
AddWorker ( Bucket buckets, object key, object value, int hc ) : bool

Add helper which adds the given key/value (where the key is not null) with a pre-computed hash code.

IDeserializationCallback ( object sender ) : void
TryGetValue ( Bucket buckets, object key, int hc, Func eqFunc, object &value ) : bool
TryRemoveNoLock ( object key, Func eqFunc, int hc, object &value ) : bool

Private Methods

Method Description
Add ( Bucket buckets, object key, object value ) : bool

Add helper that works over a single set of buckets. Used for both the normal add case as well as the resize case.

AddItems ( object items ) : void
AddNull ( object value ) : void
AddOne ( object key, object value ) : void
AssignSiteDelegates ( CallSite hashSite, CallSite equalSite ) : void
CommonCopyTo ( CommonDictionaryStorage into ) : void
CommonDictionaryStorage ( Bucket buckets, int count, Type keyType, int>.Func hashFunc, Func eqFunc, NullValue nullValue ) : System

Creates a new dictionary storage with the given set of buckets and size. Used when cloning the dictionary storage.

CommonDictionaryStorage ( SerializationInfo info, StreamingContext context ) : System
DoubleEquals ( object o1, object o2 ) : bool
DoubleHash ( object o ) : int
EnsureSize ( int newSize ) : void
GenericEquals ( object o1, object o2 ) : bool
GenericHash ( object o ) : int
GetDeserializationBucket ( ) : DeserializationNullValue
Hash ( object key ) : int

Helper to hash the given key w/ support for null.

Initialize ( ) : void

Initializes the buckets to their initial capacity, the caller must check if the buckets are empty first.

IntEquals ( object o1, object o2 ) : bool
IntHash ( object o ) : int
PrimitiveHash ( object o ) : int
ProbeNext ( Bucket buckets, int index ) : int
RemoveAlwaysHash ( object key ) : bool

Removes an entry from the dictionary and returns true if the entry was removed or false. The key will always be hashed so if it is unhashable an exception will be thrown - even if the dictionary has no buckets.

SetHeterogeneousSites ( ) : void
StringEquals ( object o1, object o2 ) : bool
TryGetValue ( Bucket buckets, object key, object &value ) : bool

Static helper to try and get the value from the dictionary. Used so the value lookup can run against a buckets while a writer replaces the buckets.

TryRemoveNoLock ( object key, object &value ) : bool
TryRemoveNull ( object &value ) : bool
TupleEquals ( object o1, object o2 ) : bool
TupleHash ( object o ) : int
UncommonCopyTo ( IronPython.Runtime.DictionaryStorage &into ) : void
UpdateHelperFunctions ( Type t, object key ) : void

Method Details

Add() public method

public Add ( IronPython.Runtime.DictionaryStorage &storage, object key, object value ) : void
storage IronPython.Runtime.DictionaryStorage
key object
value object
return void

Add() public method

Adds a new item to the dictionary, replacing an existing one if it already exists.
public Add ( object key, object value ) : void
key object
value object
return void

AddNoLock() public method

public AddNoLock ( IronPython.Runtime.DictionaryStorage &storage, object key, object value ) : void
storage IronPython.Runtime.DictionaryStorage
key object
value object
return void

AddNoLock() public method

public AddNoLock ( object key, object value ) : void
key object
value object
return void

AddWorker() protected method

Add helper which adds the given key/value (where the key is not null) with a pre-computed hash code.
protected AddWorker ( Bucket buckets, object key, object value, int hc ) : bool
buckets Bucket
key object
value object
hc int
return bool

Clear() public method

public Clear ( ) : void
return void

Clear() public method

Clears the contents of the dictionary.
public Clear ( IronPython.Runtime.DictionaryStorage &storage ) : void
storage IronPython.Runtime.DictionaryStorage
return void

Clone() public method

Clones the storage returning a new DictionaryStorage object.
public Clone ( ) : IronPython.Runtime.DictionaryStorage
return IronPython.Runtime.DictionaryStorage

CommonDictionaryStorage() public method

Creates a new dictionary storage with no buckets
public CommonDictionaryStorage ( ) : System
return System

CommonDictionaryStorage() public method

Creates a new dictionary storage with no buckets
public CommonDictionaryStorage ( int count ) : System
count int
return System

CommonDictionaryStorage() public method

Creates a new dictionary geting values/keys from the items arary
public CommonDictionaryStorage ( object items, bool isHomogeneous ) : System
items object
isHomogeneous bool
return System

Contains() public method

Checks to see if the key exists in the dictionary.
public Contains ( object key ) : bool
key object
return bool

CopyTo() public method

public CopyTo ( IronPython.Runtime.DictionaryStorage into ) : IronPython.Runtime.DictionaryStorage
into IronPython.Runtime.DictionaryStorage
return IronPython.Runtime.DictionaryStorage

CopyTo() public method

public CopyTo ( IronPython.Runtime.DictionaryStorage &into ) : void
into IronPython.Runtime.DictionaryStorage
return void

EnsureCapacityNoLock() public method

public EnsureCapacityNoLock ( int size ) : void
size int
return void

GetEnumerator() public method

public GetEnumerator ( ) : object>>.IEnumerator
return object>>.IEnumerator

GetItems() public method

public GetItems ( ) : object>>.List
return object>>.List

GetKeys() public method

public GetKeys ( ) : IEnumerable
return IEnumerable

GetObjectData() public method

public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo
context System.Runtime.Serialization.StreamingContext
return void

HasNonStringAttributes() public method

public HasNonStringAttributes ( ) : bool
return bool

IDeserializationCallback() protected method

protected IDeserializationCallback ( object sender ) : void
sender object
return void

Remove() public method

Removes an entry from the dictionary and returns true if the entry was removed or false.
public Remove ( IronPython.Runtime.DictionaryStorage &storage, object key ) : bool
storage IronPython.Runtime.DictionaryStorage
key object
return bool

Remove() public method

public Remove ( object key ) : bool
key object
return bool

TryGetValue() protected static method

protected static TryGetValue ( Bucket buckets, object key, int hc, Func eqFunc, object &value ) : bool
buckets Bucket
key object
hc int
eqFunc Func
value object
return bool

TryGetValue() public method

Trys to get the value associated with the given key and returns true if it's found or false if it's not present.
public TryGetValue ( object key, object &value ) : bool
key object
value object
return bool

TryRemoveNoLock() protected method

protected TryRemoveNoLock ( object key, Func eqFunc, int hc, object &value ) : bool
key object
eqFunc Func
hc int
value object
return bool

TryRemoveValue() public method

public TryRemoveValue ( IronPython.Runtime.DictionaryStorage &storage, object key, object &value ) : bool
storage IronPython.Runtime.DictionaryStorage
key object
value object
return bool

TryRemoveValue() public method

public TryRemoveValue ( object key, object &value ) : bool
key object
value object
return bool

Property Details

_buckets protected_oe property

protected Bucket[] _buckets
return Bucket[]