Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesFile I/O on Objects, Instead of Bytes


January 1995 / News & Views / File I/O on Objects, Instead of Bytes
Rick Grehan

The word Gamelon sounds like it should be the name of Godzilla's archrival. Instead, it's the name of an object-oriented file access library for OS/2, Windows, and Windows NT that could probably get away with calling itself a full-fledged object-oriented database engine.

Gamelon, which is available from Menai (Menlo Park, CA, (415) 853-6450) views a file as a collection of objects. Consequently, your program doesn't maneuver through a file by telling Gamelon something like, "Advance the file pointer 400 bytes and read 12 bytes." Instead, the call looks more like, "Advance the file pointer three objects into the file and read the following object." Those three objects could be literally anything. That's the beauty of Gamelon.

Objects that can be found within a Gamelon file fall broadly into one of two categories: data objects and aggregate objects. A data object is a simple object--it can be an integer, a floating-point number, or a string. However, the word simple might be misleading; a data object could also be a BLOB or a data structure (in the sense of a C struct{} data type). An aggregate object is an object container that holds simple objects and/or other aggregate objects.

Gamelon's equivalent of a file pointer is a cursor, a kind of roving pointer that keeps track of the object in the file that your program is currently accessing. Unlike a simple file pointer, a cursor can point at an aggregate object as easily as it can point at a data object. Consequently, manipulating aggregate objects is as simple as manipulating data objects. If you move the cursor to an aggregate object (that contains, say, 400 other objects) and issue Gamelon's equivalent of a delete() function call, the entire aggregate object--members and all--is gone.

The N T version of the Gamelon library ($495) arrives as a collection of header files, a .DEF file, a DLL, and utilities. The files provide all the linkage you need to hook your program into the DLL (where Gamelon lives), so adding Gamelon to your program is really just a matter of placing the proper files into your project. Currently, Gamelon provides interfaces for C and C++. Gamelon is thread-safe, so you'll have no problems running it from a multithreaded program.

I found the browser to be the most worthwhile utility included. It allows you to explore existing Gamelon data files as well as create new ones. The browser also lets you manipulate simple and aggregate objects; you can insert, delete, and modify them, as well as move the cursor through a file either by clicking on navigation buttons or by simply pointing to the object you want to focus on and clicking the mouse. This is handy for making sure that your Gamelon-based programs create the file structures that you intended them to create.

Gamelon even provides locking and transactioning. Possibly the only thing keeping it from being an object-oriented DBMS is the lack of an indexing capability.


Gamelon's browser is a worthwhile utility.

screen_link (54 Kbytes)


Up to the News & Views section contentsGo to previous article: The Next On-Line WaveSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network