INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gbxiceutilacfr::Buffer< Type > Class Template Reference A thread-safe data pipe with buffer semantics. More...
Inherits IceUtil::Monitor< IceUtil::Mutex >.
Detailed Descriptiontemplate<class Type> class gbxiceutilacfr::Buffer< Type > A thread-safe data pipe with buffer semantics. For a type-safe buffer, template over the specific object Type you want to put in it. You can use this container for storing smart pointers (e.g. IceUtil smart pointers). In this case the container will only store the pointers and will not perform a deep copy.
Constructor & Destructor Documentation◆ Buffer()
template<class Type >
Buffer depth, i.e. the maximum number of objects this buffer can hold:
References gbxiceutilacfr::Buffer< Type >::purge(). Member Function Documentation◆ configure()
template<class Type >
Typically is called before the buffer is used, or if, for some reason, the configuration information was not available at the time when the constructor was called. Careful: all data currently in the buffer is lost, because purge() is calledfirst. NOTE: can do smarter by trancating queue only as much as needed. ◆ get() [1/2]
template<class Type >
Non-popping and non-blocking read from the front of the buffer. Calls to get() on an empty buffer raises an gbxutilacfr::Exception exception. You can catch these and call getWithTimeout() which will block until new data arrives. ◆ get() [2/2]
template<class Type >
Non-popping and non-blocking random-access read. Returns n-th element from the buffer. Indexing starts at 0. ◆ getAndPop()
template<class Type >
◆ getAndPopWithTimeout()
template<class Type >
Same as getWithTimeout but calls pop afterwards. ◆ getWithTimeout()
template<class Type >
If there is an object in the buffer, sets the object and returns 0; If the buffer is empty, getWithTimeout() blocks until a new object is pushed in and returns the new value. By default, there is an infinite timeout (negative value). Returns 0 if successful. If timeout is set to a positive value and the wait times out, this function returns -1 and the object argument itself is not touched. In the rare event of spurious wakeup, the return value is 1. ◆ pop()
template<class Type >
Pops the front element off and discards it (usually after calling get() ). If the buffer is empty this command is quietly ignored. ◆ push()
template<class Type >
Adds an object to the end of the buffer. If there is no room left in a finite-depth circular buffer, the front element of the buffer is quietly deleted and the new data is added to the end. If there is no room left in a finite-depth queue buffer the new data is quietly ignored. References gbxiceutilacfr::BufferTypeCircular. The documentation for this class was generated from the following file: |