#include <DataQueue.hpp>
Access to send messages through XLink stream
Definition at line 344 of file DataQueue.hpp.
◆ DataInputQueue()
◆ ~DataInputQueue()
dai::DataInputQueue::~DataInputQueue |
( |
| ) |
|
◆ close()
void dai::DataInputQueue::close |
( |
| ) |
|
Closes the queue and the underlying thread
Definition at line 268 of file DataQueue.cpp.
◆ getBlocking()
bool dai::DataInputQueue::getBlocking |
( |
| ) |
const |
Gets current queue behavior when full (maxSize)
- Returns
- True if blocking, false otherwise
Definition at line 295 of file DataQueue.cpp.
◆ getMaxDataSize()
std::size_t dai::DataInputQueue::getMaxDataSize |
( |
| ) |
|
Gets maximum queue size.
- Returns
- Maximum message size
Definition at line 315 of file DataQueue.cpp.
◆ getMaxSize()
unsigned int dai::DataInputQueue::getMaxSize |
( |
| ) |
const |
Gets queue maximum size
- Returns
- Maximum queue size
Definition at line 305 of file DataQueue.cpp.
◆ getName()
std::string dai::DataInputQueue::getName |
( |
| ) |
const |
Gets queues name
- Returns
- Queue name
Definition at line 319 of file DataQueue.cpp.
◆ isClosed()
bool dai::DataInputQueue::isClosed |
( |
| ) |
const |
Check whether queue is closed
- Warning
- This function is thread-unsafe and may return outdated incorrect values. It is only meant for use in simple single-threaded code. Well written code should handle exceptions when calling any DepthAI apis to handle hardware events and multithreaded use.
Definition at line 264 of file DataQueue.cpp.
◆ send() [1/6]
void dai::DataInputQueue::send |
( |
const ADatatype & |
msg | ) |
|
Adds a message to the queue, which will be picked up and sent to the device. Can either block if 'blocking' behavior is true or overwrite oldest
- Parameters
-
msg | Message to add to the queue |
Definition at line 341 of file DataQueue.cpp.
◆ send() [2/6]
bool dai::DataInputQueue::send |
( |
const ADatatype & |
msg, |
|
|
std::chrono::milliseconds |
timeout |
|
) |
| |
Adds message to the queue, which will be picked up and sent to the device. Can either block until timeout if 'blocking' behavior is true or overwrite oldest
- Parameters
-
msg | Message to add to the queue |
timeout | Maximum duration to block in milliseconds |
Definition at line 362 of file DataQueue.cpp.
◆ send() [3/6]
void dai::DataInputQueue::send |
( |
const std::shared_ptr< ADatatype > & |
msg | ) |
|
Adds a message to the queue, which will be picked up and sent to the device. Can either block if 'blocking' behavior is true or overwrite oldest
- Parameters
-
msg | Message to add to the queue |
Definition at line 336 of file DataQueue.cpp.
◆ send() [4/6]
bool dai::DataInputQueue::send |
( |
const std::shared_ptr< ADatatype > & |
msg, |
|
|
std::chrono::milliseconds |
timeout |
|
) |
| |
Adds message to the queue, which will be picked up and sent to the device. Can either block until timeout if 'blocking' behavior is true or overwrite oldest
- Parameters
-
msg | Message to add to the queue |
timeout | Maximum duration to block in milliseconds |
Definition at line 357 of file DataQueue.cpp.
◆ send() [5/6]
void dai::DataInputQueue::send |
( |
const std::shared_ptr< RawBuffer > & |
rawMsg | ) |
|
Adds a raw message to the queue, which will be picked up and sent to the device. Can either block if 'blocking' behavior is true or overwrite oldest
- Parameters
-
rawMsg | Message to add to the queue |
Definition at line 323 of file DataQueue.cpp.
◆ send() [6/6]
bool dai::DataInputQueue::send |
( |
const std::shared_ptr< RawBuffer > & |
rawMsg, |
|
|
std::chrono::milliseconds |
timeout |
|
) |
| |
Adds message to the queue, which will be picked up and sent to the device. Can either block until timeout if 'blocking' behavior is true or overwrite oldest
- Parameters
-
rawMsg | Message to add to the queue |
timeout | Maximum duration to block in milliseconds |
Definition at line 345 of file DataQueue.cpp.
◆ setBlocking()
void dai::DataInputQueue::setBlocking |
( |
bool |
blocking | ) |
|
Sets queue behavior when full (maxSize)
- Parameters
-
blocking | Specifies if block or overwrite the oldest message in the queue |
Definition at line 290 of file DataQueue.cpp.
◆ setMaxDataSize()
void dai::DataInputQueue::setMaxDataSize |
( |
std::size_t |
maxSize | ) |
|
Sets maximum message size. If message is larger than specified, then an exception is issued.
- Parameters
-
maxSize | Maximum message size to add to queue |
Definition at line 311 of file DataQueue.cpp.
◆ setMaxSize()
void dai::DataInputQueue::setMaxSize |
( |
unsigned int |
maxSize | ) |
|
Sets queue maximum size
- Parameters
-
maxSize | Specifies maximum number of messages in the queue |
Definition at line 300 of file DataQueue.cpp.
◆ exceptionMessage
std::string dai::DataInputQueue::exceptionMessage |
|
private |
◆ maxDataSize
◆ name
const std::string dai::DataInputQueue::name |
|
private |
◆ queue
◆ running
std::atomic<bool> dai::DataInputQueue::running {true} |
|
private |
◆ writingThread
std::thread dai::DataInputQueue::writingThread |
|
private |
The documentation for this class was generated from the following files: