MOOS 0.2375
Public Types | Public Member Functions | Public Attributes
CMOOSMemMappedTextFile< T > Class Template Reference

#include <MOOSMemoryMapped.h>

Inheritance diagram for CMOOSMemMappedTextFile< T >:
Inheritance graph
[legend]
Collaboration diagram for CMOOSMemMappedTextFile< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T LINE

Public Member Functions

 CMOOSMemMappedTextFile ()
bool Open (const std::string &sName, int nMaxLines=-1)
int GetLineCount ()
bool BuildLineIndex (int nNumLines=-1)
std::string GetLine (int nLine)

Public Attributes

std::vector< LINEm_LineIndex
int m_nLineCount

Detailed Description

template<class T = TextLineInfo>
class CMOOSMemMappedTextFile< T >

Specialised memory mapped file class to handle text files.

Default template parameter is type TextLineInfo. Other template types must support the following functions: T::T(char * pStart, char * pEnd) //constructor char * T.Start(); //return start of line char * T.End(); //return end of line bool IsWanted(); //return true if this line is wanted

Main functionality of this class is to produce a index of lines each entry pointing to a instance of "T"

Definition at line 259 of file MOOSMemoryMapped.h.


Member Typedef Documentation

template<class T = TextLineInfo>
typedef T CMOOSMemMappedTextFile< T >::LINE

we will refer to T as type LINE

Definition at line 266 of file MOOSMemoryMapped.h.


Constructor & Destructor Documentation

template<class T = TextLineInfo>
CMOOSMemMappedTextFile< T >::CMOOSMemMappedTextFile ( ) [inline]

constructor counts lines and buld line index

Definition at line 269 of file MOOSMemoryMapped.h.


Member Function Documentation

template<class T = TextLineInfo>
bool CMOOSMemMappedTextFile< T >::BuildLineIndex ( int  nNumLines = -1) [inline]

iterate through the file building the line index

Definition at line 318 of file MOOSMemoryMapped.h.

template<class T = TextLineInfo>
std::string CMOOSMemMappedTextFile< T >::GetLine ( int  nLine) [inline]

return the specified line as a string

Definition at line 358 of file MOOSMemoryMapped.h.

template<class T = TextLineInfo>
int CMOOSMemMappedTextFile< T >::GetLineCount ( ) [inline]

simply returns size of file in lines looking for

Definition at line 287 of file MOOSMemoryMapped.h.

template<class T = TextLineInfo>
bool CMOOSMemMappedTextFile< T >::Open ( const std::string &  sName,
int  nMaxLines = -1 
) [inline]

Definition at line 271 of file MOOSMemoryMapped.h.


Member Data Documentation

template<class T = TextLineInfo>
std::vector< LINE > CMOOSMemMappedTextFile< T >::m_LineIndex

a vector of LINES (templated type).

Definition at line 371 of file MOOSMemoryMapped.h.

template<class T = TextLineInfo>
int CMOOSMemMappedTextFile< T >::m_nLineCount

how many lines we have

Definition at line 374 of file MOOSMemoryMapped.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines