Show / Hide Table of Contents

Class DisposableObject

Represents a class which manages its own memory.

Inheritance
System.Object
DisposableObject
CvTrackbar
DisposableCvObject
ArrayAddress1<T>
ArrayAddress2<T>
Window
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public abstract class DisposableObject : IDisposable

Constructors

| Improve this Doc View Source

DisposableObject()

Default constructor

Declaration
protected DisposableObject()
| Improve this Doc View Source

DisposableObject(Boolean)

Constructor

Declaration
protected DisposableObject(bool isEnabledDispose)
Parameters
Type Name Description
System.Boolean isEnabledDispose

true if you permit disposing this class by GC

Properties

| Improve this Doc View Source

AllocatedMemory

Gets or sets a memory address allocated by AllocMemory.

Declaration
protected IntPtr AllocatedMemory { get; set; }
Property Value
Type Description
IntPtr
| Improve this Doc View Source

AllocatedMemorySize

Gets or sets the byte length of the allocated memory

Declaration
protected long AllocatedMemorySize { get; set; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

DataHandle

Gets or sets a handle which allocates using cvSetData.

Declaration
protected GCHandle DataHandle { get; }
Property Value
Type Description
System.Runtime.InteropServices.GCHandle
| Improve this Doc View Source

IsDisposed

Gets a value indicating whether this instance has been disposed.

Declaration
public bool IsDisposed { get; protected set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsEnabledDispose

Gets or sets a value indicating whether you permit disposing this instance.

Declaration
public bool IsEnabledDispose { get; set; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

AllocGCHandle(Object)

Pins the object to be allocated by cvSetData.

Declaration
protected GCHandle AllocGCHandle(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Runtime.InteropServices.GCHandle
| Improve this Doc View Source

AllocMemory(Int32)

Allocates the specified size of memory.

Declaration
protected IntPtr AllocMemory(int size)
Parameters
Type Name Description
System.Int32 size
Returns
Type Description
IntPtr
| Improve this Doc View Source

Dispose()

Releases the resources

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Releases the resources

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

| Improve this Doc View Source

DisposeManaged()

Releases managed resources

Declaration
protected virtual void DisposeManaged()
| Improve this Doc View Source

DisposeUnmanaged()

Releases unmanaged resources

Declaration
protected virtual void DisposeUnmanaged()
| Improve this Doc View Source

Finalize()

Destructor

Declaration
protected void Finalize()
| Improve this Doc View Source

NotifyMemoryPressure(Int64)

Notifies the allocated size of memory.

Declaration
protected void NotifyMemoryPressure(long size)
Parameters
Type Name Description
System.Int64 size
| Improve this Doc View Source

ThrowIfDisposed()

If this object is disposed, then ObjectDisposedException is thrown.

Declaration
public void ThrowIfDisposed()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX