Generic ANSI-C language OOP extension:
Generic functions, multiple inheritance,
automatic garbage collection, run-time
error checking, etc. No special pre-
processor required, compatible with
standard C libraries and code. Fully
portable ANSI C source code incl. This
is PUBLIC DOMAIN, user's group avail.
WARNING: The software and documentation that are a part of the GCOOPE
package are hereby entered into the public domain. Both the
software and documentation are released without any warranties
whatsoever, inlcuding the implied warranties of merchantability
and fitness for use.
What is GCOOPE?
The GCOOPE system gives Object Oriented Programming capability to 'C'
language programmers using ANSI-C, NOT C++. These capabilities include
generic (polymorphic/virtual/overloaded) functions, multiple and partial
inheritance, and full compatibility with pre-existing C function libraries.
All without requiring a special pre-processor or other utility programs
beyond linking in the run-time kernel code.
What does GCOOPE do?
GCOOPE allows developers to write object oriented programs in a Smalltalk
like manner without the interpreter penalty. Programmers can create
class definitions which may inherit and be inherited by other class
definitions. Similar functions may be referred to by the same generic
name even though they execute different code determined by the object class
that they are defined for. GCOOPE provides the framework to track and
route instances and methods, while maintaining the capability to be freely
mixed with pre-existing C code. Another way of describing GCOOPE is as a
dynamic object database manager with a built in generic function dispatcher.
What are GCOOPE's features?
* A modular, expandable, kernel written in standard ANSI-C.
* Highly encapsulated class definition modules allow a high degree of
code reusability without modification or recompilation.
* Generic (virtual) functions in ANSI-C that are easy to use yet are
highly flexible. Generic functions and methods may be freely added,
removed, and even redefined.
* Full meta class system (run-time class representation), new code can
expand/and or modify a pre-loaded class definition on the fly.
* Flexible inheritance system, the inheritance system supports the
inheritance of multiple classes, partial inheritance, and inheritance
* Optional strong type checking for generic functions allows nearly the
same degree of static type checking as standard ANSI C.
* Run-time error detection system that is fully expandable and may be
redefined by object class definitions to allow for error recovery.
* Automatic management of temporary objects in a manner compatible with
future multi thread extensions. GCOOPE features an adaptive garbage
collector system that is process ID aware and operates in the background
calling the appropriate destructors for temporary objects which are
no longer used.
* Ease of use, GCOOPE defines a standard kernel interface and provides
macros to eliminate programming clutter. Calling a generic function
looks like: g(GenFuncName)(objectHandle,methodParms);. Even with the
strong type checking option the above call is simply:
What are GCOOPE's main restrictions?
Presently, GCOOPE has only been used with Borland Turbo C 2.0 in the large
memory model. Other compilers and memory models have not been tried.
Also, the provided software has not been optimized. Early experiments
point to an decrease in execution time of 80% or more in the function
dispatcher alone if function calls are eliminated.
What expansions are planned?
Multitasking and Dynamic Loading are in the works. An earlier version of
the package had both capabilities at least in a limited manner, but those
approaches complicated the API beyond belief. It is probable, at least
with Dynamic Loading, that a pre-processor/utility program will be
required. This is due to the necessity of adding a symbol system with
referencing and redirecting all external references in a class definition.
Both of these expansions will require input and participation by User's
Group members before they are released. Also note that any expansions
written solely by this author will be released for free only to User's group
members, other parties will likely be charged a modest fee. However
all software produced in co-operation with the User's group will be released
as public domain.
Why is this being released for free?
There are several reasons why GCOOPE is being released for free, given
that some of its main competitors cost on the order of $500 plus license fees
One reason is to get a wider audience using GCOOPE. Price Technologies
plans on making use of this technology in other products in the future, so
it pays to have this system be thoroughly tried, ported, and extended by a
broad-based user community.
It is also hoped that, by releasing this to the public domain, sufficient
interest can be generated as to allow this package to be extended in a team
fashion. Price Technologies is a one man shop with extremely limited
resources, so the future development of GCOOPE, while led and organized by
Price Technologies, will require the assistance of the GCOOPE user community.
It is also hoped that the GCOOPE user community can work together to create
standard APIs for likely expansion class libraries and kernel modules:
* GUI support (MS-Windows, X-Windows, Motif, etc.)
* Pre-emptive multiTasking (MS-DOS, Unix, Mac, Atari ST, etc.)
* Dynamic Object Class Linking and Loading
Price Technologies is more than willing to help coordinate debate on APIs
for these and any other proposed GCOOPE standards, as well as to distribute
GCOOPE code written to these APIs (or any other freely distributable modules)
as a part of the overall GCOOPE package. Limitations will have to be made in
terms of the legality of such packaging (e.g., Price Technologies will not
include cryptographic engines in GCOOPE distributions due to potential
export restrictions and subsequent problems with the US government).
However, due to financial limitations, technical support and direct
mailings will be limited to the members of the GCOOPE User's GROUP. The
annual membership fee is $20.00, full details are included in the appendix
to the User's Guide.
The final reason is simply that GCOOPE is not, as yet, commercial quality
software. While Price Technologies could invest the time and money to get
it to that level, with an eye toward a shareware/commercial release and the
resulting profits, that is not the mission. It makes more sense to release
it and maintain it through the user's group. This should not be construed as
saying that this software is a "piece of junk"; instead, this software should
be thought of much in the same fashion as any other package obtained via FTP
-- one could even term it "caveat downloader".
The software included in this package consists of the source code and
linkable object modules for the kernel and the basic class library along
with appropriate header files.
Kernel: listmgr.c, listmgr.obj, objlist.c, objlist.obj, genlist.c,
genlist.obj, garbage.c, garbage.obj, funcdisp.c, funcdisp.obj,
object.c, object.obj, class.c, class.obj, and gcstruct.h.
System: gcoope10.h, typing.h, generic.h, gcinit.h, gcinit.c, and gcinit.obj.
Classes: char.c, char.obj, shortint.c, shortint.obj, unsigned.c,
unsigned.obj, longint.c, longint.h, pointer.c, pointer.h,
dynmem.c, dynmem.obj, array.c, array.obj, collect.c, collect.obj,
lowstrm.c, lowstrm.obj, string.c, string.obj, stdstrm.c,
stdstrm.obj, stream.c, stream.h, and stream.obj.
Test: gentest.c, gentest.obj, gentest.prj, and gentest.exe.
NOTE: gentest is a simple hello world test program.
The source code and header files are documented with many notes and helpful
hints, in addition the following document files are included:
* USER10.TXT -- the user's guide to GCOOPE with OOP intro.
* KERN10.TXT -- the Technical Reference Manual to the GCOOPE kernel.
* GENERICS.TXT -- explanation of pre-defined generic functions.
* CLASSES.TXT -- explanation of pre-defined class definitions.
* LATEADDS.TXT -- late add-ons and notes.
The author will provide the following limited technical support on an as
available basis: consultation for ports of GCOOPE to new compilers/
platforms, and bug fixes/reports.
Any further support will require a negotiation of consulting fees, however
a higher degree of technical support will be provided for free to GCOOPE
user's group members see appendices in KERN10.TXT or USER10.TXT for details.
The author can be contacted via the following channels:
Voice: (814) 784 - 3614.
Snail Mail:PRICE TECHNOLOGIES
Brian Lee Price
RD2 BOX 239AA
CLEARVILLE, PA. 15535.
E-Mail: [email protected]
Home port bbs:Magnetic Bottle 1-814-238-5559
The Programmer's Corner 1-301-596-7692
All inquiries are welcomed.
The GCOOPE package would not have been possible without the input from the
first User's Group members of its ancestor package PCOOPE21, namely
Norman Culver, and Mark Murphy. Many thanks gentlemen.
Also the form and some of the content of this document have been
borrowed from the excellent documentation provided by Mark Murphy with
his DLMEngine package.