ocaml-containers/3.12/containers-data/CCBitField/index.html
2023-06-01 16:44:06 -04:00

12 lines
No EOL
2.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CCBitField (containers-data.CCBitField)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">containers-data</a> &#x00BB; CCBitField</nav><header class="odoc-preamble"><h1>Module <code><span>CCBitField</span></code></h1><p>Efficient Bit Field for up to 31 or 61 fiels</p><p>This module defines efficient bitfields up to 31 or 61 bits (depending on the architecture) in a relatively type-safe way.</p><pre class="language-ocaml"><code>module B = CCBitField.Make(struct end);;
let x = B.mk_field ()
let y = B.mk_field ()
let z = B.mk_field ()
let f = B.empty |&gt; B.set x true |&gt; B.set y true;;
assert (not (B.get z f)) ;;
assert (f |&gt; B.set z true |&gt; B.get z);;</code></pre></header><div class="odoc-content"><div class="odoc-spec"><div class="spec exception anchored" id="exception-TooManyFields"><a href="#exception-TooManyFields" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">TooManyFields</span></span></code></div><div class="spec-doc"><p>Raised when too many fields are packed into one bitfield.</p></div></div><div class="odoc-spec"><div class="spec exception anchored" id="exception-Frozen"><a href="#exception-Frozen" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Frozen</span></span></code></div><div class="spec-doc"><p>Raised when a frozen bitfield is modified.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_width"><a href="#val-max_width" class="anchor"></a><code><span><span class="keyword">val</span> max_width : int</span></code></div><div class="spec-doc"><p>System-dependent maximum width for a bitfield, typically 30 or 62.</p></div></div><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-S"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-S/index.html">S</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Make"><a href="#module-Make" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Make/index.html">Make</a></span><span> (<a href="Make/argument-1-_/index.html">_</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span>) : <a href="module-type-S/index.html">S</a></span></code></div><div class="spec-doc"><p>Create a new bitfield type</p></div></div></div></body></html>