This is the bitfield Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:27:22 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
bitfield
Efficiently represent several finite sets or small integers as a single non-negative integer.
Marco Heisig <marco.heisig@fau.de>
MIT
packages.lisp
(file).
bitfield.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
bitfield/bitfield.lisp
packages.lisp
(file).
bitfield
(system).
bitfield
(type).
bitfield-boolean-slot
(class).
bitfield-integer-slot
(class).
bitfield-member-slot
(class).
bitfield-slot
(class).
bitfield-slot-end
(generic reader).
bitfield-slot-initform
(generic reader).
bitfield-slot-name
(generic reader).
bitfield-slot-pack
(generic function).
bitfield-slot-size
(generic reader).
bitfield-slot-start
(generic reader).
bitfield-slot-unpack
(generic function).
define-bitfield
(macro).
parse-atomic-bitfield-slot-specifier
(generic function).
parse-compound-bitfield-slot-specifier
(generic function).
*bitfield-position*
(special variable).
bitfield-integer-slot-offset
(reader method).
bitfield-member-slot-objects
(reader method).
parse-bitfield-slot
(function).
Packages are listed by definition order.
bitfield
common-lisp
.
bitfield
(type).
bitfield-boolean-slot
(class).
bitfield-integer-slot
(class).
bitfield-member-slot
(class).
bitfield-slot
(class).
bitfield-slot-end
(generic reader).
bitfield-slot-initform
(generic reader).
bitfield-slot-name
(generic reader).
bitfield-slot-pack
(generic function).
bitfield-slot-size
(generic reader).
bitfield-slot-start
(generic reader).
bitfield-slot-unpack
(generic function).
define-bitfield
(macro).
parse-atomic-bitfield-slot-specifier
(generic function).
parse-compound-bitfield-slot-specifier
(generic function).
*bitfield-position*
(special variable).
bitfield-integer-slot-offset
(generic reader).
bitfield-member-slot-objects
(generic reader).
parse-bitfield-slot
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines an encoding of enumerable properties like booleans,
integers or finite sets as a single non-negative integer.
For a supplied bitfield name NAME, and for some slot definitions of the
form (SLOT-NAME TYPE &KEY INITFORM &ALLOW-OTHER-KEYS), this macro defines
the following functions:
1. A constructor named MAKE-{NAME}, that takes one keyword argument per
SLOT-NAME, similar to the default constructor generated by DEFSTRUCT.
It returns a bitfield whose entries have the values indicated by the
keyword arguments, or the supplied initform.
2. A clone operation named CLONE-{NAME}, that takes an existing bitfield
and one keyword argument per SLOT-NAME. It returns a copy of the
existing bitfield, but where each supplied keyword argument supersedes
the value of the corresponding slot.
3. A reader function named {NAME}-{SLOT-NAME} for each slot.
In addition to these functions, NAME is defined as a suitable subtype of
UNSIGNED-BYTE.
This macro supports boolean, integer, and member slots. It is also
possible to add new kinds of slots by defining new subclasses of
BITFIELD-SLOT and the corresponding methods on BITFIELD-SLOT-PACK,
BITFIELD-SLOT-UNPACK and PARSE-ATOMIC-BITFIELD-SLOT-SPECIFIER or
PARSE-COMPOUND-BITFIELD-SLOT-SPECIFIER.
Example:
(define-bitfield examplebits
(a boolean)
(b (signed-byte 2))
(c (unsigned-byte 3) :initform 1)
(d (integer -100 100))
(e (member foo bar baz)))
(defun examplebits-values (examplebits)
(list
(examplebits-a examplebits)
(examplebits-b examplebits)
(examplebits-c examplebits)
(examplebits-d examplebits)
(examplebits-e examplebits)))
(defparameter *default* (make-examplebits))
(examplebits-values *default*)
;; => (nil 0 1 -100 foo)
(defparameter *explicit* (make-examplebits :a t :b -1 :c 7 :d 42 :e ’baz))
(examplebits-values *explicit*)
;; => (t -1 7 42 baz)
(defparameter *clone* (clone-examplebits *explicit* :a nil :b -1 :c 2 :d -12 :e ’bar))
(examplebits-values *clone*)
;; => (nil -1 2 -12 bar)
Returns the position right after the last bit of this slot in the bitfield.
bitfield-slot
)) ¶automatically generated reader method
%end
.
Returns a form that produces the initial value for that slot.
bitfield-slot
)) ¶automatically generated reader method
Returns a symbol that is the name of the bitfield slot.
bitfield-slot
)) ¶automatically generated reader method
Takes a form that produces a value and turns it into a form that produces a non-negative integer representing that value.
bitfield-member-slot
) value-form) ¶bitfield-integer-slot
) value-form) ¶bitfield-boolean-slot
) value-form) ¶Returns an unsigned byte that is the number of distinct states of the slot.
bitfield-slot
)) ¶automatically generated reader method
Returns the position of the first bit of this slot in the bitfield.
bitfield-slot
)) ¶automatically generated reader method
Take a form that produces a value that is encoded as a non-negative integer (as produced by BITFIELD-SLOT-PACK), and turn it into a form that produces the decoded value.
bitfield-member-slot
) value-form) ¶bitfield-integer-slot
) value-form) ¶bitfield-boolean-slot
) value-form) ¶Parses an atomic bitfield slot specifier, i.e., a bitfield slot
specifier that is not a list. Returns three values:
1. A designator for a bitfield slot class.
2. The size of the bitfield slot.
3. A list of additional arguments that will be supplied to MAKE-INSTANCE when creating the bitfield slot instance.
Parses a compount bitfield slot specifier, i.e., a bitfield slot
specifier that is a list. The SPECIFIER is the CAR of that list and the
ARGUMENTS are the CDR of that list. Returns three values:
1. A designator for a bitfield slot class.
2. The size of the bitfield slot.
3. A list of additional arguments that will be supplied to MAKE-INSTANCE when creating the bitfield slot instance.
(eql member)
) objects &key initform) ¶(eql integer)
) bounds &key initform) ¶(eql signed-byte)
) arguments &key initform) ¶(eql unsigned-byte)
) arguments &key initform) ¶integer
:offset
This slot is read-only.
list
:objects
This slot is read-only.
:name
This slot is read-only.
:initform
This slot is read-only.
:start
This slot is read-only.
:end
This slot is read-only.
:size
This slot is read-only.
A bitfield is a non-negative integer that efficiently encodes information about some booleans, enumerations, or small integers.
bitfield-integer-slot
)) ¶automatically generated reader method
bitfield-member-slot
)) ¶automatically generated reader method
Jump to: | B D F G M P |
---|
Jump to: | B D F G M P |
---|
Jump to: | %
*
S |
---|
Jump to: | %
*
S |
---|
Jump to: | B C F P S T |
---|
Jump to: | B C F P S T |
---|