Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members  

RemoteRoster Class Reference

Roughly corresponds to a BRoster of a remote host. More...

List of all members.

Public Methods

 RemoteRoster (const BNetAddress* address = NULL)
 Constructs a RemoteRoster referring to a host associated with the supplied address. More...

 RemoteRoster (const char* host)
 Constructs a RemoteRoster referring to a host associated with the supplied host name. More...

 ~RemoteRoster ()
 Frees all resources associate with the object. More...

status_t SetTo (const BNetAddress* address)
 Initializes a RemoteRoster to referring to a host associated with the supplied address. More...

status_t SetTo (const char* host)
 Initializes a RemoteRoster to referring to a host associated with the supplied host name. More...

void Unset ()
 Uninitializes the object. More...

status_t InitCheck () const
 Returns the status of the last initialization. More...

status_t GetAppList (BList* teams) const
 Returns a list of the applications running on the remote host. More...

status_t GetAppList (const char* signature, BList* teams) const
 Returns a list of the applications running on the remote host that have the given signature. More...

team_id TeamFor (const char* signature) const
 Returns the team_id of the application running on the remote host that has the given signature. More...

status_t GetRunningAppInfo (const char* signature, app_info* info) const
 Returns an info of the application running on the remote host that has the given signature. More...

status_t GetRunningAppInfo (team_id team, app_info* info) const
 Returns an info of the application running on the remote host that has the given team_id. More...

status_t GetActiveAppInfo (app_info* info) const
 Returns an info of the application active on the remote host. More...

status_t GetMessenger (const char* signature, BMessenger* messenger, bool byName = false) const
 Returns a messenger for the application running on the remote host that has the given signature. More...

status_t GetMessenger (team_id team, BMessenger* messenger) const
 Returns a messenger for the application running on the remote host that has the given team_id. More...


Private Attributes

status_t fInitStatus
BNetAddress* fAddress
RemoteRosterImpl* fImpl


Detailed Description

Roughly corresponds to a BRoster of a remote host.

Only a subset of the BRoster functionality is implemented, though. Namely, most of the methods for querying running application. Additionally the GetMessenger() methods retrieve BMessengers referring to remote applications.

Definition at line 42 of file RemoteRoster.h.


Constructor & Destructor Documentation

_EXPORT RemoteRoster::RemoteRoster ( const BNetAddress * address = NULL )
 

Constructs a RemoteRoster referring to a host associated with the supplied address.

After construction InitCheck() shall be invoked to check whether the roster could be initialized properly.

Parameters:
address   the address of the host. May be NULL in which case the roster will be uninitialized.

Definition at line 61 of file RemoteRoster.cpp.

_EXPORT RemoteRoster::RemoteRoster ( const char * host )
 

Constructs a RemoteRoster referring to a host associated with the supplied host name.

After construction InitCheck() shall be invoked to check whether the roster could be initialized properly.

Parameters:
host   a string identifying the host (name or IP string). May be NULL in which case the roster will be uninitialized.

Definition at line 81 of file RemoteRoster.cpp.

_EXPORT RemoteRoster::~RemoteRoster ( )
 

Frees all resources associate with the object.

Definition at line 94 of file RemoteRoster.cpp.


Member Function Documentation

_EXPORT status_t RemoteRoster::GetActiveAppInfo ( app_info * info ) const
 

Returns an info of the application active on the remote host.

Corresponds to BRoster::GetActiveAppInfo(app_info*).

Parameters:
info   pointer to an app_info which shall be filled with the info for the active application.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 351 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetAppList ( const char * signature,
BList * teams ) const
 

Returns a list of the applications running on the remote host that have the given signature.

Corresponds to BRoster::GetAppList(const char*, BList*). The returned team_ids are, of course, not valid on this machine. They can be used as parameter for GetRunningAppInfo() or GetMessenger() though.

Parameters:
teams   BList to which the team_ids of the applications running on the remote machine shall be added.
signature   signature of the apps whose team_ids shall be returned. May be NULL, in which case the team_ids of all running applications are returned.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 257 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetAppList ( BList * teams ) const
 

Returns a list of the applications running on the remote host.

Corresponds to BRoster::GetAppList(BList*). The returned team_ids are, of course, not valid on this machine. They can be used as parameter for GetRunningAppInfo() or GetMessenger() though.

