C# Class IronPython.Runtime.CommonDictionaryStorage

Inheritance: IronPython.Runtime.DictionaryStorage, ISerializable, IDeserializationCallback
Afficher le fichier Open project: jschementi/iron Class Usage Examples

Protected Properties

Свойство Type Description
_buckets Bucket[]

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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

Add() public méthode

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
Résultat void

AddNoLock() public méthode

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

AddNoLock() public méthode

public AddNoLock ( object key, object value ) : void
key object
value object
Résultat void

AddWorker() protected méthode

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
Résultat bool

Clear() public méthode

public Clear ( ) : void
Résultat void

Clear() public méthode

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

Clone() public méthode

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

CommonDictionaryStorage() public méthode

Creates a new dictionary storage with no buckets
public CommonDictionaryStorage ( ) : System
Résultat System

CommonDictionaryStorage() public méthode

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

CommonDictionaryStorage() public méthode

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

Contains() public méthode

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

CopyTo() public méthode

public CopyTo ( IronPython.Runtime.DictionaryStorage into ) : IronPython.Runtime.DictionaryStorage
into IronPython.Runtime.DictionaryStorage
Résultat IronPython.Runtime.DictionaryStorage

CopyTo() public méthode

public CopyTo ( IronPython.Runtime.DictionaryStorage &into ) : void
into IronPython.Runtime.DictionaryStorage
Résultat void

EnsureCapacityNoLock() public méthode

public EnsureCapacityNoLock ( int size ) : void
size int
Résultat void

GetEnumerator() public méthode

public GetEnumerator ( ) : object>>.IEnumerator
Résultat object>>.IEnumerator

GetItems() public méthode

public GetItems ( ) : object>>.List
Résultat object>>.List

GetKeys() public méthode

public GetKeys ( ) : IEnumerable
Résultat IEnumerable

GetObjectData() public méthode

public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo
context System.Runtime.Serialization.StreamingContext
Résultat void

HasNonStringAttributes() public méthode

public HasNonStringAttributes ( ) : bool
Résultat bool

IDeserializationCallback() protected méthode

protected IDeserializationCallback ( object sender ) : void
sender object
Résultat void

Remove() public méthode

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
Résultat bool

Remove() public méthode

public Remove ( object key ) : bool
key object
Résultat bool

TryGetValue() protected static méthode

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

TryGetValue() public méthode

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
Résultat bool

TryRemoveNoLock() protected méthode

protected TryRemoveNoLock ( object key, Func eqFunc, int hc, object &value ) : bool
key object
eqFunc Func
hc int
value object
Résultat bool

TryRemoveValue() public méthode

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

TryRemoveValue() public méthode

public TryRemoveValue ( object key, object &value ) : bool
key object
value object
Résultat bool

Property Details

_buckets protected_oe property

protected Bucket[] _buckets
Résultat Bucket[]