libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
Quotient::ThreadInfos Class Reference

A manager of thread information in a room. More...

#include <thread.h>

Inheritance diagram for Quotient::ThreadInfos:
Collaboration diagram for Quotient::ThreadInfos:

Public Types

using base_type = QHash< QString, ThreadInfo >
 
using const_iterator = base_type::const_iterator
 
using key_type = base_type::key_type
 
using mapped_type = base_type::mapped_type
 
using UpdateResult = std::pair< ThreadInfo, bool >
 

Public Member Functions

UpdateResult updateFrom (const TimelineItem &eventItem)
 Update thread state for an event that just arrived to the timeline.
 
base_type::const_iterator begin () const
 
base_type::const_iterator end () const
 
base_type::const_iterator find (const key_type &k) const
 
mapped_type operator[] (const key_type &k) const
 

Friends

class Room
 

Detailed Description

A manager of thread information in a room.

ThreadInfos encapsulates thread management logic, storing threads keyed by their root event id. Every time an event arrives to the timeline the room should send it to updateFrom() to update the relevant thread info if there's any thread involved. Otherwise this class behaves as a read-only QHash<QString, ThreadInfo>

See also
ThreadInfo

Definition at line 32 of file thread.h.

Member Typedef Documentation

◆ base_type

Definition at line 34 of file thread.h.

◆ const_iterator

using Quotient::ThreadInfos::const_iterator = base_type::const_iterator

Definition at line 35 of file thread.h.

◆ key_type

using Quotient::ThreadInfos::key_type = base_type::key_type

Definition at line 36 of file thread.h.

◆ mapped_type

using Quotient::ThreadInfos::mapped_type = base_type::mapped_type

Definition at line 37 of file thread.h.

◆ UpdateResult

Definition at line 39 of file thread.h.

Member Function Documentation

◆ begin()

base_type::const_iterator Quotient::ThreadInfos::begin ( ) const
inline

Definition at line 54 of file thread.h.

◆ end()

base_type::const_iterator Quotient::ThreadInfos::end ( ) const
inline

Definition at line 55 of file thread.h.

◆ find()

base_type::const_iterator Quotient::ThreadInfos::find ( const key_type k) const
inline

Definition at line 56 of file thread.h.

◆ operator[]()

mapped_type Quotient::ThreadInfos::operator[] ( const key_type k) const
inline

Definition at line 57 of file thread.h.

◆ updateFrom()

UpdateResult Quotient::ThreadInfos::updateFrom ( const TimelineItem eventItem)

Update thread state for an event that just arrived to the timeline.

This method handles the full logic of updating thread state when a new event arrives: it figures out if any thread should be created or updated, and then creates or updates the respective ThreadInfo object according to the data in the event.

Note
As of this writing, the event reference itself is not stored, only the aggregated statistics.
Returns
A pair consisting of a ThreadInfo object that was created/updated, and a boolean flag that is true if that object was created, false if it was updated

Friends And Related Symbol Documentation

◆ Room

friend class Room
friend

Definition at line 65 of file thread.h.


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