Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_Quorum::RemoteServerReturn Class Reference

Return values from server communications. More...

#include <RemoteServer.h>

List of all members.

Public Types

enum  ReturnCode { kSuccess, kFailure, kNumReturnCodes }
enum  ErrorCode { kNone, kTimeout, kNumErrorCodes }

Public Member Functions

 RemoteServerReturn ()
 The default constructor creates a new RemoteServerReturn object with a ReturnCode::kFailure and ErrorCode::kNone, indicating no successful response but no errors (ie, response pending), and a creation time.
 RemoteServerReturn (const RemoteServerReturn &sr)
 Copy constructor.
ReturnCode returnCode () const
 Success or failure of the connection attempt.
ErrorCode errorCode () const
 Whether or not there was an error.
timeval elapsed () const
 Calculate the time elapsed between creation and the last-recorded time.
void setReturnCode (ReturnCode ret)
 Set whether the connection was successful or not.
void setErrorCode (ErrorCode err)
 Set whether there was an error.
void updateTime (const struct timeval &t)
 Set the last-recorded time to the specified time.
void reset ()
 Reset the RemoteServer return to its default state.


Detailed Description

Return values from server communications.

This is designed to be updated in successive invocations.

Definition at line 42 of file RemoteServer.h.


Member Enumeration Documentation

enum CODEX_Quorum::RemoteServerReturn::ErrorCode
 

Enumeration values:
kNone  No errors were detected, though communications may not have been successful yet.
kTimeout  Communications with the server timed out.

Definition at line 52 of file RemoteServer.h.

enum CODEX_Quorum::RemoteServerReturn::ReturnCode
 

Enumeration values:
kSuccess  Communications were successful.
kFailure  Communications were unsuccessful.

Definition at line 45 of file RemoteServer.h.


Constructor & Destructor Documentation

CODEX_Quorum::RemoteServerReturn::RemoteServerReturn  )  [inline]
 

The default constructor creates a new RemoteServerReturn object with a ReturnCode::kFailure and ErrorCode::kNone, indicating no successful response but no errors (ie, response pending), and a creation time.

Bug:
Probably not handling error from of gettimeofday optimally.

Definition at line 67 of file RemoteServer.h.

References kFailure, and kNone.


Member Function Documentation

struct timeval CODEX_Quorum::RemoteServerReturn::elapsed  )  const [inline]
 

Calculate the time elapsed between creation and the last-recorded time.

Returns:
elapsed time as a timeval structure

Definition at line 102 of file RemoteServer.h.

void CODEX_Quorum::RemoteServerReturn::reset  )  [inline]
 

Reset the RemoteServer return to its default state.

The return code and error state are set back to their default values. The creation time and last-recorded time are set to the current time unless gettimeofday(2) fails, in which case they are both set to 0.

Definition at line 135 of file RemoteServer.h.

References kFailure, and kNone.

Referenced by CODEX_Client::Client::contactServer().


The documentation for this class was generated from the following file:
Generated on Fri May 6 17:42:30 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1