Open3D (C++ API)  0.12.0
Data Structures | Public Member Functions | Protected Member Functions
open3d::io::rpc::ReceiverBase Class Reference

#include <ReceiverBase.h>

Inheritance diagram for open3d::io::rpc::ReceiverBase:
open3d::io::rpc::DummyReceiver open3d::visualization::Receiver

Data Structures

struct  MsgpackObject
 

Public Member Functions

 ReceiverBase (const std::string &address="tcp://127.0.0.1:51454", int timeout=10000)
 
 ReceiverBase (const ReceiverBase &)=delete
 
ReceiverBaseoperator= (const ReceiverBase &)=delete
 
virtual ~ReceiverBase ()
 
void Start ()
 Starts the receiver mainloop in a new thread. More...
 
void Stop ()
 
std::runtime_error GetLastError ()
 Returns the last error from the mainloop thread. More...
 

Protected Member Functions

virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::SetMeshData &msg, const MsgpackObject &obj)
 
virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::GetMeshData &msg, const MsgpackObject &obj)
 
virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::SetCameraData &msg, const MsgpackObject &obj)
 
virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::SetProperties &msg, const MsgpackObject &obj)
 
virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::SetActiveCamera &msg, const MsgpackObject &obj)
 
virtual std::shared_ptr< zmq::message_t > ProcessMessage (const messages::Request &req, const messages::SetTime &msg, const MsgpackObject &obj)
 

Detailed Description

Base class for the server side receiving requests from a client. Subclass from this and implement the overloaded ProcessMessage functions as needed.

Constructor & Destructor Documentation

◆ ReceiverBase() [1/2]

open3d::io::rpc::ReceiverBase::ReceiverBase ( const std::string &  address = "tcp://127.0.0.1:51454",
int  timeout = 10000 
)

Constructs a receiver listening on the specified address.

Parameters
addressAddress to listen on.
timeoutTimeout in milliseconds for sending the reply.

◆ ReceiverBase() [2/2]

open3d::io::rpc::ReceiverBase::ReceiverBase ( const ReceiverBase )
delete

◆ ~ReceiverBase()

open3d::io::rpc::ReceiverBase::~ReceiverBase ( )
virtual

Member Function Documentation

◆ GetLastError()

std::runtime_error open3d::io::rpc::ReceiverBase::GetLastError ( )

Returns the last error from the mainloop thread.

◆ operator=()

ReceiverBase& open3d::io::rpc::ReceiverBase::operator= ( const ReceiverBase )
delete

◆ ProcessMessage() [1/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::SetMeshData msg,
const MsgpackObject obj 
)
protectedvirtual

Function for processing a msg.

Parameters
reqThe Request object that accompanies the
msgobject.
msgThe message to be processed
objThe object from which the
msgwas unpacked. Can be used for custom unpacking.

Reimplemented in open3d::visualization::Receiver, and open3d::io::rpc::DummyReceiver.

◆ ProcessMessage() [2/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::GetMeshData msg,
const MsgpackObject obj 
)
protectedvirtual

Reimplemented in open3d::io::rpc::DummyReceiver.

◆ ProcessMessage() [3/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::SetCameraData msg,
const MsgpackObject obj 
)
protectedvirtual

Reimplemented in open3d::io::rpc::DummyReceiver.

◆ ProcessMessage() [4/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::SetProperties msg,
const MsgpackObject obj 
)
protectedvirtual

Reimplemented in open3d::io::rpc::DummyReceiver.

◆ ProcessMessage() [5/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::SetActiveCamera msg,
const MsgpackObject obj 
)
protectedvirtual

Reimplemented in open3d::io::rpc::DummyReceiver.

◆ ProcessMessage() [6/6]

std::shared_ptr< zmq::message_t > open3d::io::rpc::ReceiverBase::ProcessMessage ( const messages::Request req,
const messages::SetTime msg,
const MsgpackObject obj 
)
protectedvirtual

Reimplemented in open3d::io::rpc::DummyReceiver.

◆ Start()

void open3d::io::rpc::ReceiverBase::Start ( )

Starts the receiver mainloop in a new thread.

◆ Stop()

void open3d::io::rpc::ReceiverBase::Stop ( )

Stops the receiver mainloop and joins the thread. This function blocks until the mainloop is done with processing messages that have already been received.


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