/// <summary> /// Constructor. /// </summary> /// <param name="pIStream"> /// Pointer to IF_IStream object that was allocated from unmanaged space. /// </param> /// <param name="dbSystem"> /// Pointer to <see cref="DbSystem"/> object. /// </param> internal IStream( IntPtr pIStream, DbSystem dbSystem) { if (pIStream == IntPtr.Zero) { throw new XFlaimException("Invalid IF_IStream object pointer"); } m_pIStream = pIStream; if (dbSystem == null) { throw new XFlaimException("Invalid DbSystem object"); } m_dbSystem = dbSystem; // Must call something inside of DbSystem. Otherwise, the // m_dbSystem object gets a compiler warning on linux because // it is not used anywhere. Other than that, there is really // no need to make the following call. if (m_dbSystem.getDbSystem() == IntPtr.Zero) { throw new XFlaimException("Invalid DbSystem.IF_DbSystem object"); } }
/// <summary> /// Constructor. /// </summary> /// <param name="pStats"> /// Pointer to an XFLM_STATS object in unmanaged space. /// </param> /// <param name="dbSystem"> /// DbSystem object that this DbSystemStats object is associated with. /// </param> internal DbSystemStats( IntPtr pStats, DbSystem dbSystem) { if (pStats == IntPtr.Zero) { throw new XFlaimException("Invalid pointer to XFLM_STATS structure"); } m_pStats = pStats; if (dbSystem == null) { throw new XFlaimException("Invalid DbSystem reference"); } m_dbSystem = dbSystem; // Must call something inside of DbSystem. Otherwise, the // m_dbSystem object gets a compiler warning on linux because // it is not used anywhere. Other than that, there is really // no need to make the following call. if (m_dbSystem.getDbSystem() == IntPtr.Zero) { throw new XFlaimException("Invalid DbSystem.IF_DbSystem object"); } }
/// <summary> /// Free the statistics assocated with this object. /// </summary> public void freeStats() { // Free the unmanaged XFLM_STATS structure. if (m_pStats != IntPtr.Zero) { xflaim_DbSystemStats_freeStats(m_dbSystem.getDbSystem(), m_pStats); m_pStats = IntPtr.Zero; } // Remove our reference to the dbSystem so it can be released. m_dbSystem = null; }