11 #ifndef GBXICEUTILACFR_STORE_H 12 #define GBXICEUTILACFR_STORE_H 14 #include <gbxutilacfr/exceptions.h> 16 #include <IceUtil/Monitor.h> 17 #include <IceUtil/Mutex.h> 18 #include <IceUtil/Time.h> 42 class Store :
public IceUtil::Monitor<IceUtil::Mutex>
58 void set(
const Type & obj );
63 void get( Type & obj );
68 void peek( Type & obj )
const;
79 int getNext( Type & obj,
int timeoutMs=-1 );
91 virtual void internalGet( Type & obj )
const ;
94 virtual void internalSet(
const Type & obj );
105 int getNextNoWait( Type & obj );
127 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
134 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
141 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
156 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
172 if ( timeoutMs == -1 ) {
173 return getNextNoWait( obj );
177 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
189 if ( this->timedWait( IceUtil::Time::milliSeconds( timeoutMs ) ) )
213 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
217 while ( !isNewData_ )
231 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
248 IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*
this);
void set(const Type &obj)
Sets the contents of the Store.
Definition: store.h:229
Base class for all GbxUtilAcfr exceptions.
Definition: gbxutilacfr/exceptions.h:65
void purge()
Definition: store.h:246
void get(Type &obj)
Definition: store.h:139
bool isNewData() const
Returns TRUE if the data in the Store has not been accessed with get() yet.
Definition: store.h:132
void peek(Type &obj) const
Definition: store.h:154
Thread-safe storage for a single data objects.
Definition: store.h:42
bool isEmpty() const
Definition: store.h:125
Utility namespace (part of SICK-ACFR driver)
Definition: buffer.h:21
int getNext(Type &obj, int timeoutMs=-1)
Waits until the next update and returns the new value. If the Store is empty, getNext blocks until th...
Definition: store.h:169