confirm-if-blackboard-repository-not-empty-pBlackboard Repositorydelete-blackboard-repositorydefine-space-classGoTo Top

define-space-class   space-class-name ({superclass-name}*) ({slot-specifier}*) {class-option}* => new-space-class[Macro]

Define or redefine a space class.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

space-class-name     A non-nil, non-keyword symbol that names the space class
superclass-name     A non-nil, non-keyword symbol that specifies a direct superclass of the space class space-class-name
slot-specifiers     See below
class-options     See below
new-space-class     A new or modified space class object

The newly defined or modified space class object.

The specified superclass-names do not include at least one space class name. This error is signaled on class finalization.

Detailed syntax
[Syntax shown in gray is not supported in GBBopen Version 1.5, but will become available in a future release.]

slot-specifier ::= slot-name |
(nonlink-slot-name [[nonlink-slot-option]]) |
(link-slot-name [[link-slot-option]])

nonlink-slot-name ::= slot-name
link-slot-name ::= slot-name
link-slot-option ::= slot-option |
{:link inverse-link-slot-specifier} |
{:singular boolean} |
{:sort-function function} |
{:sort-key function}
inverse-link-slot-specifier ::= (unit-class-name link-slot-name [:singular boolean]) |
nonlink-slot-option ::= slot-option |
{:reader reader-function-name}* |
{:writer writer-function-name}*
slot-option ::= {:accessor reader-function-name}* |
{:allocation allocation-type} |
{:documentation string} |
{:initarg initarg-name}* |
{:initform form} |
{:type type-specifier}
class-option ::= (:abstract boolean) |
(:default-initargs . initarg-list) |
(:dimensional-values dimension-value-specifier*) |
(:documentation string) |
(:estimated-instances integer) |
(:export-accessors boolean) |
(:export-class-name boolean) |
(:export-slot-names direct-slots-specifier) |
(:generate-accessors direct-slots-specifier) |
(:generate-accessors-format {:prefix | :suffix} |
(:generate-accessors-prefix {string | symbol}) |
(:generate-accessors-suffix {string | symbol}) |
(:generate-initargs direct-slots-specifier) |
(:initial-space-instances initial-space-instance-specifier) |
(:instance-name-comparison-test instance-name-comparison-test) |
(:metaclass class-name) |
(:retain {boolean | :propagate}) |
(:use-global-instance-name-counter boolean)
initial-space-instance-specifier ::= {space-instance-path+ | function}
dimension-value-specifier ::= incomposite-dv-specifier | composite-dv-specifier
incomposite-dv-specifier ::= (dimension-name dimension-value-spec dimension-value-place)
composite-dv-specifier ::= (dimension-name dimension-value-specifier
  composite-type dimension-value-place)
composite-type ::= :set | :sequence |
{:ascending-series ordering-dimension-name} |
{:descending-series ordering-dimension-name}
dimension-value-specifier ::= dimension-value-type |
(ordered-dimension-value-type [ordered-comparison-type]) |
(enumerated-dimension-value-type [enumerated-comparison-type]) |
(boolean-dimension-value-type [boolean-comparison-type])
dimension-value-type ::= ordered-dimension-value-type |
enumerated-dimension-value-type |
ordered-dimension-value-type ::= :point | :interval | :mixed
enumerated-dimension-value-type ::= :element
boolean-dimension-value-type ::= :boolean
ordered-comparison-type ::= number | fixnum | short-float | single-float |
double-float | long-float |
enumerated-comparison-type ::= eq | eql | equal | equalp
boolean-comparison-type ::= t
dimension-value-place ::= {slot-name [slot-name]} | {function [slot-name]}
direct-slots-specifier ::= nil | t | included-slot-name* |
{t :exclude excluded-slot-name*}

The default ordered-comparison-type, if unspecified, is number. The default enumerated-comparison-type, if unspecified, is eql. The default boolean-comparison-type is t.

A dimension-value-place with two slot-names is allowed only for an :interval dimension-value specification.


class-name     A non-nil, non-keyword symbol that names a class
documentation     A documentation string
initarg-list     An initialization argument list
slot-name     A non-nil, non-keyword symbol
instance-name-comparison-test     One of the four standardized hash table test function names: eq, eql, equal, or equalp (default for classes of metaclass standard-unit-class is eql)

A dimension-value-place with two slot-names can be specified only for :interval dimension-value types.

Each superclass-name argument specifies a direct superclass of the new class. If the superclass list is empty, then the direct superclass defaults to the single class standard-space-instance.

The :metaclass class-name class option, if specified, must be a subclass of standard-space-class. The default metaclass value is standard-space-class.

Inheritance of class options

The set of dimensional-values for a unit class is the union of the sets specified in the dimensional-values options of the class and its superclasses. When more than one dimension-value specification is supplied for a given dimension, the one supplied by the most specific class is used.

The effective initial-space-instances value for a unit class is the value specified in the definition of the most specific unit class. (No additive inheritance of initial-space-instances is performed.) If no definitions specify an initial-space-instances value, nil is used.

The instance-name-comparison-test value is not inherited. If no value is specified in the unit-class definition, the default initialization value associated with the metaclass is used.

If a retain value is not specified, a value of :propagate is used as the default if any parent unit classes have a :propagate retention value; otherwise nil is used as the default value.

The use-global-instance-name-counter value is not inherited. If no value is specified in the unit-class definition, the default initialization value associated with the metaclass is used.

See also

Define a space class, space-instance-with-lock, that has an additional slot containing a lock that can be used to synchronize operations on each space instance of that class. Then, create one instance of the space-instance-with-lock space class.

  > (define-space-class space-with-lock ()
      ((lock :initform (make-lock :name "Space-Instance Lock"))))
  #<standard-space-class space-with-lock>
  > (make-space-instance '(bb hyps) 
      :class 'space-with-lock)
  #<space-with-lock (bb hyps)>

The GBBopen Project

confirm-if-blackboard-repository-not-empty-pBlackboard Repositorydelete-blackboard-repositorydefine-space-classGoTo Top