//**************************************************************************************************
//
// TEMPLATE CLASS FOR AUTO-DESTROYING OF OBJECT(S) VIA DESTRUCTOR(S) — CONST-POINTER VERSION:
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$apc" TEMPLATE CLASS:
//
//==================================================================================================
template<typename T>class $apc: public $Disposable
{
public:
   $apc<T>();
   $apc<T>($A, const T* pointer );
   $apc<T>($A, const T* pointer, bool isArray );
public:
   $apc<T>& operator = ($apc<T>& predecessor) $owner_transfer;
public:
   __declspec(property(get = GetHasPointer)) bool HasPointer;
public:
   const T* P($O) const $alias("Pointer") $strict_result;
public:
   bool IsArray($O) const;
   bool GetHasPointer() const;
   void VerifyHasPointer($O) const;
public:
   const T* Attach($OA, const T* pointer ) $imaginary_param("deletePrevious",true);
   const T* Attach($OA, const T* pointer, bool isArray ) $imaginary_param("deletePrevious",true);
   const T* Attach($OA, bool deletePrevious, const T* pointer );
   const T* Attach($OA, bool deletePrevious, const T* pointer, bool isArray );
   const T* Detach() $or_null $ret_previous $needs_free;
   T* TakePointerOwnership($O) $not_null $ret_previous $needs_free;
   void Delete();
protected:
   virtual void DoDispose($CI_REF) override;
   void ResetSuperstructure();
private:
#include "..\..\private\template\apc.private.h"
}; // $apc<T>
//==================================================================================================

} // RuntimeForStatic
