Public Member Functions | Private Member Functions | Private Attributes | List of all members
dai::MessageGroup Class Reference

#include <MessageGroup.hpp>

Inheritance diagram for dai::MessageGroup:
Inheritance graph
[legend]

Public Member Functions

void add (const std::string &name, const std::shared_ptr< ADatatype > &value)
 
template<typename T >
void add (const std::string &name, const T &value)
 
std::unordered_map< std::string, std::shared_ptr< ADatatype > >::iterator begin ()
 
std::unordered_map< std::string, std::shared_ptr< ADatatype > >::iterator end ()
 
template<typename T >
std::shared_ptr< T > get (const std::string &name)
 
int64_t getIntervalNs () const
 
std::vector< std::string > getMessageNames () const
 
int64_t getNumMessages () const
 
bool isSynced (int64_t thresholdNs) const
 
 MessageGroup ()
 Construct MessageGroup message. More...
 
 MessageGroup (std::shared_ptr< RawMessageGroup > ptr)
 
std::shared_ptr< ADatatypeoperator[] (const std::string &name)
 Group. More...
 
MessageGroupsetSequenceNum (int64_t sequenceNum)
 
MessageGroupsetTimestamp (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
MessageGroupsetTimestampDevice (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
virtual ~MessageGroup ()=default
 
- Public Member Functions inherited from dai::Buffer
 Buffer ()
 Creates Buffer message. More...
 
 Buffer (std::shared_ptr< dai::RawBuffer > ptr)
 
std::vector< std::uint8_t > & getData () const
 Get non-owning reference to internal buffer. More...
 
int64_t getSequenceNum () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice () const
 
void setData (const std::vector< std::uint8_t > &data)
 
void setData (std::vector< std::uint8_t > &&data)
 
BuffersetSequenceNum (int64_t sequenceNum)
 
BuffersetTimestamp (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
BuffersetTimestampDevice (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
virtual ~Buffer ()=default
 
- Public Member Functions inherited from dai::ADatatype
 ADatatype (std::shared_ptr< RawBuffer > r)
 
std::shared_ptr< RawBuffergetRaw () const
 
virtual ~ADatatype ()=default
 

Private Member Functions

std::shared_ptr< RawBufferserialize () const override
 

Private Attributes

std::unordered_map< std::string, std::shared_ptr< ADatatype > > group
 
RawMessageGrouprawGrp
 

Additional Inherited Members

- Protected Attributes inherited from dai::ADatatype
std::shared_ptr< RawBufferraw
 

Detailed Description

MessageGroup message. Carries multiple messages in one.

Definition at line 16 of file MessageGroup.hpp.

Constructor & Destructor Documentation

◆ MessageGroup() [1/2]

dai::MessageGroup::MessageGroup ( )

Construct MessageGroup message.

Definition at line 15 of file MessageGroup.cpp.

◆ MessageGroup() [2/2]

dai::MessageGroup::MessageGroup ( std::shared_ptr< RawMessageGroup ptr)
explicit

Definition at line 16 of file MessageGroup.cpp.

◆ ~MessageGroup()

virtual dai::MessageGroup::~MessageGroup ( )
virtualdefault

Member Function Documentation

◆ add() [1/2]

void dai::MessageGroup::add ( const std::string &  name,
const std::shared_ptr< ADatatype > &  value 
)

Definition at line 21 of file MessageGroup.cpp.

◆ add() [2/2]

template<typename T >
void dai::MessageGroup::add ( const std::string &  name,
const T &  value 
)
inline

Definition at line 35 of file MessageGroup.hpp.

◆ begin()

std::unordered_map< std::string, std::shared_ptr< ADatatype > >::iterator dai::MessageGroup::begin ( )

Definition at line 26 of file MessageGroup.cpp.

◆ end()

std::unordered_map< std::string, std::shared_ptr< ADatatype > >::iterator dai::MessageGroup::end ( )

Definition at line 29 of file MessageGroup.cpp.

◆ get()

template<typename T >
std::shared_ptr<T> dai::MessageGroup::get ( const std::string &  name)
inline

Definition at line 30 of file MessageGroup.hpp.

◆ getIntervalNs()

int64_t dai::MessageGroup::getIntervalNs ( ) const

Retrieves interval between the first and the last message in the group.

Definition at line 33 of file MessageGroup.cpp.

◆ getMessageNames()

std::vector< std::string > dai::MessageGroup::getMessageNames ( ) const

Gets the names of messages in the group

Definition at line 51 of file MessageGroup.cpp.

◆ getNumMessages()

int64_t dai::MessageGroup::getNumMessages ( ) const

Definition at line 47 of file MessageGroup.cpp.

◆ isSynced()

bool dai::MessageGroup::isSynced ( int64_t  thresholdNs) const

True if all messages in the group are in the interval

Parameters
thresholdNsMaximal interval between messages

Definition at line 60 of file MessageGroup.cpp.

◆ operator[]()

std::shared_ptr< ADatatype > dai::MessageGroup::operator[] ( const std::string &  name)

Group.

Definition at line 18 of file MessageGroup.cpp.

◆ serialize()

std::shared_ptr< RawBuffer > dai::MessageGroup::serialize ( ) const
overrideprivatevirtual

Reimplemented from dai::Buffer.

Definition at line 11 of file MessageGroup.cpp.

◆ setSequenceNum()

MessageGroup & dai::MessageGroup::setSequenceNum ( int64_t  sequenceNum)

Retrieves image sequence number

Definition at line 73 of file MessageGroup.cpp.

◆ setTimestamp()

MessageGroup & dai::MessageGroup::setTimestamp ( std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration >  timestamp)

Sets image timestamp related to dai::Clock::now()

Definition at line 65 of file MessageGroup.cpp.

◆ setTimestampDevice()

MessageGroup & dai::MessageGroup::setTimestampDevice ( std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration >  timestamp)

Sets image timestamp related to dai::Clock::now()

Definition at line 69 of file MessageGroup.cpp.

Member Data Documentation

◆ group

std::unordered_map<std::string, std::shared_ptr<ADatatype> > dai::MessageGroup::group
private

Definition at line 19 of file MessageGroup.hpp.

◆ rawGrp

RawMessageGroup& dai::MessageGroup::rawGrp
private

Definition at line 18 of file MessageGroup.hpp.


The documentation for this class was generated from the following files:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20