eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ProtoObject':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ProtoObject


Inheritance:

   nil
   |
   +--ProtoObject

  This class inherits NOTHING - most messages will lead into doesNotUnderstand:
      |
      +--DelayedValue
      |
      +--Lazy
      |
      +--LazyValue

Package:
stx:libbasic
Category:
Kernel-Objects
Version:
rev: 1.46 date: 2023/12/14 08:25:12
user: cg
file: ProtoObject.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


a minimum object without much protocol;
Provides the minimum required to prevent inspectors from crashing,
and debuggers from blocking.
(i.e. instead of inheriting from nil, better inherit from this).

Named after a similar class found in Dolphin-Smalltalk.

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

helpers
o  shallowCopyOf: anObject
return a copy of anObject with shared subobjects (a shallow copy)
i.e. the copy shares referenced instvars with its original.


Instance protocol:

error handling
o  doesNotUnderstand: aMessage
this message is sent by the runtime system (VM) when
a message is not understood by some object (i.e. there
is no method for that selector). The original message has
been packed into aMessage (i.e. the receiver, selector and
any arguments) and the original receiver is then sent the
#doesNotUnderstand: message.
Here, we raise another signal which usually enters the debugger.
You can of course redefine #doesNotUnderstand: in your classes
to implement message delegation,
or handle the MessageNotUnderstood exception gracefully.

inspecting
o  basicInspect
this method is required to allow inspection of the object

o  inspect
launch an inspector on the receiver.
this method (or better: inspectorClass) can be redefined in subclasses
to start special inspectors.

Usage example(s):

launch an inspector on the receiver.
     this method (or better: inspectorClass) can be redefined in subclasses
     to start special inspectors.

Usage example(s):

     ProtoObject new inspect

o  inspectorClass
return the class of an appropriate inspector

o  inspectorLabelInWindowTitle
( an extension from the stx:libtool package )
what is the inspector showing for me in the title.
Moved out of he inspector to allow redefinition for eg. remote objects

o  inspectorValueListIconFor: anInspector
( an extension from the stx:libtool package )
returns the icon to be shown alongside the value list of an inspector

o  instVarAt: index
this method is required to allow inspection of the object

o  isKindOf: aBehavior
this method is required Behavior>>#allSubInstancesDo:

o  perform: aSelector
this method is required to allow inspection of the object

o  perform: aSelector ifNotUnderstood: exceptionBlock
try to send message aSelector to the receiver.
If it's understood, return the method's returned value,
otherwise return the value of the exceptionBlock.
Read this:
Many programmers do an Error-handle to perform a similar
checked-message send. However, this method is more specific,
in that only errors for the given selector and this receiver are caught - not any other
doesNotUnderstand, and especially not any other error.

o  perform: aSelector with: arg1
this method is required to allow inspection of the object

o  perform: aSelector with: arg1 with: arg2
this method is required to allow inspection of the object

o  perform: aSelector with: arg1 with: arg2 with: arg3
this method is required to allow inspection of the object

o  perform: aSelector with: arg1 with: arg2 with: arg3 with: arg4
this method is required to allow inspection of the object

o  perform: aSelector with: arg1 with: arg2 with: arg3 with: arg4 with: arg5
this method is required to allow inspection of the object

o  perform: aSelector with: arg1 with: arg2 with: arg3 with: arg4 with: arg5 with: arg6
this method is required to allow inspection of the object

o  perform: aSelector withArguments: argArray
send the message aSelector with all args taken from argArray
to the receiver.

1-to-1 Copy from the same method in Object!

o  referencesAny: anObject
this method is required to allow inspection of the object

o  referencesInstanceOf: anObject
this method is required to allow inspection of the object

o  referencesObject: anObject
this method is required to allow inspection of the object

queries
o  basicSize
this method is required to allow restore of the object

o  class
return the receiver's class

o  className
this method is required to allow inspection of the object

o  classNameWithArticle
this method is required to allow inspection of the object

o  identityHash
return an Integer useful as a hash key for the receiver.
This hash should return same values for the same object (i.e. use
this to hash on identity of objects).

We cannot use the Objects address (as other smalltalks do) since
no object-table exists and the hashval must not change when objects
are moved by the collector. Therefore we assign each object a unique
Id in the object header itself as its hashed upon.
(luckily we have 11 bits spare to do this - unluckily its only 11 bits).
Time will show, if 11 bits are enough; if not, another entry in the
object header will be needed, adding 4 bytes to every object. Alternatively,
hashed-upon objects could add an instvar containing the hash value.

testing
o  ifNil: aBlockOrValue
return myself, or the result from evaluating the argument, if I am nil.
This is much like #?, but sends #value to the argument in case of a nil
receiver.
Notice:
This method is open coded (inlined) by the compiler(s)
- redefining it may not work as expected.

o  ifNil: nilBlockOrValue ifNotNil: notNilBlockOrValue
return the value of the first arg, if I am nil,
the result from evaluating the 2nd argument, if I am not nil.
Notice:
This method is open coded (inlined) by the compiler(s)
- redefining it may not work as expected.

o  ifNotNil: aBlockOrValue
return myself if nil, or the result from evaluating the argument,
if I am not nil.
Notice:
This method is open coded (inlined) by the compiler(s)
- redefining it may not work as expected.

o  ifNotNil: notNilBlockOrValue ifNil: nilBlockOrValue
return the value of the 2nd arg, if I am nil,
the result from evaluating the 1st argument, if I am not nil.
Notice:
This method is open coded (inlined) by the compiler(s)
- redefining it may not work as expected.

o  isBehavior
return true, if the receiver is describing another object's behavior.
False is returned here - the method is only redefined in Behavior.

o  isBlock

o  isBridgeProxy
answer true, if I am a proxy object for a bridged remote object

o  isException

o  isExceptionHandler

o  isJavaObject
return true if this is a JavaObject.
false is returned here - the method is only redefined in JavaObject.

o  isLazyValue

o  isLiteral

o  isNil

o  isProtoObject

o  isProxy
answer true, if I am a proxy for another (lazy loaded) object

visiting
o  acceptVisitor: aVisitor with: aParameter
double-dispatch via visitObject:with: into a Visitor.
Subclasses redefine this to pass their type in the message name (i.e. visitXXX:)



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 15 Jun 2024 06:34:19 GMT