LLAvatarListDatum< T > Class Template Reference

Template class for a piece of data that must be retrieved. More...

#include <llfloateravatarlist.h>

Inheritance diagram for LLAvatarListDatum< T >:

Inheritance graph
[legend]
Collaboration diagram for LLAvatarListDatum< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLAvatarListDatum ()
BOOL retryNeeded ()
 Determines whether a data re-request is needed.
void requestStarted ()
 Notifies the object that a request was started.
BOOL requestIfNeeded ()
 retryNeeded and requestStarted combined
DATA_STATUS getStatus ()
 Returns the request status.
T & getValue ()
void setValue (T val)
void setRequestDelay (F32 delay)
void setMaxPending (U32 count)

Private Attributes

mValue
DATA_STATUS mStatus
F32 mRetryDelay
 How long to wait before trying to re-request the data.
F32 mFirstRequestTimeout
 How long to wait on the first attempt to get data.
F32 mMaxRequestTimeout
 Maximum delay between retries.
LLTimer mRequestTimer
 Timer for the current request.
F32 mRequestDelay
 Time between requests of the same type.
U32 mMaxPending
 Maximum amount of pending requests.

Static Private Attributes

static LLTimer mRequestDelayTimer
 Timer used to separate requests, to avoid flooding the server.
static U32 mPending = 0
 Amount of pending requests.

Friends

class LLFloaterAvatarList

Detailed Description

template<class T>
class LLAvatarListDatum< T >

Template class for a piece of data that must be retrieved.

This class handles the storage, retries and delays required to obtain a piece of data..

Definition at line 95 of file llfloateravatarlist.h.


Constructor & Destructor Documentation

template<class T>
LLAvatarListDatum< T >::LLAvatarListDatum (  )  [inline]

Definition at line 98 of file llfloateravatarlist.h.


Member Function Documentation

template<class T>
DATA_STATUS LLAvatarListDatum< T >::getStatus (  )  [inline]

Returns the request status.

Definition at line 200 of file llfloateravatarlist.h.

Referenced by LLFloaterAvatarList::getAvatarColor(), and LLFloaterAvatarList::refreshAvatarList().

template<class T>
T& LLAvatarListDatum< T >::getValue (  )  [inline]

Definition at line 214 of file llfloateravatarlist.h.

Referenced by LLFloaterAvatarList::getAvatarColor(), LLAvatarListEntry::getIsLinden(), LLFloaterAvatarList::refreshAvatarList(), and LLAvatarListEntry::setAccountCustomTitle().

template<class T>
BOOL LLAvatarListDatum< T >::requestIfNeeded (  )  [inline]

retryNeeded and requestStarted combined

Returns:
TRUE if a re-request is needed

Definition at line 186 of file llfloateravatarlist.h.

Referenced by LLFloaterAvatarList::refreshAvatarList().

template<class T>
void LLAvatarListDatum< T >::requestStarted (  )  [inline]

Notifies the object that a request was started.

Definition at line 155 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::requestIfNeeded().

template<class T>
BOOL LLAvatarListDatum< T >::retryNeeded (  )  [inline]

Determines whether a data re-request is needed.

Returns:
TRUE if a re-request is needed
This function takes the decision based on whether the data has been already retrieved, the last data request was long enough ago, and the request rate being low enough.

A FALSE return value doesn't mean that everything is OK, only that a retry shouldn't be made at this time.

Definition at line 124 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::requestIfNeeded().

template<class T>
void LLAvatarListDatum< T >::setMaxPending ( U32  count  )  [inline]

Definition at line 235 of file llfloateravatarlist.h.

Referenced by LLAvatarListEntry::LLAvatarListEntry().

template<class T>
void LLAvatarListDatum< T >::setRequestDelay ( F32  delay  )  [inline]

Definition at line 230 of file llfloateravatarlist.h.

Referenced by LLAvatarListEntry::LLAvatarListEntry().

template<class T>
void LLAvatarListDatum< T >::setValue ( val  )  [inline]

Definition at line 219 of file llfloateravatarlist.h.

Referenced by LLFloaterAvatarList::processAvatarPropertiesReply(), and LLFloaterAvatarList::processTrustNetReply().


Friends And Related Function Documentation

template<class T>
friend class LLFloaterAvatarList [friend]

Definition at line 240 of file llfloateravatarlist.h.


Member Data Documentation

template<class T>
F32 LLAvatarListDatum< T >::mFirstRequestTimeout [private]

How long to wait on the first attempt to get data.

Definition at line 254 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), and LLAvatarListDatum< LLAvatarInfo >::requestStarted().

template<class T>
U32 LLAvatarListDatum< T >::mMaxPending [private]

Maximum amount of pending requests.

Definition at line 289 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::retryNeeded(), and LLAvatarListDatum< LLAvatarInfo >::setMaxPending().

template<class T>
F32 LLAvatarListDatum< T >::mMaxRequestTimeout [private]

Maximum delay between retries.

On failure, timeout gets doubled until it reaches this value

Definition at line 261 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), and LLAvatarListDatum< LLAvatarInfo >::requestStarted().

template<class T>
U32 LLAvatarListDatum< T >::mPending = 0 [static, private]

Amount of pending requests.

Definition at line 278 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::getStatus(), LLAvatarListDatum< LLAvatarInfo >::requestStarted(), LLAvatarListDatum< LLAvatarInfo >::retryNeeded(), and LLAvatarListDatum< LLAvatarInfo >::setValue().

template<class T>
F32 LLAvatarListDatum< T >::mRequestDelay [private]

Time between requests of the same type.

Definition at line 284 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::retryNeeded(), and LLAvatarListDatum< LLAvatarInfo >::setRequestDelay().

template<class T>
LLTimer LLAvatarListDatum< T >::mRequestDelayTimer [static, private]

Timer used to separate requests, to avoid flooding the server.

Definition at line 273 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::requestStarted(), and LLAvatarListDatum< LLAvatarInfo >::retryNeeded().

template<class T>
LLTimer LLAvatarListDatum< T >::mRequestTimer [private]

Timer for the current request.

Definition at line 266 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::getStatus(), LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::requestStarted(), and LLAvatarListDatum< LLAvatarInfo >::retryNeeded().

template<class T>
F32 LLAvatarListDatum< T >::mRetryDelay [private]

How long to wait before trying to re-request the data.

Definition at line 249 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::getStatus(), LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::requestStarted(), and LLAvatarListDatum< LLAvatarInfo >::retryNeeded().

template<class T>
DATA_STATUS LLAvatarListDatum< T >::mStatus [private]

Definition at line 243 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::getStatus(), LLAvatarListDatum< LLAvatarInfo >::LLAvatarListDatum(), LLAvatarListDatum< LLAvatarInfo >::requestStarted(), LLAvatarListDatum< LLAvatarInfo >::retryNeeded(), and LLAvatarListDatum< LLAvatarInfo >::setValue().

template<class T>
T LLAvatarListDatum< T >::mValue [private]

Definition at line 241 of file llfloateravatarlist.h.

Referenced by LLAvatarListDatum< LLAvatarInfo >::getValue(), and LLAvatarListDatum< LLAvatarInfo >::setValue().


The documentation for this class was generated from the following file:
Generated on Thu Jul 1 06:11:11 2010 for Second Life Viewer by  doxygen 1.4.7