Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

jabberoo::PresenceDB Class Reference

Presence database. More...

#include <presenceDB.hh>

List of all members.

Public Member Functions

 PresenceDB (Session &s)
 Create a PresenceDB for a given Session.

void insert (const Presence &p)
 Insert a Presence Packet into the database.

void remove (const std::string &jid)
 Remove a Presence Packet from the database.

void clear ()
 Clear the database.

range equal_range (const std::string &jid) const
 This function will throw XCP_InvalidJID if the JID is not found.

const_iterator find (const std::string &jid) const
 Find Presence Packets from all JabberIDs which have the given user.

Presence findExact (const std::string &jid) const
 Find the Presence Packet for an exact user/resource JabberID.

bool contains (const std::string &jid) const
 Whether the PresenceDB contains a given user.

bool available (const std::string &jid) const
 Whether the default Presence for user is available.


Detailed Description

Presence database.

This class keeps track of and handles all Presence packets received. This class plus the Roster class are crucial for clients which want rosters.

See also:
Presence

Roster

Definition at line 54 of file presenceDB.hh.


Constructor & Destructor Documentation

jabberoo::PresenceDB::PresenceDB Session   s
 

Create a PresenceDB for a given Session.

This will begin keeping track of all Presence packets received in a given Session.

Parameters:
s The Session.
See also:
Session

Definition at line 60 of file jabberoo-presencedb.cpp.


Member Function Documentation

bool jabberoo::PresenceDB::available const std::string &    jid const
 

Whether the default Presence for user is available.

Definition at line 215 of file jabberoo-presencedb.cpp.

void jabberoo::PresenceDB::clear  
 

Clear the database.

Erases all entries.

Definition at line 227 of file jabberoo-presencedb.cpp.

Referenced by jabberoo::Session::onDocumentEnd().

bool jabberoo::PresenceDB::contains const std::string &    jid const
 

Whether the PresenceDB contains a given user.

Definition at line 210 of file jabberoo-presencedb.cpp.

PresenceDB::range jabberoo::PresenceDB::equal_range const std::string &    jid const
 

This function will throw XCP_InvalidJID if the JID is not found.

See also:
XCP_InvalidJID
Returns:
range

Definition at line 161 of file jabberoo-presencedb.cpp.

PresenceDB::const_iterator jabberoo::PresenceDB::find const std::string &    jid const
 

Find Presence Packets from all JabberIDs which have the given user.

This function will throw XCP_InvalidJID if the JID is not found.

Returns:
A const iterator of Presence Packets.

Definition at line 199 of file jabberoo-presencedb.cpp.

Presence jabberoo::PresenceDB::findExact const std::string &    jid const
 

Find the Presence Packet for an exact user/resource JabberID.

This function will throw XCP_InvalidJID if the JID is not found.

Returns:
A Presence Packet.

Definition at line 167 of file jabberoo-presencedb.cpp.

void jabberoo::PresenceDB::insert const Presence   p
 

Insert a Presence Packet into the database.

Parameters:
p The Presence Packet to insert.

Definition at line 79 of file jabberoo-presencedb.cpp.

References jabberoo::Packet::getFrom(), jabberoo::Presence::getPriority(), and jabberoo::Presence::getType().

void jabberoo::PresenceDB::remove const std::string &    jid
 

Remove a Presence Packet from the database.

Currently this does *not* handle multiple entries with different resources. This function will remove all Presence Packets which match the user.

Parameters:
jid The JabberID to remove.

Definition at line 138 of file jabberoo-presencedb.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 13:31:53 2003 for jabberoo by doxygen1.3-rc3