boost

how do i change the shm_open path?

北城以北 提交于 2020-07-19 05:15:22
问题 i am currently developing an application on ubunto and calling shm_open, currently the default path is within /var/run/shm. however i need to change this to /tmp. simply trying the following does not work: fd = shm_open( "/tmp/test", O_RDWR | O_CREAT, 0777 ); can anyone please advise? 回答1: From the man page of shm_open(3) : name specifies the shared memory object to be created or opened. For portable use, a shared memory object should be identified by a name of the form /somename ; that is, a

NanoMsg (NNG) & FlatBuffers the correct fit for this project?

社会主义新天地 提交于 2020-07-15 04:07:08
问题 Shout out if there is something better we should consider: I am looking for a very quick and simple way to get several programs (e.g. 5) - each running on separate nodes on a private OpenStack cloud to talk to each other. Packets will be short C++ structs (less than 100 bytes) Traffic will be light (probably less than 100/second) Latency is really not an issue. (what is a few ms between friends?) - we have lots of cycles and memory Messages should be done as pub/sub client/server paradigm

NanoMsg (NNG) & FlatBuffers the correct fit for this project?

谁都会走 提交于 2020-07-15 04:05:56
问题 Shout out if there is something better we should consider: I am looking for a very quick and simple way to get several programs (e.g. 5) - each running on separate nodes on a private OpenStack cloud to talk to each other. Packets will be short C++ structs (less than 100 bytes) Traffic will be light (probably less than 100/second) Latency is really not an issue. (what is a few ms between friends?) - we have lots of cycles and memory Messages should be done as pub/sub client/server paradigm

Installing Boost libraries to a custom directory in ~ (home)

一个人想着一个人 提交于 2020-07-09 13:58:12
问题 I'm trying to build the boost libraries as i see at the manual from, http://www.boost.org/doc/libs/1_62_0/more/getting_started/unix-variants.html#easy-build-and-install As described at the manual, I'm running the command, $ ./bootstrap.sh --prefix=path/to/installation/prefix with --prefix=~/boost-libs, like this, $ ./bootstrap.sh --prefix=~/boost-libs so the libs to be placed in my home directory. After that I'm running, ./b2 install I'm also tried to run it like this, ./b2 install --prefix=~

How to pass an std::vector with custom allocator to a function that expects one with std::allocator?

一世执手 提交于 2020-07-08 09:40:34
问题 I am working with an external library (pcl) so I need a solution that does not change the existing function prototypes. One function that I am using generates an std::vector<int, Eigen::aligned_allocator<int>> . The function that I want to call next expects a const boost::shared_ptr<std::vector<int, std::allocator<int>>> . I do not want to copy the elements because it is in an already slow critical part of my code. If not for the allocator mismatch, I would get around the shared_ptr

Boost.asio and asynchronous chain, unique_ptr?

纵饮孤独 提交于 2020-07-06 12:24:28
问题 I am not deeply familiar with async programming and I have a question. My question is the following. Given the echo_server example here for C++11 in boost.asio: http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/example/cpp11/spawn/echo_server.cpp I would like to know if the std::make_shared<session> can be replaced in C++14 with a std::unique_ptr<session> in C++14, avoiding the overhead of reference count. I am not sure since we have shared_from_this() but not something like unique

C++ Boost Geometry error: no matching function for call to 'assertion_failed'

删除回忆录丶 提交于 2020-07-05 10:18:46
问题 I am trying to test if a Polygon is contained within another Polygon using Boost library. I just started writing my code using this as an example, and got a massive compile error even before I could begin my main block. (It was so massive SO threw an error stating question body length exceeded limit of 30000 chars). My code goes as #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> int main(int argc, char** argv) {

Do cereal and Boost Serialization use zero-copy?

人盡茶涼 提交于 2020-07-05 05:36:23
问题 I have done some performance comparison between several serialization protocols, including FlatBuffers, Cap'n Proto, Boost serialization and cereal. All the tests are written in C++. I know that FlatBuffers and Cap'n Proto use zero-copy. With zero-copy, serialization time is null but size of serialized objects is bigger. I thought that cereal and Boost serialization didn't use zero-copy. However, serialization time (for int and double) is nearly null, and size of serialized objects is nearly

Do cereal and Boost Serialization use zero-copy?

做~自己de王妃 提交于 2020-07-05 05:36:05
问题 I have done some performance comparison between several serialization protocols, including FlatBuffers, Cap'n Proto, Boost serialization and cereal. All the tests are written in C++. I know that FlatBuffers and Cap'n Proto use zero-copy. With zero-copy, serialization time is null but size of serialized objects is bigger. I thought that cereal and Boost serialization didn't use zero-copy. However, serialization time (for int and double) is nearly null, and size of serialized objects is nearly

Target Boost::<library> already has an imported location + link errors

谁说我不能喝 提交于 2020-07-04 08:56:08
问题 I'm using Homebrew to install LLVM, Boost, and CMake on MacOS Mojave. After upgrading my LLVM to version 9.0.0 and Boost to 1.71.0, CMake (v3.15.3) started complaining about various libraries already having an imported location, such as: CMake Warning at /usr/local/lib/cmake/boost_system-1.71.0/libboost_system-variant-shared.cmake:59 (message): Target Boost::system already has an imported location '/usr/local/lib/libboost_system-mt.dylib', which will be overwritten with '/usr/local/lib