Table of Contents

Class PooledObjectInfo

Namespace
CodeProject.ObjectPool.Core
Assembly
CodeProject.ObjectPool.dll

Core information about a specific PooledObject.

[Serializable]
public sealed class PooledObjectInfo : IEquatable<PooledObjectInfo>
Inheritance
PooledObjectInfo
Implements
Inherited Members

Properties

Id

An identifier which is unique inside the pool to which this object belongs. Moreover, this identifier increases monotonically as new objects are created.

public int Id { get; }

Property Value

int

Payload

Payload which can be used to add custom information to a pooled object.

public object? Payload { get; set; }

Property Value

object

State

Enumeration that is being managed by the pool to describe the object state - primary used to void cases where the resources are being releases twice.

public PooledObjectState State { get; }

Property Value

PooledObjectState

Methods

Equals(PooledObjectInfo?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PooledObjectInfo? other)

Parameters

other PooledObjectInfo

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current PooledObjectInfo.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current PooledObjectInfo.

Returns

bool

true if the specified object is equal to the current PooledObjectInfo; otherwise, false.

GetHashCode()

Serves as a hash function for a particular type.

public override int GetHashCode()

Returns

int

A hash code for the current PooledObjectInfo.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(PooledObjectInfo?, PooledObjectInfo?)

Compares to pooled objects info by Id.

public static bool operator ==(PooledObjectInfo? left, PooledObjectInfo? right)

Parameters

left PooledObjectInfo

Left object.

right PooledObjectInfo

Right object.

Returns

bool

True if given pooled objects info are equal, false otherwise.

operator !=(PooledObjectInfo?, PooledObjectInfo?)

Compares to pooled objects info by Id.

public static bool operator !=(PooledObjectInfo? left, PooledObjectInfo? right)

Parameters

left PooledObjectInfo

Left object.

right PooledObjectInfo

Right object.

Returns

bool

True if given pooled objects info are not equal, false otherwise.