[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .

IO Interface And Operations

Table of Contents
Fundamentals Of IO::Adapter
Methods / Operation Vector
Discussion

We need IO abstraction layer for porting and extension. See Vnode/VFS interface (vnode(9)) on IO abstraction.

struct vnode {
		...
        voff_t          v_size;                 /* size of file */
        int             v_numoutput;            /* num pending writes */
        long            v_writecount;           /* ref count of writers */
		...
        int             (**v_op)(void *);       /* vnode ops vector */
		...
        void            *v_data;                /* private data for fs */
};
vop_open(), vop_read(), vop_getattr(), ... are defined over v_op.

**v_op (vnode operation vector) corresponds to a method of object oriented programming. fml8 provides IO::Adapter class as IO abstraction layer.

Fundamentals Of IO::Adapter

IO::Adapter is most fundamental in fml8 architecture. It is well considered and implemented. It provides enough primitive methods.

IO::Adapter class abstracts

KEY => VALUE
or
KEY => [ VALUE, VALUE2, VALUE3 ]
type data structure. It is similar to RDBMS theory like this.

KEY1 VALUE1-1 ""     ""
KEY2 VALUE2-1 VALUE2-2 VALUE2-3
KEY3 VALUE3-1 VALUE3-2 VALUE3-3
KEY4 VALUE4-1 VALUE4-2 VALUE4-3

To maintain address list, least fundamental methods of IO::Adapter are

open()
close()
and IO operations to the object
add(KEY, ARGV) (ARGV is class dependent)
delete(KEY)
find(KEY or REGEXP)
get_next_key()
methods. At least, enough to write user management codes.

[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .
Copyright (C) 1993-2022 Ken'ichi Fukamachi mail:< fukachan at fml.org >