mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
4.4 KiB
HTML
2 lines
No EOL
4.4 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Array (containers.CCRingBuffer.Make.Array)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">containers</a> » <a href="../../index.html">CCRingBuffer</a> » <a href="../index.html">Make</a> » Array</nav><h1>Module <code>Make.Array</code></h1><p>The module type of Array for this ring buffer</p></header><dl><dt class="spec type" id="type-elt"><a href="#type-elt" class="anchor"></a><code><span class="keyword">type</span> elt</code><code> = <a href="../argument-1-X/index.html#type-t">X.t</a></code></dt><dd><p>The element type</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../argument-1-X/index.html#type-t">X.t</a> array</code></dt><dd><p>The type of an array instance</p></dd></dl><dl><dt class="spec value" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span class="keyword">val</span> dummy : <a href="index.html#type-elt">elt</a></code></dt><dd><p>A dummy element used for empty slots in the array</p><dl><dt>since</dt><dd>2.4</dd></dl></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Make an array of the given size, filled with dummy elements.</p></dd></dl><dl><dt class="spec value" id="val-length"><a href="#val-length" class="anchor"></a><code><span class="keyword">val</span> length : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p><code>length t</code> gets the total number of elements currently in <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-get"><a href="#val-get" class="anchor"></a><code><span class="keyword">val</span> get : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-elt">elt</a></code></dt><dd><p><code>get t i</code> gets the element at position <code>i</code>.</p></dd></dl><dl><dt class="spec value" id="val-set"><a href="#val-set" class="anchor"></a><code><span class="keyword">val</span> set : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-elt">elt</a> <span>-></span> unit</code></dt><dd><p><code>set t i e</code> sets the element at position <code>i</code> to <code>e</code>.</p></dd></dl><dl><dt class="spec value" id="val-sub"><a href="#val-sub" class="anchor"></a><code><span class="keyword">val</span> sub : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>sub t i len</code> gets the sub-array of <code>t</code> from position <code>i</code> to <code>i + len</code>.</p></dd></dl><dl><dt class="spec value" id="val-copy"><a href="#val-copy" class="anchor"></a><code><span class="keyword">val</span> copy : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>copy t</code> makes a fresh copy of the array <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-blit"><a href="#val-blit" class="anchor"></a><code><span class="keyword">val</span> blit : <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> int <span>-></span> int <span>-></span> unit</code></dt><dd><p><code>blit t s arr i len</code> copies <code>len</code> elements from <code>arr</code> starting at <code>i</code> to position <code>s</code> from <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-iter"><a href="#val-iter" class="anchor"></a><code><span class="keyword">val</span> iter : (<a href="index.html#type-elt">elt</a> <span>-></span> unit) <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p><code>iter f t</code> iterates over the array <code>t</code> invoking <code>f</code> with the current element, in array order.</p></dd></dl></div></body></html> |