Foundation Services
Total Page:16
File Type:pdf, Size:1020Kb
VisiQuest MANUALS Programming Services Volume I Foundation Services AccuSoft Corp. www.accusoft.com Program Services Volume I Chapter 0 Preface Copyright (c) AccuSoft Corporation, 2004. All rights reserved. Chapter 0 - Preface A. About This Book This volume is intended for the VisiQuest Toolbox programmer who wants to utilize the library routines avail- able in VisiQuest Foundation Services to develop new programs. It is also intended for those who are using VisiQuest as a software integration system, and wish to modify existing code such that it takes full advantage of the capabilities provided by VisiQuest. Foundation Services is the collective name for the six libraries available in the bootstrap toolbox. The applica- tion program developed using Foundation Services will automatically capitalize on the portability derived from the operation system abstraction provided by Foundation Services. Similarly, an application program using Foundation Services will transparently obtain the capability to support the variety of data transport mecha- nisms handled by Foundation Services. In addition, Foundation Services offers a variety of mathematical functions, a symbolic expression parser, and a wide variety of commonly used functions and utilities. Foundation Services is one of three major categories into which VisiQuest libraries are divided. Data Services emcompasses the libraries in the dataser v toolbox; these libraries consist of routines for accessing and manip- ulating data. GUI & Visualization Services, consisting of libraries in the design toolbox, provides routines for visualizing data in the form of images and graphics. Together, Foundation Services, Data Services, and GUI & Visualization Services contain all the libraries that are distributed with VisiQuest. Program Services refers to all three services as a group. Each of three services in Program Services has its own volume in this set. Vol- ume I, this book, deals exclusively with Foundation Services. B. Assumptions It is assumed that the reader is well-versed in the C programming language and is familiar with the UNIX operating system. It is assumed that the reader has experience with system programming using the system calls available in libc. Familiarity with routines available in libm is also helpful, but not necessary. C. Organization The first chapter gives an introduction to Foundation Services. This introduction includes an overview of Pro- gram Services as a whole, in order to establish a context for discussing the different services that are available as part of Foundation Services. Each of the following chapters is devoted to one of the services within Foun- dation Services. The services included in Foundation Services are: Basic Services Math Services Expression Services Operating System Services 0-1 Preface Program Services Volume I - Chapter 0 D. Conventions The following conventions are used in this manual. 1. Non-VisiQuest function names, library names, and program names appear in italics. 2. VisiQuest function names appear in courier. 3. VisiQuest library names appear in helvetica. 4. VisiQuest program names appear in helvetica. 5. VisiQuest toolbox names appear in helvetica. 6. Code and file excerpts appear in courier. 7. Specific filenames and directory paths appear in courier. 8. Command line examples and instructions appear in courier. 9. For emphasis, some words appear in italics. E. Related Books Related books on VisiQuest include: VisiQuest Installation Guide Introduction to VisiQuest Application Toolboxes Toolbox Programming Visual Programming Program Services Volume II, Data Services Program Services Volume III, GUI & Visualization Services 0-2 Table of Contents A. About This Book .......................... 0-1 B. Assumptions ............................ 0-1 C. Organization ............................ 0-1 D. Conventions ............................ 0-2 E. Related Books ........................... 0-2 -i- Preface Program Services Volume I - Chapter 0 This page left intentionally blank -ii- Program Services Volume I Chapter 1 Introduction Copyright (c) AccuSoft Corporation, 2004. All rights reserved. Chapter 1 - Introduction A. About Foundation Services Foundation Services is the collective name for the six libraries available in the bootstrap toolbox. The appli- cation program developed using these function calls will automatically gain the portability provided by Foun- dation Services. An application program using Foundation Services will transparently obtain the capability to support a variety of data transport mechanisms, including files, mmap, and shared memory. In addition, Foun- dation Services offers an assemblage of mathematical functions, a symbolic expression parser, and a wide vari- ety of commonly-used functions and utilities. VisiQuest libraries are divided into three major categories: Foundation Services, Data Services, and GUI & Visualization Services. Program Services refers to all three categories as a group. Foundation Services encompasses several distinct Program Services libraries. Data Services encompasses the libraries in the dataser v toolbox. These libraries consist of routines for accessing and manipulating data. GUI & Visualiza- tion Services encompasses the libraries in the design toolbox. These libraries consist of routines for visualiz- ing data in the form of images and graphics. Together, Foundation Services, Data Services, and GUI & Visual- ization Services contain all the libraries that are distributed within VisiQuest. The following section provides an overview of Program Services. B. Overview of Program Services VisiQuest Program Services is a large group of libraries that are layered to provide the software developer with a variety of programming interfaces that trade off reduced complexity against detailed control. Program Ser- vices consists of three categories: Foundation Services, Data Services, and GUI Visualization Services. Each Program Services category is comprised of one or more distinct libraries. While this volume deals exclusively with Foundation Services, an overview of Program Services as a whole follows in order to provide a context for understanding the role of Foundation Services. 1-1 Introduction Program Services Volume I - Chapter 1 Data Services GUI & Visualization Services Application GUI Visualization Data Services Services Services data models: VisiQuest widget set polymorphic, visual objects for: color, geometry GUI Objects image / animation display GUI creation/management 2D / 3D plotting data format conversion pseudocolor, thresholding circles, markers, lines, manager object / layout data type conversion rectangles, polylines, etc. event handlers, callbacks large data sets action & input handlers multidimensional data Foundation Services Operating Basic Math Expression System User Interface Services Services Services Services Services general utilities math utilities complex & symbolic UIS interpretation strings, arrays, lists data transport double complex arithmetic expression CLUI parsing memory allocation distributed computing matrix arithmetic parser string-to-token process execution sequence generation database access interpolation Figure 1: The VisiQuest software infrastructure is composed of three major Program Services cat- egories: Data Services, GUI & Visualization Services and Foundation Services. Each Program Services category is comprised of one or more distinct libraries. B.1. Foundation Services Foundation Services encompasses several distinct Program Services. Together, these services fulfill all the requirements of the VisiQuest software infrastructure that do not deal with either data processing or data dis- play. Foundation Services provides an extensive Application Programming Interface (API) which ensures portability by introducing a POSIX-compliant layer of abstraction over the operating system. These services also equip the software developer with an extensive range of functionality, ranging from math utilities to dis- tributed computing. Furthermore, use of VisiQuest Foundation Services ensures application capability with the VisiQuest visual programming environment, cantata. 1-2 Introduction Program Services Volume I - Chapter 1 Foundation Services is divided into a number of specific services: Basic Services, Mathematical Services, Operating System Services, Expression Services, and User Interface Services. Basic Services Basic Services equips the software developer with a broad range of commonly-used functions and utilities, including a large number of utility functions that are able to handle memory allocation, string manipulation, string parsing, and message reporting. Mathematical Services Mathematical Services provides machine-independent implementations of common mathematical operations when not natively available, and offers a variety of useful extensions to the standard mathematical functions. Routines in Mathematical Services are designed to be highly portable and efficient. Operating System Services Operating System Services ensures portability by isolating VisiQuest from the operating system. It extends the capabilities of the operating system and allows seamless integration with cantata. It hides the details of data transports such as files, sockets, shared memory, memory mapped, stream, and pipes. It also transparently supports distributed computing. The API is modeled after UNIX function calls and therefore existing applications can be quickly and easily converted to Foundation Services. Expression Services Expression Services offers a symbolic