IGSTK
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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]

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 *, unsigned int)
 Write method sends the string via communication link.
virtual ResultType Read (char *, unsigned int, unsigned int &)
 Read method receives string via communication link.
- Public Member Functions inherited from igstk::Object
virtual const char * GetNameOfClass () const
void SetLogger (LoggerType *logger)
 Connect the Logger for this class.
void RemoveObserver (unsigned long tag) const

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.
- Protected Member Functions inherited from igstk::Object
LoggerTypeGetLogger () const
 Object (void)
 Constructor is protected in order to enforce the use of the New() operator.
virtual ~Object (void)
void RegisterObservedObject (const ::igstk::Object *object, unsigned long tag)
 Register observed objects in an internal array so that they can be disconnected upon destruction.
void RemoveFromObservedObjects ()
 Remove observers that this object may have connected to other objects.

Additional Inherited Members

- Public Types inherited from igstk::Object
typedef Object Self
 General Typedefs.
typedef ::itk::Object Superclass
typedef ::itk::SmartPointer< SelfPointer
typedef ::itk::SmartPointer
< const Self
ConstPointer
typedef igstk::Logger LoggerType
- Static Public Member Functions inherited from igstk::Object
static Pointer New (void)

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  )
protectedvirtual

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 *  ,
unsigned int   
)
inlinevirtual

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 *  ,
unsigned int  ,
unsigned int &   
)
inlinevirtual

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
protectedvirtual

Member Data Documentation

igstk::Communication::ResultType

Definition at line 52 of file igstkCommunication.h.


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