Parameters:
teams   BList to which the team_ids of the applications running on the remote machine shall be added.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 233 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetMessenger ( team_id team,
BMessenger * messenger ) const
 

Returns a messenger for the application running on the remote host that has the given team_id.

Parameters:
team   the team_id identifying the application for which to return a BMessenger.
messenger   pointer to the BMessenger to be initialized to refer to the remote application.
Returns:
  • B_OK: Everything went fine.
  • B_BAD_TEAM_ID: The given team_id does not refer to an existing team.
  • anther error code otherwise.

Definition at line 397 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetMessenger ( const char * signature,
BMessenger * messenger,
bool byName = false ) const
 

Returns a messenger for the application running on the remote host that has the given signature.

If no application with the given signature could be found and byName is true, signature will be interpreted as a file name and a messenger for the first running application with that file name will be returned.

Parameters:
signature   signature of the app for which to return a messenger.
messenger   pointer to the BMessenger to be initialized to refer to the remote application.
byName   if true, and signature is not a signature of a running application signature will be interpreted as a file name.
Returns:
  • B_OK: Everything went fine.
  • anther error code otherwise.

Definition at line 375 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetRunningAppInfo ( team_id team,
app_info * info ) const
 

Returns an info of the application running on the remote host that has the given team_id.

Corresponds to BRoster::GetRunningAppInfo(team_id, app_info*).

Parameters:
signature   signature of the app whose info shall be returned.
info   pointer to an app_info which shall be filled with the info for the specified application.
Returns:
  • B_OK: Everything went fine.
  • B_BAD_TEAM_ID: The given team_id does not refer to an existing team.
  • another error code otherwise.

Definition at line 331 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::GetRunningAppInfo ( const char * signature,
app_info * info ) const
 

Returns an info of the application running on the remote host that has the given signature.

If there are more than one running applications with the given signature, it is undefined whose info will be returned.

The method is equivalent to

GetRunningAppInfo(TeamFor(signature), info)
.
Parameters:
signature   signature of the app whose info shall be returned.
info   pointer to an app_info which shall be filled with the info for the specified application.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 308 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::InitCheck ( ) const
 

Returns the status of the last initialization.

Returns:
  • B_OK: The object is properly initialized.
  • B_NO_INIT: The object is not initialized.
  • another error code.

Definition at line 213 of file RemoteRoster.cpp.

Referenced by GetActiveAppInfo(), GetAppList(), GetMessenger(), GetRunningAppInfo(), and TeamFor().

_EXPORT status_t RemoteRoster::SetTo ( const char * host )
 

Initializes a RemoteRoster to referring to a host associated with the supplied host name.

Parameters:
host   a string identifying the host (name or IP string).
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 178 of file RemoteRoster.cpp.

_EXPORT status_t RemoteRoster::SetTo ( const BNetAddress * address )
 

Initializes a RemoteRoster to referring to a host associated with the supplied address.

Parameters:
address   the address of the host.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 110 of file RemoteRoster.cpp.

Referenced by SetTo().

_EXPORT team_id RemoteRoster::TeamFor ( const char * signature ) const
 

Returns the team_id of the application running on the remote host that has the given signature.

Corresponds to BRoster::TeamFor(const char*). The returned team_id is, of course, not valid on this machine. It can be used as parameter for GetRunningAppInfo() or GetMessenger() though.

If there are more than one running applications with the given signature, it is undefined whose team_id will be returned.

Parameters:
signature   signature of the app whose team_id shall be returned.
Returns:
  • B_OK: Everything went fine.
  • another error code otherwise.

Definition at line 282 of file RemoteRoster.cpp.

_EXPORT void RemoteRoster::Unset ( )
 

Uninitializes the object.

Definition at line 194 of file RemoteRoster.cpp.

Referenced by SetTo(), and ~RemoteRoster().


Member Data Documentation

BNetAddress * RemoteRoster::fAddress [private]
 

Definition at line 71 of file RemoteRoster.h.

RemoteRosterImpl * RemoteRoster::fImpl [private]
 

Definition at line 72 of file RemoteRoster.h.

status_t RemoteRoster::fInitStatus [private]
 

Definition at line 70 of file RemoteRoster.h.


The documentation for this class was generated from the following files:
Generated at Mon Mar 22 02:35:22 2004 for RMessage by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000