libadblockplus
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
AdblockPlus::SynchronizedCollection< TContainer > Class Template Reference

Wrapper around Container providing few generic methods which ensure that the underlying container is accessed only by one thread at the same time. More...

#include <SynchronizedCollection.h>

Public Types

typedef Container::value_type value_type
 The value_type represents the type of stored values.
 

Public Member Functions

void push_back (const value_type &value)
 Adds value normally to the end. More...
 
void push_back (value_type &&value)
 
value_type pop_front ()
 Extracts the first stored element and returns it. More...
 

Protected Types

typedef TContainer Container
 

Protected Attributes

Container collection
 
std::mutex mutex
 
std::condition_variable conditionVar
 

Detailed Description

template<typename TContainer>
class AdblockPlus::SynchronizedCollection< TContainer >

Wrapper around Container providing few generic methods which ensure that the underlying container is accessed only by one thread at the same time.

Member Function Documentation

template<typename TContainer>
value_type AdblockPlus::SynchronizedCollection< TContainer >::pop_front ( )
inline

Extracts the first stored element and returns it.

Pay attention that the call of this method blocks the execution until there is at least one element added to the collection.

template<typename TContainer>
void AdblockPlus::SynchronizedCollection< TContainer >::push_back ( const value_type value)
inline

Adds value normally to the end.

Parameters
valuewhich is stored.

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