Interface Class Reference

Interface class for a configuration file. More...

#include <interface.h>

Inheritance diagram for Interface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~Interface ()
 Destroy the interface.
virtual void open (const MOCKPP_STL::string &name)=0
 Opens the file.
virtual MOCKPP_STL::string read ()=0
 Reads one record from the file.
virtual void write (const MOCKPP_STL::string &s)=0
 Writes a record to the file.
virtual unsigned calculate (unsigned input)=0
 Does some calculating.
virtual void close ()=0
 Closes the file.

Detailed Description

Interface class for a configuration file.

Each record consists of one line of ascii characters. Each file contains exactly three lines. Processed lines are written back with "/processed" appended.

Definition at line 41 of file interface.h.


Constructor & Destructor Documentation

virtual Interface::~Interface (  )  [inline, virtual]

Destroy the interface.

Definition at line 47 of file interface.h.


Member Function Documentation

virtual unsigned Interface::calculate ( unsigned  input  )  [pure virtual]

Does some calculating.

Parameters:
input ingoing data
Returns:
outgoing result

Implemented in BasicMock, ChainMock, PoorMockSecondEdition, PoorMock, and VisitMock.

Referenced by Consumer::process().

virtual void Interface::close (  )  [pure virtual]

Closes the file.

Implemented in BasicMock, ChainMock, PoorMockSecondEdition, PoorMock, and VisitMock.

Referenced by Consumer::load(), and Consumer::save().

virtual void Interface::open ( const MOCKPP_STL::string &  name  )  [pure virtual]

Opens the file.

Parameters:
name name of file to open

Implemented in BasicMock, ChainMock, PoorMockSecondEdition, PoorMock, and VisitMock.

Referenced by Consumer::load(), and Consumer::save().

virtual MOCKPP_STL::string Interface::read (  )  [pure virtual]

Reads one record from the file.

Returns:
the record (one complete line)

Implemented in BasicMock, ChainMock, PoorMockSecondEdition, PoorMock, and VisitMock.

Referenced by Consumer::load().

virtual void Interface::write ( const MOCKPP_STL::string &  s  )  [pure virtual]

Writes a record to the file.

Parameters:
s the record (one complete line)

Implemented in BasicMock, ChainMock, PoorMockSecondEdition, PoorMock, and VisitMock.

Referenced by Consumer::save().


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

Generated on Tue Jan 5 18:03:33 2010 for mockpp-tutorial by  doxygen 1.6.1