Table of Contents

Class CdrWriter

Namespace
Pamoja.Ros2
Assembly
Pamoja.Ros2.dll

A CDR encoder, which writes primitives with the required alignment.

public sealed class CdrWriter : IDisposable
Inheritance
CdrWriter
Implements
Inherited Members

Constructors

CdrWriter()

Creates an encoder with the encapsulation header already written.

public CdrWriter()

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ToBytes()

Takes the encoded bytes, leaving the encoder spent.

public byte[] ToBytes()

Returns

byte[]

The encoded bytes.

Remarks

The native call consumes the encoder, so this hands ownership over and the handle must not be used again.

Exceptions

PamojaException

The encoder was already spent.

WriteDouble(double)

Appends a 64-bit float.

public void WriteDouble(double value)

Parameters

value double

The value to append.

WriteInt32(int)

Appends a 32-bit signed integer.

public void WriteInt32(int value)

Parameters

value int

The value to append.

WriteSingle(float)

Appends a 32-bit float.

public void WriteSingle(float value)

Parameters

value float

The value to append.

WriteUInt32(uint)

Appends a 32-bit unsigned integer.

public void WriteUInt32(uint value)

Parameters

value uint

The value to append.