|
OpenWalnut
1.2.5
|
This class provides a common interface for thread-safe access to associative containers (set, multiset, map, multimap). More...
#include <WSharedAssociativeContainer.h>
Inheritance diagram for WSharedAssociativeContainer< T >:Public Types | |
| typedef T::const_iterator | ConstIterator |
| A typedef for the correct const iterator useful to traverse this sequence container. | |
| typedef T::iterator | Iterator |
| A typedef for the correct iterator to traverse this sequence container. | |
| typedef T::value_type | value_type |
| The type of the elements. | |
| typedef T::key_type | key_type |
| The type of the key used in this associative container. | |
Public Types inherited from WSharedObject< T > | |
| typedef boost::shared_ptr < WSharedObjectTicketRead< T > > | ReadTicket |
| Type for read tickets. | |
| typedef boost::shared_ptr < WSharedObjectTicketWrite< T > > | WriteTicket |
| Type for write tickets. | |
Public Member Functions | |
| WSharedAssociativeContainer () | |
| Default constructor. | |
| virtual | ~WSharedAssociativeContainer () |
| Destructor. | |
| void | clear () |
| Clears the container. | |
| bool | empty () const |
| Return true if the container is empty. | |
| size_t | size () const |
| The current size of the container. | |
| size_t | max_size () const |
| The maximum size of a container. | |
| size_t | count (const key_type &x) const |
| Count elements with a specific key. | |
| size_t | erase (const key_type &x) |
| Erases the element with the specified key. | |
| std::pair< Iterator, bool > | insert (const value_type &x) |
| Inserts the specified element. | |
Public Member Functions inherited from WSharedObject< T > | |
| WSharedObject () | |
| Default constructor. | |
| virtual | ~WSharedObject () |
| Destructor. | |
| ReadTicket | getReadTicket () const |
| Returns a ticket to get read access to the contained data. | |
| WriteTicket | getWriteTicket (bool suppressNotify=false) const |
| Returns a ticket to get write access to the contained data. | |
| boost::shared_ptr< WCondition > | getChangeCondition () const |
| This condition fires whenever the encapsulated object changed. | |
Additional Inherited Members | |
Protected Attributes inherited from WSharedObject< T > | |
| T | m_object |
| The object wrapped by this class. | |
| boost::shared_ptr < boost::shared_mutex > | m_lock |
| The lock to ensure thread safe access. | |
| boost::shared_ptr< WCondition > | m_changeCondition |
| This condition set fires whenever the contained object changes. | |
This class provides a common interface for thread-safe access to associative containers (set, multiset, map, multimap).
Definition at line 38 of file WSharedAssociativeContainer.h.
| typedef T::const_iterator WSharedAssociativeContainer< T >::ConstIterator |
A typedef for the correct const iterator useful to traverse this sequence container.
Definition at line 46 of file WSharedAssociativeContainer.h.
| typedef T::iterator WSharedAssociativeContainer< T >::Iterator |
A typedef for the correct iterator to traverse this sequence container.
Definition at line 51 of file WSharedAssociativeContainer.h.
| typedef T::key_type WSharedAssociativeContainer< T >::key_type |
The type of the key used in this associative container.
Definition at line 61 of file WSharedAssociativeContainer.h.
| typedef T::value_type WSharedAssociativeContainer< T >::value_type |
The type of the elements.
Definition at line 56 of file WSharedAssociativeContainer.h.
| WSharedAssociativeContainer< T >::WSharedAssociativeContainer | ( | ) |
Default constructor.
Definition at line 131 of file WSharedAssociativeContainer.h.
|
virtual |
Destructor.
Definition at line 138 of file WSharedAssociativeContainer.h.
| void WSharedAssociativeContainer< T >::clear | ( | ) |
Clears the container.
Definition at line 144 of file WSharedAssociativeContainer.h.
References WSharedAssociativeContainer< T >::clear(), and WSharedObject< T >::getWriteTicket().
Referenced by WSharedAssociativeContainer< T >::clear().
| size_t WSharedAssociativeContainer< T >::count | ( | const key_type & | x | ) | const |
Count elements with a specific key.
The sense and non-sense of this method in a multi threaded environment is questionable.
| x | the key |
Definition at line 172 of file WSharedAssociativeContainer.h.
References WSharedAssociativeContainer< T >::count(), and WSharedObject< T >::getReadTicket().
Referenced by WSharedAssociativeContainer< T >::count().
| bool WSharedAssociativeContainer< T >::empty | ( | ) | const |
Return true if the container is empty.
The sense and non-sense of this method in a multi threaded environment is questionable.
Definition at line 151 of file WSharedAssociativeContainer.h.
References WSharedAssociativeContainer< T >::empty(), and WSharedObject< T >::getReadTicket().
Referenced by WSharedAssociativeContainer< T >::empty().
| size_t WSharedAssociativeContainer< T >::erase | ( | const key_type & | x | ) |
Erases the element with the specified key.
| x | the key |
Definition at line 179 of file WSharedAssociativeContainer.h.
References WSharedAssociativeContainer< T >::erase(), and WSharedObject< T >::getWriteTicket().
Referenced by WSharedAssociativeContainer< T >::erase().
| std::pair< typename WSharedAssociativeContainer< T >::Iterator, bool > WSharedAssociativeContainer< T >::insert | ( | const value_type & | x | ) |
Inserts the specified element.
| x | the element to add |
Definition at line 186 of file WSharedAssociativeContainer.h.
References WSharedObject< T >::getWriteTicket(), and WSharedAssociativeContainer< T >::insert().
Referenced by WGEColormapping::applyInst(), and WSharedAssociativeContainer< T >::insert().
| size_t WSharedAssociativeContainer< T >::max_size | ( | ) | const |
The maximum size of a container.
Definition at line 165 of file WSharedAssociativeContainer.h.
References WSharedObject< T >::getReadTicket(), and WSharedAssociativeContainer< T >::max_size().
Referenced by WSharedAssociativeContainer< T >::max_size().
| size_t WSharedAssociativeContainer< T >::size | ( | ) | const |
The current size of the container.
0 if empty. The sense and non-sense of this method in a multi threaded environment is questionable.
Definition at line 158 of file WSharedAssociativeContainer.h.
References WSharedObject< T >::getReadTicket(), and WSharedAssociativeContainer< T >::size().
Referenced by WSharedAssociativeContainer< T >::size().
1.8.1