ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
BufferConnection.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 #include <sstream>
12 
13 #include "io/rpc/ConnectionBase.h"
14 
15 namespace cloudViewer {
16 namespace io {
17 namespace rpc {
18 
21 public:
23 
25  std::shared_ptr<zmq::message_t> Send(zmq::message_t& send_msg);
26 
28  std::shared_ptr<zmq::message_t> Send(const void* data, size_t size);
29 
30  std::stringstream& buffer() { return buffer_; }
31  const std::stringstream& buffer() const { return buffer_; }
32 
33 private:
34  std::stringstream buffer_;
35 };
36 } // namespace rpc
37 } // namespace io
38 } // namespace cloudViewer
int size
Implements a connection writing to a buffer.
const std::stringstream & buffer() const
std::shared_ptr< zmq::message_t > Send(zmq::message_t &send_msg)
Function for sending data wrapped in a zmq message object.
Base class for all connections.
Generic file read and write utility for python interface.