obj

Section: OATH Reference Manual (3O)
Updated: 1 Aug 1991
Index Return to Main Contents
 

NAME

obj (objA, objG) - the root abstract type of OATH  

SYNOPSIS

#include <oath/obj.h>  

DESCRIPTION

The obj is the most general abstract entity in the type hierarchy -- all OATH objects are obj's. Obj supports the operations common to all OATH objects. Obj is not an implementation type -- an obj cannot be made from scratch.  

DERIVATION

obj : oathCore

obj is an abstract type.  

STATIC OPERATIONS

objA objA:: isa (objA)
objA::isa(O) returns O (this is a no-op).
objA objA:: import (istream&)
objA::import(S) will import the next obj on the stream, as produced by export (see the definition of export below). The resultant obj will typically be "safe-cast" via isa() to the expected type.
 

MEMBER OPERATIONS

int objA:: isConst ()
O.isConst() returns TRUE if O is a const object (FALSE otherwise).
int objA:: isNil ()
O.isNil() returns TRUE if O is the Nil object (FALSE otherwise).
int objA:: operator ! ()
!O is the same as O.isNil().
int objA:: is (objA)
O1.is(O2) returns TRUE if O1 and O2 are the same object (FALSE otherwise).
int objA:: isEqual (objA)
O1.isEqual(O2) returns TRUE if O1 is equivalent to O2 (FALSE otherwise).
int objA:: operator == (objA)
(O1 == O2) is the same as O1.isEqual(O2).
int objA:: operator != (objA)
(O1 != O2) is the same as !O1.isEqual(O2).
objA objA:: makeCopy (int)
O.makeCopy(C) makes and returns a copy of O. isEqual(O) will return TRUE on the copy. If C is TRUE, then the copy will be constant. The default for C is FALSE. Note that if O is constant, and a constant copy is called for, then O may be returned as the copy.
objA objA:: operator + (objA)
+O is the same as O.makeCopy().
void objA:: export (ostream&)
O.export(S) will export the obj to the stream such that it can be imported via import. The precise semantics are defined by the derived types. However, all sub-objects of the exported obj that are identical (return TRUE from is()) will be identical when imported. The sub-objects will each be as if they were individually exported and then imported. The intent is that the exported obj be roughly equivalent (though not necessarily isEqual()) to the original.
objA objA:: be ()
O.be() returns O. If O is Nil, then it will report that an error has occured and then abort (via ensure()).
objA objA:: am ()
O.am() returns O. If NDEBUG is not defined when <oath/macros.h> was included, then O.am() behaves the same as O.be().
 

INTERNAL OPERATIONS

virtual int objG:: isType (void*)
G->isType(TypeId) returns TRUE if G is an instance of or descended from the type denoted by TypeId.
virtual int objG:: isImplementedAs (void*)
G->isImplementedAs(TypeId) returns TRUE if G is implementated by the type denoted by TypeId. Note that no object will return TRUE if passed objT::Type.
virtual int objG:: isEqual (objT*)
G1->isEqual(G2) returns TRUE if G1 is equivalent to G2.
virtual objA objG:: makeCopy (int)
G->makeCopy(C) will make and return a copy of G. isEqual(G) will return TRUE on the copy. If C is TRUE, then the copy will be constant. Note that if G is constant, and a constant copy is called for, then G may be returned as the copy.
 

SEE ALSO

OATH(3O), oathCore(3O), ensure(3O)  

AUTHOR

Brian M. Kennedy (Computer Science Center, Texas Instruments Incorporated)  

BUGS


 

Index

NAME
SYNOPSIS
DESCRIPTION
DERIVATION
STATIC OPERATIONS
MEMBER OPERATIONS
INTERNAL OPERATIONS
SEE ALSO
AUTHOR
BUGS

This document was created by man2html, using the manual pages.
Time: 20:37:47 GMT, July 24, 2024