25 #ifndef WSHAREDASSOCIATIVECONTAINER_H
26 #define WSHAREDASSOCIATIVECONTAINER_H
30 #include <boost/thread.hpp>
32 #include "WSharedObject.h"
37 template <
typename T >
130 template <
typename T >
137 template <
typename T >
143 template <
typename T >
150 template <
typename T >
154 return r->get().
empty();
157 template <
typename T >
161 return r->get().
size();
164 template <
typename T >
171 template <
typename T >
175 return r->get().
count( x );
178 template <
typename T >
182 return w->get().
erase( x );
185 template <
typename T >
189 return w->get().
insert( x );
This class provides a common interface for thread-safe access to associative containers (set,...
WSharedAssociativeContainer()
Default constructor.
void clear()
Clears the container.
T::iterator Iterator
A typedef for the correct iterator to traverse this sequence container.
bool empty() const
Return true if the container is empty.
T::key_type key_type
The type of the key used in this associative container.
std::pair< Iterator, bool > insert(const value_type &x)
Inserts the specified element.
T::value_type value_type
The type of the elements.
size_t erase(const key_type &x)
Erases the element with the specified key.
T::const_iterator ConstIterator
A typedef for the correct const iterator useful to traverse this sequence container.
virtual ~WSharedAssociativeContainer()
Destructor.
size_t max_size() const
The maximum size of a container.
size_t size() const
The current size of the container.
size_t count(const key_type &x) const
Count elements with a specific key.
Wrapper around an object/type for thread safe sharing of objects among multiple threads.
std::shared_ptr< WSharedObjectTicketRead< T > > ReadTicket
Type for read tickets.
ReadTicket getReadTicket() const
Returns a ticket to get read access to the contained data.
std::shared_ptr< WSharedObjectTicketWrite< T > > WriteTicket
Type for write tickets.
WriteTicket getWriteTicket(bool suppressNotify=false) const
Returns a ticket to get write access to the contained data.