ipcq 0.12.0
Loading...
Searching...
No Matches
ipcq

Shared memory queue. More...

Topics

 implementation details
 Shared memory queue implementation details.
 

Files

file  adapter.hpp
 Provides iterator adapter for ipcq::BasicReader.
 
file  error.hpp
 Contains declarations for ipcq::Error and related.
 
file  policies.hpp
 Declares ipcq policies.
 
file  reader.hpp
 Contains definition of ipcq::BasicReader.
 
file  writer.hpp
 Contains declarations for ipcq::BasicWriter.
 
file  version.hpp
 Contains version macro.
 

Classes

struct  ipcq::IteratorTraits< Iterator, class >
 Primary template for InputIterators. More...
 
struct  ipcq::IteratorTraits< Iterator, std::void_t< typename Iterator::container_type > >
 Template specialization for OutputIterators for which normal std::iterator_traits::value_type is void. More...
 
struct  ipcq::OutputIteratorAdapter< Iterator >
 Adapts either LegacyOutputIterator or Iterator type (e.g. More...
 
class  ipcq::ErrorCategory
 ipcq error category. More...
 
class  ipcq::BasicReader< T, ConditionPolicy, ShmTraits >
 Queue BasicReader class. More...
 
class  ipcq::BasicWriter< T, ConditionPolicy, ShmTraits >
 Queue writer class. More...
 

Macros

#define IPCQ_VERSION   1200
 Integer representation of 0.12.0 version tuple.
 

Typedefs

using ipcq::BoostConditionPolicy = detail::BoostConditionPolicy
 Uses boost condition policies, not lock-free.
 
using ipcq::SpinConditionPolicy = detail::SpinConditionPolicy
 Lock free condition policy that use spinning.
 
template<class T>
using ipcq::Reader = BasicReader<T, detail::BoostConditionPolicy>
 Convenience alias with reasonable default condition policy.
 
template<class T>
using ipcq::Writer = BasicWriter<T, BoostConditionPolicy>
 Convenience alias with reasonable default condition policy.
 

Enumerations

enum class  ipcq::Error {
  ipcq::Error::WouldBlock = 1 , ipcq::Error::Closed , ipcq::Error::Timeout , ipcq::Error::InconsistentState ,
  ipcq::Error::TypeMismatch , ipcq::Error::Overflow , ipcq::Error::BadFile , ipcq::Error::BadVersion
}
 ipcq err condition enum. More...
 
enum class  ipcq::Notify { ipcq::Notify::None , ipcq::Notify::All }
 Notification policy. More...
 

Functions

template<class Container>
constexpr auto ipcq::BackInserter (Container &c) -> OutputIteratorAdapter< std::back_insert_iterator< Container > >
 Convenience function that creates an OutputIteratorAdapter with a std::back_insert_iterator for a container.
 
const std::error_category & ipcq::GetErrorCategory ()
 ipcq error category.
 
std::error_code ipcq::make_error_code (Error e)
 Function overload to create std::error_code from ipcq::Error.
 

Detailed Description

Shared memory queue.

Macro Definition Documentation

◆ IPCQ_VERSION

#define IPCQ_VERSION   1200

Integer representation of 0.12.0 version tuple.

#include <ipcq/version.hpp>

Given version x.y.z:
x = IPCQ_VERSION / 100'000
y = IPCQ_VERSION / 100 % 1'000
z = IPCQ_VERSION % 100
#define IPCQ_VERSION
Integer representation of 0.12.0 version tuple.
Definition version.hpp:27

Definition at line 27 of file version.hpp.

Typedef Documentation

◆ BoostConditionPolicy

Uses boost condition policies, not lock-free.

Definition at line 22 of file policies.hpp.

◆ Reader

template<class T>
using ipcq::Reader = BasicReader<T, detail::BoostConditionPolicy>

Convenience alias with reasonable default condition policy.

Definition at line 489 of file reader.hpp.

◆ SpinConditionPolicy

Lock free condition policy that use spinning.

Definition at line 29 of file policies.hpp.

◆ Writer

template<class T>
using ipcq::Writer = BasicWriter<T, BoostConditionPolicy>

Convenience alias with reasonable default condition policy.

Definition at line 230 of file writer.hpp.

Enumeration Type Documentation

◆ Error

enum class ipcq::Error
strong

ipcq err condition enum.

Although the errors are "portable", so considered an error_condition, rather than an error_code, std::error_code can still be created explicitly with ipcq::make_error_ode(Error).

Enumerator
WouldBlock 

Non-blocking operation would block.

Closed 

Queue is closed or otherwise not available for reading.

Timeout 

Operation timed out.

InconsistentState 

Reader is in an inconsistent state w.r.t.

shared memory state.

The typical scenario for this error is if the writer overtakes the reader, overwriting an element being expecter by the reader.

TypeMismatch 

Queue type mismatch.

Overflow 

Value exeeds storage capacity.

BadFile 

File type is incorrect (not an ipcq shared object).

BadVersion 

File version mismatch (shared object created by ipcq with different file version).

Definition at line 25 of file error.hpp.

◆ Notify

enum class ipcq::Notify
strong

Notification policy.

Enumerator
None 

Don't notify.

All 

Notify all waiting readers.

Definition at line 23 of file writer.hpp.

Function Documentation

◆ BackInserter()

template<class Container>
auto ipcq::BackInserter ( Container & c) -> OutputIteratorAdapter<std::back_insert_iterator<Container>>
constexpr

Convenience function that creates an OutputIteratorAdapter with a std::back_insert_iterator for a container.

Equivalent to:

OutputIteratorAdapter(std::back_insert_iterator(container));

Example:

std::vector<Topic> buffer;
buffer.reserve(BATCH_SIZE);
reader.Read(ipcq::BackInserter(buffer), BATCH_SIZE, 5s);
See also
ipcq::OutputIteratorAdapter

Definition at line 90 of file adapter.hpp.

◆ GetErrorCategory()

const std::error_category & ipcq::GetErrorCategory ( )
inline

ipcq error category.

Note
There can only be a single instance of the error-category, as mandated by the standard.

Definition at line 110 of file error.hpp.

◆ make_error_code()

std::error_code ipcq::make_error_code ( Error e)
inline

Function overload to create std::error_code from ipcq::Error.

Definition at line 120 of file error.hpp.