@@ -43,15 +43,15 @@ class SlickQueue {
4343#endif
4444
4545 public:
46- SlickQueue (const char * const shm_name = nullptr , bool open_only = false ) noexcept
46+ SlickQueue (const char * const shm_name = nullptr , bool open_only = false )
4747 : data_(shm_name ? nullptr : new T[SIZE + 1024 ]) // add some buffer at the end
4848 , control_(shm_name ? nullptr : new slot[SIZE + 1024 ])
4949 , reserved_(shm_name ? nullptr : &reserved_local_)
5050 , own_(shm_name == nullptr )
5151 , use_shm_(shm_name != nullptr )
5252 {
5353 if (shm_name) {
54- allocateShmData (shm_name, open_only);
54+ allocate_shm_data (shm_name, open_only);
5555 }
5656
5757 if (own_) {
@@ -82,7 +82,12 @@ class SlickQueue {
8282#endif
8383 }
8484
85- bool ownBuffer () const noexcept { return own_; }
85+ bool own_buffer () const noexcept { return own_; }
86+ bool use_shm () const noexcept { return use_shm_; }
87+
88+ uint64_t initial_reading_index () const noexcept {
89+ return reserved_->load (std::memory_order_relaxed);
90+ }
8691
8792 uint64_t reserve (uint32_t n = 1 ) noexcept {
8893 return reserved_->fetch_add (n, std::memory_order_acq_rel);
@@ -135,7 +140,7 @@ class SlickQueue {
135140 private:
136141
137142#if defined(_MSC_VER)
138- void allocateShmData (const char * const shm_name, bool open_only) {
143+ void allocate_shm_data (const char * const shm_name, bool open_only) {
139144 auto BF_SZ = 64 + sizeof (slot) * (SIZE + 1024 ) + sizeof (T) * (SIZE + 1024 );
140145 HANDLE hMapFile = NULL ;
141146 if (open_only) {
0 commit comments