Public Member Functions | Protected Member Functions

Barry::Connector Class Reference

Inheritance diagram for Barry::Connector:
Inheritance graph
[legend]
Collaboration diagram for Barry::Connector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool Connect ()
 Returns true if connected, false if user cancelled, throws Barry exception on error.
virtual void Disconnect ()
 Disconnects from the device.
virtual bool Reconnect (int total_tries=2)
 Returns same as Connect(), but normally remembers the password and so avoids prompting the user if possible.
virtual bool ReconnectForDirtyFlags ()
 Calls Reconnect() (and returns it's result) only if you have called RequireDirtyReconnect().
virtual bool IsConnected ()=0
 Returns true if connected, false if not.
virtual void RequireDirtyReconnect ()
 This function flags the Connector object so that a future call to ReconnectForDirtyFlags() will actually Reconnect().
virtual bool PasswordPrompt (const Barry::BadPassword &bp, std::string &password_result)=0
 App should prompt user for password, fill password_result with what he enters and then return true.

Protected Member Functions

virtual bool IsDisconnected ()=0
 slightly different than IsConnected()...

Detailed Description

Definition at line 41 of file connector.h.


Member Function Documentation

bool Barry::Connector::Connect (  )  [virtual]

Returns true if connected, false if user cancelled, throws Barry exception on error.

Note that in the case of a bad password, this will return false on the first password try, unless you override PasswordPrompt() below. In the default case, a false here means the password was invalid, and you should use GetBadPassword() to report the error.

Definition at line 98 of file connector.cc.

References Disconnect(), and PasswordPrompt().

Referenced by Reconnect().

Here is the call graph for this function:

Here is the caller graph for this function:

void Barry::Connector::Disconnect (  )  [virtual]

Disconnects from the device.

Definition at line 138 of file connector.cc.

References IsDisconnected().

Referenced by Connect(), and Reconnect().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool Barry::Connector::IsConnected (  )  [pure virtual]

Returns true if connected, false if not.

Implemented in Barry::DesktopConnector.

virtual bool Barry::Connector::IsDisconnected (  )  [protected, pure virtual]

slightly different than IsConnected()...

this returns true even if there is a partial connection in progress... i.e. this returns true if DoDisconnect() can be safely skipped

Implemented in Barry::DesktopConnector.

Referenced by Disconnect().

Here is the caller graph for this function:

virtual bool Barry::Connector::PasswordPrompt ( const Barry::BadPassword bp,
std::string &  password_result 
) [pure virtual]

App should prompt user for password, fill password_result with what he enters and then return true.

Return false if user wishes to stop trying.

This function is *not* called from inside a catch() routine, so it is safe to throw exceptions from it if you must.

Implemented in Barry::DesktopConnector.

Referenced by Connect().

Here is the caller graph for this function:

bool Barry::Connector::Reconnect ( int  total_tries = 2  )  [virtual]

Returns same as Connect(), but normally remembers the password and so avoids prompting the user if possible.

Password prompts are still possible though, if you have called ClearPassword().

It is valid to call Reconnect() without ever calling Connect(), since Reconnect() is simply a wrapper that handles retries.

Definition at line 147 of file connector.cc.

References Connect(), and Disconnect().

Referenced by ReconnectForDirtyFlags().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Barry::Connector::ReconnectForDirtyFlags (  )  [virtual]

Calls Reconnect() (and returns it's result) only if you have called RequireDirtyReconnect().

Otherwise, does nothing, but returns true.

Definition at line 189 of file connector.cc.

References Reconnect().

Here is the call graph for this function:

void Barry::Connector::RequireDirtyReconnect (  )  [virtual]

This function flags the Connector object so that a future call to ReconnectForDirtyFlags() will actually Reconnect().

This is needed in cases where you are updating the device, and require that the dirty flags on the device itself are properly cleared and updated. In this case, you must call ReconnectForDirtyFlags() before Desktop::GetRecordStateTable(). Disconnecting from the device, or reconnecting, clears the flag.

Definition at line 199 of file connector.cc.


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