Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : OBJECT.H

 
Output of file : OBJECT.H contained in archive : PCCAPP.ZIP
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991
* The University of Illinois Board of Trustees.
* All Rights Reserved.
* CONFIDENTIAL INFORMATION. Distribution restricted under license agreement.
*
* Author: Peter W. Madany ([email protected])
* Author: Vincent F. Russo ([email protected])
* Contributing Author: Lee Lup Yuen ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*/
/*
* Object.h: Abstract superclass of almost every class in Choices.
*/

#ifndef Object_h
#define Object_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif

#ifndef PROXIFY

#define proxiable

#endif

/*
* IMPORTANT NOTICE: if any virtual functions are added to or moved around
* in Object or ProxiableObject, corresponding changes need to be made to
* class ObjectProxy and to every Processor-dependent ObjectProxyStubs.s,
* and changes may need to be made to the ObjectProxyCatchTable in
* ObjectProxy.h.
*/

#include "Assert.h"

static const int MaxObjectDebugMask = 0xff;
static const int MaxObjectDebugMessages = 0x7fff;

class Class;
class ClassStar;
class OutputStream;

static const int ObjectMagicNumber = 0x96;

extern ClassStar ObjectClass;

proxiable class Object {
/*
* The Object class is an abstract superclass of almost every class in Choices.
* The main purpose of class Object is to provide a virtual destructor
* and to help support run-time controllable debugging.
*/
protected:
/* omit
* The number of debugging messages to print out.
* This number is automatically decremented with each message.
*/
short _debugMessages;

/* omit
* The types of debugging messages to print out.
* This variable encodes message types as a bit-mask.
* See Raid.h for available message types.
*/
unsigned char _debugMask;

/* omit
* This vairable is set to ObjectMagicNumber in an Object's constructor
* and set to 0 in the destructor. Some object methods check
* the magicNumber to see if the object is still alive.
* The lack of garbage-collection support makes this useful.
*/
unsigned char _magicNumber;

/*
* Method initDebug: set the debug variables based on values stored
* in the objects Class. See Class.h for information
* on Classes and Class-based debugging.
*/
int initDebug();

public:
/* Method Object: constructor */
Object();

/* Method ~Object: destructor */
proxiable virtual ~Object();

/* Method isProxy: return true iff this object is an ObjectProxy. */
proxiable virtual int isProxy();
/*
* Everybody except ObjectProxy answers 0 to this.
* This only reason this method exists is that ObjectProxy::classOf
* will return the class of what it is proxying and there are
* some cases you REALLY want to know if its a proxy or not.
*/

/* Method identity: return a unique integer that identifies
* this object within the current Domain.
*/
proxiable virtual unsigned int identity();
/*
* The only reason this method exists is that one cannot compare
* pointers to objects when either or both of them might be an
* ObjectProxy.
*/

/* Method alive: return true iff magicNumber is still set properly. */
int alive();
/*
* alive CANNOT be a virtual function, since the pointer to the vtable
* cannot be trusted if the object may not even exist.
*/

/* Method isKindOf: return true if the given Class matches the Class of
* this object or if the given Class is a superclass
* of the Class of this object.
*/
proxiable virtual int isKindOf( Class * );

/* Method isMemberOf: return true iff the given Class matches
* the Class of this object.
*/
proxiable virtual int isMemberOf( Class * );

/* Method classOf: return the Class of this object. */
proxiable virtual Class * classOf();

/* Method debugMask: return a bit-mask of messages types
* that will be debugged. */
proxiable virtual int debugMask();

/* Method setDebugMask: set the bit-mask of messages types
* that should be debugged.
*/
proxiable virtual void setDebugMask( unsigned short mask );

/* Method setDebugMessages: set the number of messages
* that should be debugged.
*/
proxiable virtual void setDebugMessages( short messages );


/* Method writeName: write the name of this object's Class and write its
* virtual address to the given OutputStream.
*/
proxiable virtual void writeName( OutputStream * );
/*
* This method is overloaded in ProxiableObject and other subclasses.
* The overloaded methods write symbolic names and other useful
* information describing this object.
*/

/* Method inspect: the same as the writeName method. */
proxiable virtual void inspect( OutputStream * );
/*
* This method should be overloaded in subclasses. The overloaded
* methods should write additional useful information describing
* this object and recursively call inspect on member objects.
*/

/* Method writeInfo: Write information about this object into
* buffer. Upon return, buffer will contain a null-terminated
* string of the form "classname[address](name)", where "(name)"
* is optional. classname is the real class of this object,
* address is the kernel address of this object, name is the name
* of the object previously set by setName().
*/
void writeInfo (char *buffer);
};

/*
* Method alive checks to make sure the magic number is still set correctly.
* Method alive CANNOT be a virtual function, since the pointer to the vtable
* cannot be trusted if the object may not even exist.
*/
inline int
Object::alive()
{
return( _magicNumber == ObjectMagicNumber );
}

#endif Object_h


  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : OBJECT.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/