<!--
  - Authors:
  -   Christian Schulte <schulte@ps.uni-sb.de>
  -
  - Copyright:
  -   Christian Schulte, 1998
  -
  - Last change:
  -   $Date: 1999/10/13 08:35:11 $ by $Author: nilsf $
  -   $Revision: 1.5 $
  -
  - This file is part of Mozart, an implementation
  - of Oz 3
  -    http://www.mozart-oz.org
  -
  - See the file "LICENSE" or
  -    http://www.mozart-oz.org/LICENSE.html
  - for information on usage and redistribution
  - of this file, and for a DISCLAIMER OF ALL
  - WARRANTIES.
  -
  -->


<Chapter id="chapter.objectsupport">
  <Title/Support Classes for Objects: <<ObjectSupport>>/

  <p>
    This module contains classes that provide generic functionality
    for objects: Organizing objects in hierarchies and reflection of
    objects.

  <section id="section.objectsupport.masterslave">
    <title/Classes for Master&slash;Slave Behaviour/

    <p>
      <Index class=tails/<<ObjectSupport>><And><<master>>/
      An instance ?_{MasterO} of class <<Object.master>> becomes
	a <def/master/ of an <<Object.slave>> object when the latter
	receives the message <<becomeSlave(?_{MasterO})>>.

    <Para class=apropos><Title/Methods for Masters/
	<List>
	  <Entry><<init>>
	    <Index/<<ObjectSupport>><And><<master>><And><<init>>/
	  <Synopsis>
	    <<init()>>
	  <Item>
	    initialization; mandatory for internal reasons.

	  <Entry><<getSlaves>>
	    <Index/<<ObjectSupport>><And><<master>><And><<getSlaves>>/
	  <Synopsis>
	    <<getSlaves(??{SlaveOs})>>
	  <Item>
	    returns the list of current slaves.
	</List>
      <P>
	<Index class=tails/<<ObjectSupport>><And><<slave>>/
	An instance of <<Object.slave>> becomes a <Def/slave/ of an
	<<Object.master>> object ?_{MasterO} when it receives the message
	<<becomeSlave(?_{MasterO})>>.
      <Para class=apropos><Title/Methods for Slaves/
	<List>
	  <Entry><<becomeSlave>>
	    <Index/<<ObjectSupport>><And><<slave>><And><<becomeSlave>>/
	  <Synopsis>
	    <<becomeSlave(?+{MasterO})>>
	  <Item>
	    makes <<self>> become a slave of ?_{MasterO}.  <<self>> must
	    not yet be a slave of any object, else an exception is raised.

	  <Entry><<isFree>>
	    <Index/<<ObjectSupport>><And><<slave>><And><<isFree>>/
	  <Synopsis>
	    <<isFree(??{B})>>
	  <Item>
	    tests whether <<self>> is not the slave of any object.

	  <Entry><<free>>
	    <Index/<<ObjectSupport>><And><<slave>><And><<free>>/
	  <Synopsis>
	    <<free()>>
	  <Item>
	    frees <<self>>.  <<self>> must be the slave of some object,
	    else an exception is
	    raised.
	</List>

  </section>

  <section id="section.objectsupport.reflect">
    <title/Reflecting Objects/

    <p>
      The unsited class <<ObjectSupport.reflect>> provides the
      following methods:

    <p>
      <list>
	<entry><<clone>>
	  <Index/<<ObjectSupport>><And><<reflect>><And><<clone>>/
	<synopsis>
	  <<clone(?+{O})>>
	<item>
          returns a clone of <<self>> (that is, features and current 
          attribute values are equal).

	<entry><<toChunk>>
	  <Index/<<ObjectSupport>><And><<reflect>><And><<toChunk>>/
	<synopsis>
	  <<toChunk(??{Ch})>>
	<item>
          returns a chunk that contains information on current
          attribute values and features.

	<entry><<fromChunk>>
	  <Index/<<ObjectSupport>><And><<reflect>><And><<fromChunk>>/
	<synopsis>
	  <<fromChunk(?+{Ch})>>
	<item>
          Sets features and attributes according to chunk
          ?_{Ch}. ?_{Ch} must have been created with <<toChunk>>. The
          current object must have the same class as that from which
          the chunk was computed. 

      </list>
    
  </section>
    
</chapter>

