Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
mm::capture::PcapWriter Class Reference

Writes records to a pcap file as they arrive. More...

#include <pcap.h>

Public Member Functions

 PcapWriter ()=default
 
 ~PcapWriter ()
 
 PcapWriter (const PcapWriter &)=delete
 
PcapWriter & operator= (const PcapWriter &)=delete
 
std::expected< void, std::string > open (const std::filesystem::path &path)
 Creates path and writes the file header, with nanosecond timestamps.
 
std::expected< void, std::string > write (int64_t timestampNs, std::span< const uint8_t > bytes)
 Appends one frame.
 
void close ()
 Flushes and closes the file. Called by the destructor when not called before.
 

Detailed Description

Writes records to a pcap file as they arrive.

Constructor & Destructor Documentation

◆ PcapWriter() [1/2]

mm::capture::PcapWriter::PcapWriter ( )
default

◆ ~PcapWriter()

mm::capture::PcapWriter::~PcapWriter ( )

◆ PcapWriter() [2/2]

mm::capture::PcapWriter::PcapWriter ( const PcapWriter &  )
delete

Member Function Documentation

◆ close()

void mm::capture::PcapWriter::close ( )

Flushes and closes the file. Called by the destructor when not called before.

◆ open()

std::expected< void, std::string > mm::capture::PcapWriter::open ( const std::filesystem::path &  path)

Creates path and writes the file header, with nanosecond timestamps.

◆ operator=()

PcapWriter & mm::capture::PcapWriter::operator= ( const PcapWriter &  )
delete

◆ write()

std::expected< void, std::string > mm::capture::PcapWriter::write ( int64_t  timestampNs,
std::span< const uint8_t >  bytes 
)

Appends one frame.


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