#include <GPIBEquipment.h>
Inheritance diagram for LibGPIB::GPIBEquipmentBuffer:
Public Methods | |
GPIBEquipmentBuffer (GPIBEquipment *device) | |
Construct a buffer and associate it with the specified GPIBEquipment. More... | |
Protected Methods | |
virtual streambuf* | setbuf (char_type *, streamsize) |
Performs an operation that is defined separately for each class derived from streambuf. More... | |
virtual int_type | overflow (int_type c) |
Writes the specified character to the associated GPIBEquipment if one. More... | |
virtual int_type | uflow () |
Reads and returns the next character from the associated GPIBEquipment if one otherwise returns traits::eof(). More... | |
virtual int_type | underflow () |
Reads and returns the next character from the associated GPIBEquipment if one otherwise returns traits::eof(). More... | |
virtual streamsize | xsgetn (char_type *s, streamsize n) |
Reads upto n characters from the GPIBEquipment and returns them through the character array located at s. More... | |
virtual streamsize | xsputn (const char_type* s, streamsize n) |
Writes upto n characters from tha character sequence at s to the GPIBEquipment associated with the buffer. More... | |
virtual int_type | pbackfail (int_type c = EOF) |
This function is called when a putback of a character fails. More... | |
Private Methods | |
char_type | GetChar () |
This routine reads and returns one character from the associated GPIBEquipment if one otherwise returns traits::eof(). | |
void | PutChar (const char_type c) |
This routine writes the specified character to the associated GPIBEquipment if one otherwise does nothing. | |
Private Attributes | |
GPIBEquipment* | mParentGPIBEquipment |
The GPIBEquipment associated with this streambuf. | |
char | mPutbackChar |
Each streambuf subclass is required to allow putback of at least one character. More... | |
bool | mPutbackAvailable |
This flag indicates that a character has been put back into the buffer. More... |
Communication with a GPIBEquipment usually involves sending a set of commands to the GPIBController associated with the GPIBEquipment followed by the data transmission to/from the GPIBEquipment and then another set of commands being sent to the GPIBController. This class takes care of these steps so that the GPIBEquipment class can behave just like a iostream while communicating with a given GPIBEquipment.
Definition at line 38 of file GPIBEquipment.h.
|
Construct a buffer and associate it with the specified GPIBEquipment.
It does not make sense to attach the same GPIBEquipmentBuffer to more than one GPIBEquipment; if this is attempted the output is undefined.
device | The GPIBEquipment which will be using this GPIBEquipmentBuffer for GPIB communication. |
Definition at line 163 of file GPIBEquipment.h.
|
This routine reads and returns one character from the associated GPIBEquipment if one otherwise returns traits::eof().
|
This routine writes the specified character to the associated GPIBEquipment if one otherwise does nothing.
|
Writes the specified character to the associated GPIBEquipment if one.
Definition at line 185 of file GPIBEquipment.h.
|
This function is called when a putback of a character fails.
This must be implemented for unbuffered I/O as all streambuf subclasses are required to provide putback of at lease on character.
Definition at line 205 of file GPIBEquipment.h.
|
Performs an operation that is defined separately for each class derived from streambuf.
The default behavior is to do nothing if gptr() is non-null and gptr()!=egptr(). Also, setbuf(0, 0) usually means unbuffered I/O and setbuf(p, n) means use p[0]...p[n-1] to hold the buffered characters. In general, this method implements the subclass's notion of getting memory for the buffered characters.
In the case of the GPIBEquipment it is not safe to read more than one character at a time and hence we do not allow buffered I/O. An attempt to call this routine to set the buffer will have no effect on the functionality of the class.
Definition at line 175 of file GPIBEquipment.h.
|
Reads and returns the next character from the associated GPIBEquipment if one otherwise returns traits::eof().
This method is used for unbuffered I/O while underflow() is called for buffer I/O.
Definition at line 198 of file GPIBEquipment.h.
|
Reads and returns the next character from the associated GPIBEquipment if one otherwise returns traits::eof().
This method is used for buffered I/O while uflow() is called for unbuffered I/O.
Definition at line 192 of file GPIBEquipment.h.
|
Reads upto n characters from the GPIBEquipment and returns them through the character array located at s.
|
Writes upto n characters from tha character sequence at s to the GPIBEquipment associated with the buffer.
|
|
This flag indicates that a character has been put back into the buffer.
The next attempt to read a character from the buffer will return mPutbackChar.
Definition at line 146 of file GPIBEquipment.h.
|
Each streambuf subclass is required to allow putback of at least one character.
This character contains this putback value.
Definition at line 139 of file GPIBEquipment.h.