PA05 STUB Function creation
++ ArrayDataEngine.c ++ IteratorUtility.c ++ QueueUtility.c ++ StackUtility.c +- Makefile for PA05
This commit is contained in:
parent
108632e832
commit
e0aadd2db6
5 changed files with 641 additions and 16 deletions
171
PA05-1004/IteratorUtility.c
Normal file
171
PA05-1004/IteratorUtility.c
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
// header files
|
||||
#include "IteratorUtility.h"
|
||||
|
||||
/* Data Structures
|
||||
typedef struct IteratorStruct
|
||||
{
|
||||
StateArrayType *iterData;
|
||||
|
||||
int currentIndex;
|
||||
} IteratorType;
|
||||
Data Structures */
|
||||
|
||||
// function implementation
|
||||
|
||||
/*
|
||||
Name: clearIterator
|
||||
Process: clears the StateDataType sub-structure, and then the IteratorType
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *)
|
||||
Function output/parameters: none
|
||||
Function output/returned: NULL
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: clearDataStructure, free
|
||||
*/
|
||||
IteratorType *clearIterator( IteratorType *iterator )
|
||||
{
|
||||
// return NULL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: createIterator
|
||||
Process: initializes the IteratorType,
|
||||
and then the StateDataType sub-structure
|
||||
Function input/parameters: initial capacity (int)
|
||||
Function output/parameters: none
|
||||
Function output/returned: pointer to initialized IteratorType (IteratorType *)
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: malloc, createDataStructure
|
||||
*/
|
||||
IteratorType *createIterator( int initialCapacity )
|
||||
{
|
||||
// return IteratorType
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: getFirst
|
||||
Process: gets first value in iterator, returns true,
|
||||
returns false otherwise
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *)
|
||||
Function output/parameters: return value (StateDataType *)
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: getItemAtIndex
|
||||
*/
|
||||
bool getFirst( IteratorType *iterator, StateDataType *returned )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: getLast
|
||||
Process: gets last value in iterator, returns true,
|
||||
returns false otherwise
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *)
|
||||
Function output/parameters: return value (StateDataType *)
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: getItemAtIndex, getListSize
|
||||
*/
|
||||
bool getLast( IteratorType *iterator, StateDataType *returned )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: getNext
|
||||
Process: gets next value in iterator if available, returns true,
|
||||
otherwise, sets return value to empty, returns false
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *)
|
||||
Function output/parameters: return value (StateDataType *)
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: getItemAtIndex, getListSize
|
||||
*/
|
||||
bool getNext( IteratorType *iterator, StateDataType *returned )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: getPrevious
|
||||
Process: gets previous value in iterator if available, returns true,
|
||||
otherwise, sets return value to empty, returns false
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *)
|
||||
Function output/parameters: return value (StateDataType *)
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: getItemAtIndex
|
||||
*/
|
||||
bool getPrevious( IteratorType *iterator, StateDataType *returned )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: insertAfterCurrentIndex
|
||||
Process: inserts value immediately after currentIndex, if possible, returns true,
|
||||
otherwise, returns false
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *),
|
||||
value to be inserted (const StateDataType)
|
||||
Function output/parameters: none
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: insertItemAtIndex, getListSize
|
||||
*/
|
||||
bool insertAfterCurrentIndex( IteratorType *iterator,
|
||||
const StateDataType toBeInserted )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: insertAtCurrentIndex
|
||||
Process: inserts value at currentIndex, if possible, returns true
|
||||
otherwise, returns false
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *),
|
||||
value to be inserted (const StateDataType)
|
||||
Function output/parameters: none
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: insertItemAtIndex
|
||||
*/
|
||||
bool insertAtCurrentIndex( IteratorType *iterator,
|
||||
const StateDataType toBeInserted )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Name: removeAtCurrentIndex
|
||||
Process: removes value at current index if possible, returns true,
|
||||
otherwise, sets return value to empty, returns false
|
||||
Function input/parameters: pointer to IteratorType (IteratorType *),
|
||||
value to be remove (StateDataType *)
|
||||
Function output/parameters: pointer to updated IteratorType (IteratorType *),
|
||||
pointer to item removed (StateDataType *)
|
||||
Function output/returned: Boolean result of operation
|
||||
Device input/---: none
|
||||
Device output/---: none
|
||||
Dependencies: removeItemAtIndex, getListSize
|
||||
*/
|
||||
bool removeAtCurrentIndex( IteratorType *iterator, StateDataType *removedItem )
|
||||
{
|
||||
// return false (TEMP)
|
||||
return false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue