Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

DynArrayB class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

DynArrayB Class Reference

Another wrapper class for dynamic arrays. More...

#include <ODYNARRB.H>

Inheritance diagram for DynArrayB:

DynArray CourseArray DepartmentArray FacultyArray FirmArray MAOPArray SpriteArray StudentArray List of all members.

Public Methods

 DynArrayB (int, int=DEF_DYNARRAY_BLOCK_SIZE, int reuseIntervalDays=0)
 ~DynArrayB ()
int packed_size ()
int packed_recno (int)
void linkin (void *)
void linkout (int=-1)
void zap ()
int write_file (File *)
int read_file (File *)
int write_empty_room (File *)
int read_empty_room (File *)
int write_ptr_array (File *, int)
int read_ptr_array (File *, int, CreateEleFP)

Public Attributes

EmptyRoomempty_room_array
short empty_room_num
short empty_room_count
short reuse_interval_days

Detailed Description

Another wrapper class for dynamic arrays.

Definition at line 30 of file ODYNARRB.H.


Constructor & Destructor Documentation

DynArrayB::DynArrayB int   ,
int    = DEF_DYNARRAY_BLOCK_SIZE,
int    reuseIntervalDays = 0
 

Definition at line 30 of file ODYNARRB.CPP.

References empty_room_array, empty_room_count, empty_room_num, NULL, and reuse_interval_days.

DynArrayB::~DynArrayB  
 

Definition at line 42 of file ODYNARRB.CPP.

References empty_room_array, and mem_del.


Member Function Documentation

void DynArrayB::linkin void *   
 

Reimplemented from DynArray.

Definition at line 64 of file ODYNARRB.CPP.

References DynArray::block_num, DynArray::body_buf, DynArray::cur_pos, EmptyRoom::deleted_game_date, DynArray::ele_num, DynArray::ele_size, empty_room_array, empty_room_count, DynArray::last_ele, NULL, EmptyRoom::recno, DynArray::resize(), and reuse_interval_days.

Referenced by StudentArray::add(), SpriteArray::add(), FacultyArray::add(), DepartmentArray::add(), and CourseArray::add().

void DynArrayB::linkout int    = -1
 

Reimplemented from DynArray.

Definition at line 120 of file ODYNARRB.CPP.

References DynArray::body_buf, DynArray::cur_pos, DynArray::ele_size, EMPTY_ROOM_ALLOC_STEP, empty_room_array, empty_room_count, empty_room_num, DynArray::last_ele, and mem_resize.

Referenced by StudentArray::del(), SpriteArray::del(), DepartmentArray::del(), CourseArray::del(), FirmArray::del_firm(), DepartmentArray::read_file(), and read_ptr_array().

int DynArrayB::packed_recno int    recNo
 

Given the recno unpacked, it returns the recno packed.

packed_recno() is the recno when the array is packed (deleted record are actually removed)

<int> recNo = given the recno unpacked

return : <int> the recno when packed

Definition at line 287 of file ODYNARRB.CPP.

int DynArrayB::packed_size   [inline]
 

Definition at line 44 of file ODYNARRB.H.

References empty_room_count, and DynArray::size().

Referenced by StudentArray::read_file(), and DepartmentArray::read_file().

int DynArrayB::read_empty_room File   filePtr
 

Read a saved dynamic array from file, it must be saved with write_file()

<File*> readFile = the pointer to the writing file

Return : 1 - read successfully 0 - writing error

Definition at line 247 of file ODYNARRB.CPP.

Referenced by DepartmentArray::read_file(), and read_ptr_array().

int DynArrayB::read_file File   filePtr
 

Read a saved dynamic array from file, it must be saved with write_file()

<File*> readFile = the pointer to the writing file

Return : 1 - read successfully 0 - writing error

Reimplemented from DynArray.

Reimplemented in CourseArray, DepartmentArray, FacultyArray, FirmArray, and StudentArray.

Definition at line 183 of file ODYNARRB.CPP.

Referenced by CourseArray::read_file(), FacultyArray::read_file(), and StudentArray::read_file().

int DynArrayB::read_ptr_array File  ,
int   ,
CreateEleFP   
 

Definition at line 359 of file ODYNARRB.CPP.

References DynArray::add_blank(), CreateEleFP, File::file_get_short(), File::file_read(), DynArray::get_ptr(), DynArray::go(), linkout(), NULL, read_empty_room(), and DynArray::size().

int DynArrayB::write_empty_room File   filePtr
 

Write current dynamic array into file, read_file() can be used to retrieve it.

<File*> writeFile = the pointer to the writing file

Return : 1 - write successfully 0 - writing error

Definition at line 221 of file ODYNARRB.CPP.

Referenced by write_ptr_array().

int DynArrayB::write_file File   filePtr
 

Write current dynamic array into file, read_file() can be used to retrieve it.

<File*> writeFile = the pointer to the writing file

Return : 1 - write successfully 0 - writing error

Reimplemented from DynArray.

Reimplemented in CourseArray, DepartmentArray, FacultyArray, FirmArray, and StudentArray.

Definition at line 154 of file ODYNARRB.CPP.

int DynArrayB::write_ptr_array File  ,
int   
 

Definition at line 319 of file ODYNARRB.CPP.

References File::file_put_short(), File::file_write(), DynArray::get_ptr(), DynArray::size(), and write_empty_room().

void DynArrayB::zap  
 

Zap the whole dynamic array, clear all elements

Definition at line 304 of file ODYNARRB.CPP.


Member Data Documentation

EmptyRoom* DynArrayB::empty_room_array
 

Definition at line 32 of file ODYNARRB.H.

Referenced by DynArrayB(), linkin(), linkout(), and ~DynArrayB().

short DynArrayB::empty_room_count
 

Definition at line 34 of file ODYNARRB.H.

Referenced by DynArrayB(), linkin(), linkout(), and packed_size().

short DynArrayB::empty_room_num
 

Definition at line 33 of file ODYNARRB.H.

Referenced by DynArrayB(), and linkout().

short DynArrayB::reuse_interval_days
 

Definition at line 35 of file ODYNARRB.H.

Referenced by DynArrayB(), and linkin().


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:06 2002 for VirtualU by doxygen1.2.17