class ClientAccountList

# class ClientAccountList | A client account list. More...
Full name | `TelEngine::ClientAccountList`
Definition | `#include <yatecbase.h>`
Inherits | TelEngine::Mutex [public ], TelEngine::String [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline explicit ClientAccountList (const char* name, ClientAccount* localContacts = 0)
- ~ClientAccountList ()
- inline ObjList& accounts ()
- inline ClientAccount* localContacts () const
- bool isLocalContact (ClientContact* c) const
- inline bool isLocalContact (const String& id) const
- virtual ClientAccount* findAccount (const String& id, bool ref = false)
- virtual ClientContact* findContactByUri (const String& account, const String& uri, bool ref = false)
- virtual ClientContact* findContact (const String& account, const String& id, bool ref = false)
- virtual ClientContact* findContact (const String& builtId, bool ref = false)
- virtual ClientContact* findContactByInstance (const String& id, String* instance = 0, bool ref = false)
- virtual MucRoom* findRoom (const String& id, bool ref = false)
- virtual MucRoom* findRoomByMember (const String& id, bool ref = false)
- virtual ClientContact* findAnyContact (const String& id, bool ref = false)
- virtual ClientAccount* findSingleRegAccount (const String* skipProto = 0, bool ref = false)
- virtual bool appendAccount (ClientAccount* account)
- virtual void removeAccount (const String& id)

#### Protected Members

- ObjList m_accounts

## Detailed Description

This class holds an account list

inline explicit ClientAccountList (const char* name, ClientAccount* localContacts = 0) | ### ClientAccountList

Constructor

Parameters:

name | List's name used for debug purposes
localContacts | Optional account owning locally stored contacts

~ClientAccountList () | ### ~ClientAccountList

Destructor

inline ObjList& accounts () | ### accounts

Get the accounts list

Returns: The accounts list

inline ClientAccount* localContacts () | ### localContacts

[const]

Retrieve the account owning locally stored contacts

Returns: ClientAccount pointer or 0

bool isLocalContact (ClientContact* c) | ### isLocalContact

[const]

Check if a contact is locally stored

Parameters:

c | The contact to check

Returns: True if the contact owner is the account owning locally stored contacts

inline bool isLocalContact (const String& id) | ### isLocalContact

[const]

Check if a contact is locally stored

Parameters:

id | Contact id to check

Returns: True if the contact owner is the account owning locally stored contacts

ClientAccount* findAccount (const String& id, bool ref = false) | ### findAccount

[virtual]

Find an account

Parameters:

id | The account's id
ref | True to get a referenced pointer

Returns: ClientAccount pointer or 0 if not found

ClientContact* findContactByUri (const String& account, const String& uri, bool ref = false) | ### findContactByUri

[virtual]

Find an account's contact by its URI (build an id from account and uri)

Parameters:

account | The account's id
uri | The contact's uri
ref | True to get a referenced pointer

Returns: ClientContact pointer or 0 if not found

ClientContact* findContact (const String& account, const String& id, bool ref = false) | ### findContact

[virtual]

Find an account's contact

Parameters:

account | The account's id
id | The contact's id
ref | True to get a referenced pointer

Returns: ClientContact pointer or 0 if not found

ClientContact* findContact (const String& builtId, bool ref = false) | ### findContact

[virtual]

Find an account's contact from a built id

Parameters:

builtId | The string containign the account and the contact
ref | True to get a referenced pointer

Returns: ClientContact pointer or 0 if not found

ClientContact* findContactByInstance (const String& id, String* instance = 0, bool ref = false) | ### findContactByInstance

[virtual]

Find a contact an instance id

Parameters:

id | The id
instance | Optional pointer to String to be filled with instance id
ref | True to get a referenced pointer

Returns: ClientContact pointer or 0 if not found

MucRoom* findRoom (const String& id, bool ref = false) | ### findRoom

[virtual]

Find a MUC room by its id

Parameters:

id | Room id
ref | True to obtain a referenced pointer

Returns: MucRoom pointer or 0 if not found

MucRoom* findRoomByMember (const String& id, bool ref = false) | ### findRoomByMember

[virtual]

Find a MUC room by member id

Parameters:

id | Room member id
ref | True to obtain a referenced pointer

Returns: MucRoom pointer or 0 if not found

ClientContact* findAnyContact (const String& id, bool ref = false) | ### findAnyContact

[virtual]

Find any contact (regular or MUC room) by its id

Parameters:

id | The id of the desired contact
ref | True to obtain a referenced pointer

Returns: ClientContact pointer (may be account's own contact) or 0 if not found

ClientAccount* findSingleRegAccount (const String* skipProto = 0, bool ref = false) | ### findSingleRegAccount

[virtual]

Check if there is a single registered account and return it

Parameters:

skipProto | Optional account protocol to skip
ref | True to get a referenced pointer

Returns: ClientAccount pointer or 0 if not found

bool appendAccount (ClientAccount* account) | ### appendAccount

[virtual]

Append a new account. The account's reference counter is increased before

Parameters:

account | The account to append

Returns: True on succes, false if an account with the same id already exists

void removeAccount (const String& id) | ### removeAccount

[virtual]

Remove an account

Parameters:

id | The account's id

ObjList m_accounts | ### m_accounts

[protected]

Generated by: paulc on bussard on Fri May 8 12:37:22 2015, using kdoc 2.0a54.