| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // RefCounted.cs
- //
- // Copyright 2015 Xamarin Inc. All rights reserved.
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using Urho.Urho2D;
- using Urho.Gui;
- using Urho.Resources;
- using Urho.IO;
- using Urho.Navigation;
- using Urho.Network;
- namespace Urho
- {
- /// <summary>
- /// Base class for intrusively reference-counted objects. These are noncopyable and non-assignable.
- /// </summary>
- public unsafe partial class RefCounted
- {
- unsafe partial void OnRefCountedCreated ();
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr RefCounted_RefCounted ();
- [Preserve]
- public RefCounted ()
- {
- handle = RefCounted_RefCounted ();
- OnRefCountedCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void RefCounted_AddRef (IntPtr handle);
- /// <summary>
- /// Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
- /// </summary>
- public void AddRef ()
- {
- RefCounted_AddRef (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void RefCounted_ReleaseRef (IntPtr handle);
- /// <summary>
- /// Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
- /// </summary>
- public void ReleaseRef ()
- {
- RefCounted_ReleaseRef (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int RefCounted_Refs (IntPtr handle);
- /// <summary>
- /// Return reference count.
- /// </summary>
- public int Refs ()
- {
- return RefCounted_Refs (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int RefCounted_WeakRefs (IntPtr handle);
- /// <summary>
- /// Return weak reference count.
- /// </summary>
- public int WeakRefs ()
- {
- return RefCounted_WeakRefs (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern RefCount* RefCounted_RefCountPtr (IntPtr handle);
- /// <summary>
- /// Return pointer to the reference count structure.
- /// </summary>
- public RefCount* RefCountPtr ()
- {
- return RefCounted_RefCountPtr (handle);
- }
- }
- }
|