Chatterino
Public Member Functions | Public Attributes | List of all members
chatterino::SignalVector< T > Class Template Reference

#include <SignalVector.hpp>

Inheritance diagram for chatterino::SignalVector< T >:
[legend]
Collaboration diagram for chatterino::SignalVector< T >:
[legend]

Public Member Functions

 SignalVector ()
 
 SignalVector (std::function< bool(const T &, const T &)> &&compare)
 
bool isSorted () const
 
std::shared_ptr< const std::vector< T > > readOnly ()
 A read-only version of the vector which can be used concurrently. More...
 
int insert (const T &item, int index=-1, void *caller=nullptr)
 
int append (const T &item, void *caller=nullptr)
 
void removeAt (int index, void *caller=nullptr)
 
const std::vector< T > & raw () const
 
std::vector< T > cloneVector ()
 
auto begin () const
 
auto end () const
 
decltype(auto) operator[] (size_t index)
 
auto empty ()
 

Public Attributes

pajlada::Signals::Signal< SignalVectorItemEvent< T > > itemInserted
 
pajlada::Signals::Signal< SignalVectorItemEvent< T > > itemRemoved
 
pajlada::Signals::NoArgSignal delayedItemsChanged
 

Constructor & Destructor Documentation

◆ SignalVector() [1/2]

template<typename T>
chatterino::SignalVector< T >::SignalVector ( )
inline

◆ SignalVector() [2/2]

template<typename T>
chatterino::SignalVector< T >::SignalVector ( std::function< bool(const T &, const T &)> &&  compare)
inline

Member Function Documentation

◆ append()

template<typename T>
int chatterino::SignalVector< T >::append ( const T &  item,
void *  caller = nullptr 
)
inline

This may only be called from the GUI thread.

Parameters
itemItem to be appended.
callerCaller id which will be passed in the itemInserted and itemRemoved signals.
Here is the caller graph for this function:

◆ begin()

template<typename T>
auto chatterino::SignalVector< T >::begin ( ) const
inline

◆ cloneVector()

template<typename T>
std::vector<T> chatterino::SignalVector< T >::cloneVector ( )
inline

◆ empty()

template<typename T>
auto chatterino::SignalVector< T >::empty ( )
inline
Here is the caller graph for this function:

◆ end()

template<typename T>
auto chatterino::SignalVector< T >::end ( ) const
inline

◆ insert()

template<typename T>
int chatterino::SignalVector< T >::insert ( const T &  item,
int  index = -1,
void *  caller = nullptr 
)
inline

This may only be called from the GUI thread.

Parameters
itemItem to be inserted.
proposedIndexIndex to insert at. -1 will append at the end. Will be ignored if the vector is sorted.
callerCaller id which will be passed in the itemInserted and itemRemoved signals.
Here is the caller graph for this function:

◆ isSorted()

template<typename T>
bool chatterino::SignalVector< T >::isSorted ( ) const
inline
Here is the caller graph for this function:

◆ operator[]()

template<typename T>
decltype(auto) chatterino::SignalVector< T >::operator[] ( size_t  index)
inline

◆ raw()

template<typename T>
const std::vector<T>& chatterino::SignalVector< T >::raw ( ) const
inline
Here is the caller graph for this function:

◆ readOnly()

template<typename T>
std::shared_ptr<const std::vector<T> > chatterino::SignalVector< T >::readOnly ( )
inline

A read-only version of the vector which can be used concurrently.

Here is the caller graph for this function:

◆ removeAt()

template<typename T>
void chatterino::SignalVector< T >::removeAt ( int  index,
void *  caller = nullptr 
)
inline
Here is the caller graph for this function:

Member Data Documentation

◆ delayedItemsChanged

template<typename T>
pajlada::Signals::NoArgSignal chatterino::SignalVector< T >::delayedItemsChanged

◆ itemInserted

template<typename T>
pajlada::Signals::Signal<SignalVectorItemEvent<T> > chatterino::SignalVector< T >::itemInserted

◆ itemRemoved

template<typename T>
pajlada::Signals::Signal<SignalVectorItemEvent<T> > chatterino::SignalVector< T >::itemRemoved

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