ocaml-containers/dev/containers-data/CCBitField/index.html
2021-12-02 16:42:53 +00:00

12 lines
No EOL
3 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.0.2"/><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><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" id="exception-TooManyFields" class="anchored"><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" id="exception-Frozen" class="anchored"><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" id="val-max_width" class="anchored"><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" id="module-type-S" class="anchored"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> </span><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" id="module-Make" class="anchored"><a href="#module-Make" class="anchor"></a><code><span><span class="keyword">module</span> </span><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>