OSB_LIB::FileCdrInput Class Reference

Collaboration diagram for OSB_LIB::FileCdrInput:

Collaboration graph
[legend]
List of all members.

Detailed Description

Support processing of file record streams.

Definition at line 63 of file filecdrinput.h.

Public Types

Public Member Functions

Public Attributes

Private Member Functions

Private Attributes


Member Enumeration Documentation

enum OSB_LIB::FileCdrInput::GetRet

Possible result from getCdr() and getLine().

Enumerator:
grOk  Success: got a CDR.
grEof  End of input file.
grErr  Error reading record.

Definition at line 66 of file filecdrinput.h.


Constructor & Destructor Documentation

OSB_LIB::FileCdrInput::FileCdrInput (  ) 

Empty default constructor.

OSB_LIB::FileCdrInput::FileCdrInput ( const FileCdrInput  )  [private]

Prevent copying: not implemented.


Member Function Documentation

OsbError OSB_LIB::FileCdrInput::closeFile ( bool  rename  ) 

Close and rename the input file.

Parameters:
rename Flag to rename the file to "<file>.org".
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

OsbError OSB_LIB::FileCdrInput::endStream (  ) 

Finalize the processing of the input stream.

Terminates the processing of the input stream after the changes have been stored by calling save() and the resulting database transactions are commited.

Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

GetRet OSB_LIB::FileCdrInput::getAsn1 ( Asn1Reader reader,
OsbError error 
)

Get an ASN.1 record from the input file.

Parameters:
reader ASN.1 reader to use: gets the data.
error Gets error in case of a read error or if the ASN.1 record is not a CDR.
Returns:
grOk if an ASN.1 was read from the input file.

GetRet OSB_LIB::FileCdrInput::getLine ( std::string &  dest,
OsbError error 
)

Get a line from the input file.

Parameters:
dest Gets the line.
error Gets error if the function returns grErr.
Returns:
grOk if a line was read from the input file.

bool OSB_LIB::FileCdrInput::getNextStream ( const OSB_DB::Session session,
const ModuleId  processor 
)

Get the next record stream to process.

Parameters:
session Database session to use.
The caller must commit (or rollback) the transactions!
processor Module that will process the record stream.
Returns:
true if there is an record stream to proces, false.

OsbError OSB_LIB::FileCdrInput::openFile ( const std::string &  baseDir  ) 

Open the input file.

Parameters:
baseDir Base directory of the CDR file.
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

FileCdrInput& OSB_LIB::FileCdrInput::operator= ( const FileCdrInput  )  [private]

Prevent assignment: not implemented.

bool OSB_LIB::FileCdrInput::restore ( OSB_DB::Session session  ) 

Restore to the original status.

Parameters:
session Database session (not used):
changes are commited.
Returns:
true in case of success, false if an error has occurred.
Before the function is called, all database transactions of saveStream() should be rolled-back.

Attention:
The function must not be called after endStream().
Call this function only after output streams are restored.
Restoring proceeds as much as possible:
The function does not throw unless there's a real emergency, instead appropriate errors are written to OSB_LIB::Log.

OsbError OSB_LIB::FileCdrInput::saveStream ( const OSB_DB::Session session  ) 

Save the processed stream.

Parameters:
session Database session to use.
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

bool OSB_LIB::FileCdrInput::setFailed ( const OSB_DB::Session session  ) 

Mark the input record stream as failed.

Parameters:
session Database session to use.
Returns:
true in case of success, false if the update in the database fails.


Member Data Documentation

CdrInputFile OSB_LIB::FileCdrInput::inFile_ [private]

The CDR input file.

Definition at line 208 of file filecdrinput.h.

std::string OSB_LIB::FileCdrInput::orgInputName_ [private]

The original name of the input file.

It is empty unless the file as been renamed.

Definition at line 214 of file filecdrinput.h.

RecordStreamInfo OSB_LIB::FileCdrInput::rsInfo_

The processed record stream.

Definition at line 205 of file filecdrinput.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:15:35 2006 for OSB Library by  doxygen 1.4.7