Class DataInputQueue
Defined in File DataQueue.hpp
Class Documentation
-
class DataInputQueue
Access to send messages through XLink stream
Public Functions
-
~DataInputQueue()
-
bool 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.
-
void close()
Closes the queue and the underlying thread
-
void 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
-
std::size_t getMaxDataSize()
Gets maximum queue size.
- Returns:
Maximum message size
-
void setBlocking(bool blocking)
Sets queue behavior when full (maxSize)
- Parameters:
blocking – Specifies if block or overwrite the oldest message in the queue
-
bool getBlocking() const
Gets current queue behavior when full (maxSize)
- Returns:
True if blocking, false otherwise
-
void setMaxSize(unsigned int maxSize)
Sets queue maximum size
- Parameters:
maxSize – Specifies maximum number of messages in the queue
-
unsigned int getMaxSize() const
Gets queue maximum size
- Returns:
Maximum queue size
-
std::string getName() const
Gets queues name
- Returns:
Queue name
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
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
-
void 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
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
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
-
bool 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
-
~DataInputQueue()