/// <summary> /// Creates a new <see cref="BroRecord"/>. /// </summary> /// <exception cref="OutOfMemoryException">Failed to create Bro record.</exception> public BroRecord() { m_recordPtr = BroApi.bro_record_new(); if (m_recordPtr.IsInvalid()) { throw new OutOfMemoryException("Failed to create Bro record."); } }
/// <summary> /// Removes all fields from this <see cref="BroRecord"/>. /// </summary> /// <exception cref="ObjectDisposedException">Cannot clear, <see cref="BroRecord"/> is disposed.</exception> public void Clear() { if (m_recordPtr.IsInvalid()) { throw new ObjectDisposedException("Cannot clear items, Bro record is disposed."); } #if USE_SAFE_HANDLES m_recordPtr.Dispose(); #else BroApi.bro_record_free(m_recordPtr); #endif m_recordPtr = BroApi.bro_record_new(); }