next up previous contents
Next: FORTRAN 90 Bindings Up: FORTRAN 77 Bindings Previous: Accessing SIDL Arrays From   Contents

FORTRAN 77 objects with state

If you need to implement a FORTRAN 77 class with state, you can use SIDL arrays to store the state information. This is certainly not the only way to implement a FORTRAN 77 class with state, but it's one that will work wherever BABEL works. For example, if you have a class whose state requires three boolean variables and two double precision variables, your constructor might look something like the following:

users_guide/f77/code/f77_state_ctor.f

Of course, it is up to your application make the association between elements of the arrays and particular state variables. For example, you could say that element 0 of the double array is the kinematic viscosity and element 1 could be the airspeed velocity of an unladden swallow. Element 0 of the boolean array could specify African (true) or European (false). The destructor for this class could look something like this:

users_guide/f77/code/f77_state_dtor.f

In this example, an accessor function for the airspeed velocity of an unladden swallow could be implemented as follows:

users_guide/f77/code/swallow.f


next up previous contents
Next: FORTRAN 90 Bindings Up: FORTRAN 77 Bindings Previous: Accessing SIDL Arrays From   Contents


babel-0.8.0
users_guide Last Modified 2003-01-14

http://www.llnl.gov/CASC/components
components@llnl.gov