Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Types | Public Member Functions | Static Public Member Functions | List of all members
arrow::ipc::Message Class Reference

An IPC message including metadata and body. More...

#include <arrow/ipc/message.h>

Public Types

enum  Type {
  NONE, SCHEMA, DICTIONARY_BATCH, RECORD_BATCH,
  TENSOR
}
 

Public Member Functions

 Message (const std::shared_ptr< Buffer > &metadata, const std::shared_ptr< Buffer > &body)
 Construct message, but do not validate. More...
 
 ~Message ()
 
bool Equals (const Message &other) const
 Return true if message type and contents are equal. More...
 
std::shared_ptr< Buffermetadata () const
 the Message metadata More...
 
std::shared_ptr< Bufferbody () const
 the Message body, if any More...
 
Type type () const
 The Message type. More...
 
MetadataVersion metadata_version () const
 The Message metadata version. More...
 
const void * header () const
 
Status SerializeTo (io::OutputStream *file, int64_t *output_length) const
 Write length-prefixed metadata and body to output stream. More...
 

Static Public Member Functions

static Status Open (const std::shared_ptr< Buffer > &metadata, const std::shared_ptr< Buffer > &body, std::unique_ptr< Message > *out)
 Create and validate a Message instance from two buffers. More...
 
static Status ReadFrom (const std::shared_ptr< Buffer > &metadata, io::InputStream *stream, std::unique_ptr< Message > *out)
 Read message body and create Message given Flatbuffer metadata. More...
 

Detailed Description

An IPC message including metadata and body.

Member Enumeration Documentation

◆ Type

Enumerator
NONE 
SCHEMA 
DICTIONARY_BATCH 
RECORD_BATCH 
TENSOR 

Constructor & Destructor Documentation

◆ Message()

arrow::ipc::Message::Message ( const std::shared_ptr< Buffer > &  metadata,
const std::shared_ptr< Buffer > &  body 
)

Construct message, but do not validate.

Use at your own risk; Message::Open has more metadata validation

◆ ~Message()

arrow::ipc::Message::~Message ( )

Member Function Documentation

◆ body()

std::shared_ptr<Buffer> arrow::ipc::Message::body ( ) const

the Message body, if any

Returns
buffer is null if no body

◆ Equals()

bool arrow::ipc::Message::Equals ( const Message other) const

Return true if message type and contents are equal.

Parameters
otheranother message
Returns
true if contents equal

◆ header()

const void* arrow::ipc::Message::header ( ) const

◆ metadata()

std::shared_ptr<Buffer> arrow::ipc::Message::metadata ( ) const

the Message metadata

Returns
buffer

◆ metadata_version()

MetadataVersion arrow::ipc::Message::metadata_version ( ) const

The Message metadata version.

◆ Open()

static Status arrow::ipc::Message::Open ( const std::shared_ptr< Buffer > &  metadata,
const std::shared_ptr< Buffer > &  body,
std::unique_ptr< Message > *  out 
)
static

Create and validate a Message instance from two buffers.

Parameters
[in]metadataa buffer containing the Flatbuffer metadata
[in]bodya buffer containing the message body, which may be null
[out]outthe created message
Returns
Status

◆ ReadFrom()

static Status arrow::ipc::Message::ReadFrom ( const std::shared_ptr< Buffer > &  metadata,
io::InputStream stream,
std::unique_ptr< Message > *  out 
)
static

Read message body and create Message given Flatbuffer metadata.

Parameters
[in]metadatacontaining a serialized Message flatbuffer
[in]streaman InputStream
[out]outthe created Message
Returns
Status
Note
If stream supports zero-copy, this is zero-copy

◆ SerializeTo()

Status arrow::ipc::Message::SerializeTo ( io::OutputStream file,
int64_t *  output_length 
) const

Write length-prefixed metadata and body to output stream.

Parameters
[in]fileoutput stream to write to
[out]output_lengththe number of bytes written
Returns
Status

◆ type()

Type arrow::ipc::Message::type ( ) const

The Message type.


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