IGSTK
Public Member Functions | Public Attributes | Protected Member Functions

igstk::Communication Class Reference

Class Communication is the base class for communication between the tracker class and the hardware tracking device. More...

#include <igstkCommunication.h>

Inheritance diagram for igstk::Communication:
Inheritance graph
[legend]
Collaboration diagram for igstk::Communication:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 igstkStandardClassTraitsMacro (Communication, Object) public
 Macro with standard traits declarations.
virtual ResultType OpenCommunication (void)
 The method OpenCommunication sets up communication as per the data provided.
virtual ResultType CloseCommunication (void)
 The method CloseCommunication closes the communication.
virtual void SetTimeoutPeriod (unsigned int _arg)
 The method SetTimeoutPeriod sets the amount of time, in milliseconds to wait on a reply from the device before generating a timeout event.
virtual unsigned int GetTimeoutPeriod ()
virtual void SetReadTerminationCharacter (char _arg)
 The method SetReadTerminationCharacter sets a special character that the device uses to mark the end of a reply (defaults to end-of-file character, ascii 255).
virtual char GetReadTerminationCharacter ()
virtual void SetUseReadTerminationCharacter (bool _arg)
 The method SetUseReadTerminationCharacter sets whether to use the termination character, or not use a termination character.
virtual bool GetUseReadTerminationCharacter ()
virtual ResultType Write (const char *data, unsigned int numberOfBytes)
 Write method sends the string via communication link.
virtual ResultType Read (char *data, unsigned int numberOfBytes, unsigned int &bytesRead)
 Read method receives string via communication link.

Public Attributes

 ResultType

Protected Member Functions

 Communication (void)
 Constructor is protected in order to enforce the use of the New() operator.
virtual ~Communication (void)
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print object information.

Detailed Description

Class Communication is the base class for communication between the tracker class and the hardware tracking device.

This communication may be established via serial port, parallel port, ethernet, or an offline communication (through a file or class emulating tracker response). Classes specific to each such communication would be derived from this base Communication class.

Definition at line 37 of file igstkCommunication.h.


Constructor & Destructor Documentation

igstk::Communication::Communication ( void  ) [protected]

Constructor is protected in order to enforce the use of the New() operator.

virtual igstk::Communication::~Communication ( void  ) [protected, virtual]

Member Function Documentation

igstk::Communication::igstkStandardClassTraitsMacro ( Communication  ,
Object   
) [inline]

Macro with standard traits declarations.

Definition at line 43 of file igstkCommunication.h.

virtual ResultType igstk::Communication::OpenCommunication ( void  ) [virtual]

The method OpenCommunication sets up communication as per the data provided.

Reimplemented in igstk::SerialCommunication.

virtual ResultType igstk::Communication::CloseCommunication ( void  ) [virtual]

The method CloseCommunication closes the communication.

Reimplemented in igstk::SerialCommunication.

virtual void igstk::Communication::SetTimeoutPeriod ( unsigned int  _arg) [virtual]

The method SetTimeoutPeriod sets the amount of time, in milliseconds to wait on a reply from the device before generating a timeout event.

The default will vary depending on the communication method that is used..

virtual unsigned int igstk::Communication::GetTimeoutPeriod ( ) [virtual]
virtual void igstk::Communication::SetReadTerminationCharacter ( char  _arg) [virtual]

The method SetReadTerminationCharacter sets a special character that the device uses to mark the end of a reply (defaults to end-of-file character, ascii 255).

virtual char igstk::Communication::GetReadTerminationCharacter ( ) [virtual]
virtual void igstk::Communication::SetUseReadTerminationCharacter ( bool  _arg) [virtual]

The method SetUseReadTerminationCharacter sets whether to use the termination character, or not use a termination character.

virtual bool igstk::Communication::GetUseReadTerminationCharacter ( ) [virtual]
virtual ResultType igstk::Communication::Write ( const char *  data,
unsigned int  numberOfBytes 
) [inline, virtual]

Write method sends the string via communication link.

Reimplemented in igstk::SerialCommunication.

Definition at line 80 of file igstkCommunication.h.

virtual ResultType igstk::Communication::Read ( char *  data,
unsigned int  numberOfBytes,
unsigned int &  bytesRead 
) [inline, virtual]

Read method receives string via communication link.

Reimplemented in igstk::SerialCommunication.

Definition at line 84 of file igstkCommunication.h.

virtual void igstk::Communication::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const [protected, virtual]

Member Data Documentation

Reimplemented in igstk::SerialCommunication, and igstk::SerialCommunicationSimulator.

Definition at line 52 of file igstkCommunication.h.


The documentation for this class was generated from the following file: