Home Libraries Author Links

Abstract Data Type StmPipeWord
[Abstract Data Type StmPipe]

Collaboration diagram for Abstract Data Type StmPipeWord:

Detailed Description

A StmPipeWord object encapsulates status and value of one data byte flowing through a StmPipe data pipe object.

The content of a StmPipeWord object is stored in a StmWord called its word. That word is devided into its high StmByte called hi bearing the status (see StmPipeWordStatus) of the StmPipeWord object and its low StmByte called lo bearing the data of the StmPipeWord object. To express the word of a StmPipeWord object as pair of its hi and lo StmByte parts, the expression (hi, lo) is used in this documentation.


StmPipeWord Representation

An object of abstract data type StmPipeWord is represented as an object of its implementation structure.

enum  StmPipeWordStatus {
  StmPipeNormal = 0,
  StmPipeAgain = 1,
  StmPipeNeedItem = 2,
  StmPipeError = 3,
  StmPipeCtrl = 0x80,
  StmPipeAllCtrl = 0xff
}
 Status constants stored in the hi StmByte part of a StmPipeWord word. More...
typedef struct StmPipeWord StmPipeWord
 Implementation structure.

StmPipeWord Generation

StmPipeWord stmPipeWordMake (StmWord word)
 Return a StmPipeWord object with StmWord content word.
StmPipeWord stmPipeWordLoMake (StmByte lo)
 Return a StmPipeWord object with StmByte data content lo.
StmPipeWord stmPipeWordHiMake (StmByte hi)
 Return a StmPipeWord object with StmByte status content hi.
StmPipeWord stmPipeWordHiLoMake (StmByte hi, StmByte lo)
 Return a StmPipeWord object with StmByte status content hi and StmByte data content lo.
StmPipeWord stmPipeWordErrNoMake (StmByte errNo)
 Return a StmPipeWord object containing an error code errNo.
StmPipeWord stmPipeWordEofMake (void)
 Return a StmPipeWord object containing the global control code EOF.

StmPipeWord Method Functions

StmWord stmPipeWord (StmPipeWord item)
 Return the StmWord content of the StmPipeWord object item.
StmByte stmPipeWordLo (StmPipeWord item)
 Return the StmByte data content of the StmPipeWord object item.
StmByte stmPipeWordHi (StmPipeWord item)
 Return the StmByte status content of the StmPipeWord object item.
StmBool stmPipeWordIsEof (StmPipeWord item)
 Return StmTrue, if the StmPipeWord object item contains the global control code EOF.


Typedef Documentation

typedef struct StmPipeWord StmPipeWord

Implementation structure.

Definition at line 138 of file cpipe.h.


Enumeration Type Documentation

enum StmPipeWordStatus

Status constants stored in the hi StmByte part of a StmPipeWord word.

For an in depth discussion of the semantics of the enumerators see stmPipeFilterCreate().

Enumerator:
StmPipeNormal  Normal data.

StmPipeAgain  Repeat data.

StmPipeNeedItem  Request additional data.

StmPipeError  Report operation error.

StmPipeCtrl  Control flag.

StmPipeAllCtrl  Global control.

Definition at line 147 of file cpipe.h.


Function Documentation

StmPipeWord stmPipeWordMake ( StmWord  word  ) 

Return a StmPipeWord object with StmWord content word.

Parameters:
[in] word StmWord content of the result.
Returns:
A StmPipeWord object with word as StmWord content.
See also:
stmPipeWordLoMake(), stmPipeWordHiMake(), stmPipeWordHiLoMake(), stmPipeWordErrNoMake(), stmPipeWordEofMake().

StmPipeWord stmPipeWordLoMake ( StmByte  lo  ) 

Return a StmPipeWord object with StmByte data content lo.

Parameters:
[in] lo StmByte data content of the result.
Returns:
A StmPipeWord object with (0, lo) as StmWord content.
See also:
stmPipeWordMake(), stmPipeWordHiMake(), stmPipeWordHiLoMake(), stmPipeWordErrNoMake(), stmPipeWordEofMake().

StmPipeWord stmPipeWordHiMake ( StmByte  hi  ) 

Return a StmPipeWord object with StmByte status content hi.

Parameters:
[in] hi StmByte status content of the result.
Returns:
A StmPipeWord object with (hi, 0) as StmWord content.
See also:
stmPipeWordMake(), stmPipeWordLoMake(), stmPipeWordHiLoMake(), stmPipeWordErrNoMake(), stmPipeWordEofMake().

StmPipeWord stmPipeWordHiLoMake ( StmByte  hi,
StmByte  lo 
)

Return a StmPipeWord object with StmByte status content hi and StmByte data content lo.

Parameters:
[in] hi StmByte status content of the result.
lo StmByte data content of the result.
Returns:
A StmPipeWord object with (hi, lo) as StmWord content.
See also:
stmPipeWordMake(), stmPipeWordLoMake(), stmPipeWordHiMake(), stmPipeWordErrNoMake(), stmPipeWordEofMake().

StmPipeWord stmPipeWordErrNoMake ( StmByte  errNo  ) 

Return a StmPipeWord object containing an error code errNo.

Parameters:
[in] errNo StmByte error code of the result.
Returns:
A StmPipeWord object with (StmPipeError, errNo) as StmWord content.
See also:
stmPipeWordMake(), stmPipeWordLoMake(), stmPipeWordHiMake(), stmPipeWordHiLoMake(), stmPipeWordEofMake().

StmPipeWord stmPipeWordEofMake ( void   ) 

Return a StmPipeWord object containing the global control code EOF.

Returns:
A StmPipeWord object with (StmPipeAllCtrl, 0xff) as StmWord content.
See also:
stmPipeWordMake(), stmPipeWordLoMake(), stmPipeWordHiMake(), stmPipeWordHiLoMake(), stmPipeWordErrNoMake().

StmWord stmPipeWord ( StmPipeWord  item  ) 

Return the StmWord content of the StmPipeWord object item.

Parameters:
[in] item The StmPipeWord object.
Returns:
The StmWord content of item.
See also:
stmPipeWordLo(), stmPipeWordHi(), stmPipeWordIsEof().

StmByte stmPipeWordLo ( StmPipeWord  item  ) 

Return the StmByte data content of the StmPipeWord object item.

Parameters:
[in] item The StmPipeWord object.
Returns:
The StmByte data content of item.
See also:
stmPipeWord(), stmPipeWordLo(), stmPipeWordIsEof().

StmByte stmPipeWordHi ( StmPipeWord  item  ) 

Return the StmByte status content of the StmPipeWord object item.

Parameters:
[in] item The StmPipeWord object.
Returns:
The StmByte status content of item.
See also:
stmPipeWord(), stmPipeWordHi(), stmPipeWordIsEof().

StmBool stmPipeWordIsEof ( StmPipeWord  item  ) 

Return StmTrue, if the StmPipeWord object item contains the global control code EOF.

Parameters:
[in] item The StmPipeWord object.
Returns:
StmFalse, if item does not contain the global control code EOF.

StmTrue, if item contains the global control code EOF.

See also:
stmPipeWord(), stmPipeWordLo(), stmPipeWordHi().


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).