NLMISC::CBigFile::CThreadFileArray Class Reference


Public Member Functions

uint32 allocate ()
 CThreadFileArray ()
CHandleFileget (uint32 index)

Private Attributes

uint32 _CurrentId
CTDS _TDS

Constructor & Destructor Documentation

NLMISC::CBigFile::CThreadFileArray::CThreadFileArray  ) 
 

Definition at line 40 of file big_file.cpp.

References _CurrentId.

00041 {
00042         _CurrentId= 0;
00043 }


Member Function Documentation

uint32 NLMISC::CBigFile::CThreadFileArray::allocate  ) 
 

Definition at line 45 of file big_file.cpp.

References _CurrentId, and uint32.

Referenced by NLMISC::CBigFile::add().

00046 {
00047         return _CurrentId++;
00048 }

CBigFile::CHandleFile & NLMISC::CBigFile::CThreadFileArray::get uint32  index  ) 
 

Definition at line 50 of file big_file.cpp.

References _TDS, NLMISC::CTDS::getPointer(), index, NLMISC::CTDS::setPointer(), and uint32.

Referenced by NLMISC::CBigFile::add(), NLMISC::CBigFile::getFile(), and NLMISC::CBigFile::remove().

00051 {
00052         // If the thread struct ptr is NULL, must allocate it.
00053         vector<CHandleFile>             *ptr= (vector<CHandleFile>*)_TDS.getPointer();
00054         if(ptr==NULL)
00055         {
00056                 ptr= new vector<CHandleFile>;
00057                 _TDS.setPointer(ptr);
00058         }
00059 
00060         // if the vector is not allocated, allocate it (empty entries filled with NULL => not opened FILE* in this thread)
00061         if(index>=ptr->size())
00062         {
00063                 ptr->resize(index+1);
00064         }
00065 
00066         return (*ptr)[index];
00067 }


Field Documentation

uint32 NLMISC::CBigFile::CThreadFileArray::_CurrentId [private]
 

Definition at line 106 of file big_file.h.

Referenced by allocate(), and CThreadFileArray().

CTDS NLMISC::CBigFile::CThreadFileArray::_TDS [private]
 

Definition at line 104 of file big_file.h.

Referenced by get().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 13:02:24 2004 for NeL by doxygen 1.3.6