| oop
Index
VOID OOP_AddClass(
OOP_Class * classPtr );
Adds a class to the public list of classes.
This means that any process can create objects of this
class.
classPtr - Pointer to the class to make public.
Would be faster to use a hashtable to look up class IDs
VOID OOP_DisposeObject(
OOP_Object * obj );
Delete an object that was previously allocated with NewObjectA().
obj - pointer to object to dispose.
IPTR OOP_GetAttr(
OOP_Object * object,
OOP_AttrID attrID,
IPTR * storage );
Gets the specifed attribute from the object,
and puts it into storage.
object - pointer to object from which we want to
get an attribute.
attrID - Attribute ID for property to get.
storage - Pointer to IPTR the gitten data should be put
into.
OOP_AttrBase OOP_GetAttrBase(
STRPTR interfaceID );
Maps a globally unique string interface ID into
a numeric AttrBase ID that is unique on
pr. machine basis. IMPORTANT: You MUST
be sure that at least one class implementing
specified interface is initialized at the time calling
this function. This function is especially useful
for a class to get AttrBases of the interfaces
it implements.
interfaceID - globally unique interface identifier.
Numeric AttrBase that is unique for this machine.
There are NO error conditions.
VOID * OOP_GetMethod(
OOP_Object * obj,
OOP_MethodID mid );
Get a specific method function for a specific object and
a specific interface. This a direct pointer to the method implementation.
The pointer should ONLY be used on the object you aquired.
obj - pointer to object to get method for.
mid - method id for method to get. This may be obtained with GetMethodID()
The method asked for, or NULL if the method does not exist in
the object's class.
!!! Use with EXTREME CAUTION. Very few programs need the extra speed gained
by calling a method directly
!!!
It returns VOID *. I got compiler errors when returning
IPTR (*)(Class *, Object *, Msg)
OOP_MethodID OOP_GetMethodID(
STRPTR interfaceID,
ULONG methodOffset );
Maps a globally unique full method ID
(Interface ID + method offset) into
a numeric method ID.
interfaceID - globally unique interface identifier.
methodOffset - offset to the method in this interface.
Numeric method identifier that is unique for this machine.
APTR OOP_NewObject(
struct OOP_IClass * classPtr,
UBYTE * classID,
struct TagItem * tagList );
Creates a new object of given class based on the TagItem
parameters passed.
classPtr - pointer to a class. Use this if the class to
create an instance of is private.
classID - Public ID of the class to create an instance of.
Use this if the class is public.
tagList - List of TagItems (creation time attributes),
that specifies what initial properties the new
object should have.
Pointer to the new object, or NULL if object creation failed.
You should supply one of classPtr and classID, never
both. Use NULL for the unspecified one.
OOP_AttrBase OOP_ObtainAttrBase(
STRPTR interfaceID );
Maps a globally unique string interface ID into
a numeric AttrBase ID that is unique on
pr. machine basis. The AttrBase can be combiner
with attribute offsets to generate attribute IDs.
interfaceID - globally unique interface identifier.
for which to obtain an attrbase.
Numeric AttrBase that is unique for this machine.
A return value of 0 means that the call failed.
#define aTimer_CurrentTime (__AB_Timer + aoTime_CurrentTime)
..
__AB_Timer = OOP_ObtainAttrBase(IID_Timer);
SetAttrs(timer, aTimer_CurrentTime, "10:37:00");
Obtained attrbases should be released with ReleasAttrBase().
BOOL OOP_ObtainAttrBases(
struct OOP_ABDescr * abd );
LONG OOP_ParseAttrs(
struct TagItem * tags,
IPTR * storage,
ULONG numattrs,
OOP_AttrCheck * attrcheck,
OOP_AttrBase attrbase );
Parse a taglist of attributes and put the result in an array.
It will only parse the attr from a single interface
which is indicated by the 'attrbase' parameter.
tags - tags to be parsed.
storage - array where the tag values will be stored.
To get the value for a certain tag just use
ao#? attribute offset as an index into the array.
The array must be of size 'numattrs', ie. the number
of attributes in the interface.
numattrs - number of attributes in the interface.
attrcheck - will is a flag that where flags will be set according
to the attributes' offset. Since this is only 32
bytes you can only parse interfaces
with <= 32 attributes with this function.
If you try with more, you will get a
ooperr_ParseAttrs_TooManyAttrs error.
The flags will be set like this if an attr is found:
attrcheck |= 1L << attribute_offset
attrbase - attrbase for the interface whise attrs we should look for.
0 for success, and an error otherwise.
Possible values are:
ooperr_ParseAttrs_TooManyAttrs.
VOID OOP_ReleaseAttrBase(
STRPTR interfaceID );
Release an OOP_AttrBase previosly obtained with
OOP_ObtainAttrBase()
interfaceID - globally unique interface identifier.
for which to release an attrbase.
The call must be paired wit OOP_ObtainAttrBase().
VOID OOP_ReleaseAttrBases(
struct OOP_ABDescr * abd );
void OOP_RemoveClass(
OOP_Class * classPtr );
Remove a class from the list of public classes.
The class must have previously added with AddClass().
classPtr - Pointer to class that should be removed.
IPTR OOP_SetAttrs(
OOP_Object * object,
struct TagItem * attrList );
Sets the object's attributes as specified in the
supplied taglist.
object - pointer to a object in whih we
want to set attributes.
tagList - List of attributes an their new values.
|