boost

Graph algorithms (lib) with input graph in read-only shared memory on C/++

Hi! I would like to have a manager process sharing graphs via shared memory, read-only for other processes which will run various graph algorithms on these graphs. I would like to ask some questions emerged while researching the issue: Are there any graph libraries which are able to operate on (possibly their own) graph structures in r...

Does boost::asio::deadline_timer use a thread for each timer?

I have a list of items that I need to update on different intervals. The list can grow to be thousands of items long. Each item could potentially have a different interval. If I create one timer per item, am I going to saturate the system with threads? I was thinking it might be better to create one timer equal to the smallest interval i...

Compiling boost libraries

Hello, Windows XP Visual Studio 2008 I have downloaded and unzipped the boost_1.33.1. We have to use this version as our client application uses this version. However, I want to compile the source file to create the libraries. However, when I read the documentation I says you have to execute the bootstrap and then Bjam. However, in th...

Lookin' for a container and memory pool solution...

In an embedded program I have a screen object that needs to manage a list of items to display. The initial list of items will be pulled from a simple DB on screen load and the list will be updated via "Add" and "Remove" events. This list needs to be sorted according to certain criteria. I am looking of a container class that can help me ...

dual map structure implementation?

Hey, I'm looking for a standard dual-map structure - is there one implemented in std/boost/another standard C++ library? When I say "dual-map" I mean a map which can be indexed efficiently both by the key and the "value" (it actually has two key types instead of one key type and one value type). for example: dualmap<int,string> m; m[1...

C++: Best text accumulator

Text gets accumulates piecemeal before being sent to client. Now we use own class that allocates memory for each piece as char massive. (Anyway, works like char[][] + std::list<char*>). Then we build the whole string, convert it into std::sting and then create boost::asio::streambuf using it. That's slow enough, I assume. Correct me if...

A signalling thread problem

Hello - I am attempting to get a thread running which will be responsible for detecting a signal from any other thread within the same process. sigset_t sigset; sigfillset(&sigset); pthread_sigmask( SIG_BLOCK, &sigset, &old ); Once i've done this, I then daemonize the process: m_child = fork(); if (m_child == 0) { // Start t...

Using custom and built-in properties in Boost::Graph

Hi, I am building a graph class based on the following suggestion: http://stackoverflow.com/questions/671714/modifying-vertex-properties-in-a-boostgraph Unfortunately, I realized an unexpected behavior. When using my own vertex-properties (for simplicity please ignore the edge properties), the built-in properties seem not to be used. S...

boost threadpool - documentation and examples

I'm looking for documentation on boost::threadpool. I downloaded the source and documentation zip files. The documentation directory is just about empty. It says to look at src/examples/mergesort.cpp. It ain't there. In fact, there is no src/examples directory. Anyone know if there is a Roseta Stone, and if so where? ...

boost::asio tcp async_read never returns

I am trying to convert some existing code to use boost's asio tcp sockets instead of our current implementation. I am able to get a very similar example (of a chat client/server) from the boost site working, but when I attempt to put the code into my own program it stops working. What I am doing: Start a server process The server p...

Using for_each and boost::bind with a vector of pointers

I have a vector of pointers. I would like to call a function for every element, but that function takes a reference. Is there a simple way to dereference the elements? Example: MyClass::ReferenceFn( Element & e ) { ... } MyClass::PointerFn( Element * e ) { ... } MyClass::Function() { std::vector< Element * > elements; // add...

Micro Second resolution timestamps on windows.

How to get micro second resolution timestamps on windows? I am loking for something better than QueryPerformanceCounter, QueryPerformanceFrequency (these can only give you an elapsed time since boot, and are not necessarily accurate if they are called on different threads - ie QueryPerformanceCounter may return different results on diffe...

linking with boost unresolved extern link error

Hello, Visual Studio 2005 I am linking with boost libraries release 1_33_1. I keep getting this link error. libboost_thread-vc80-mt-sgd-1_33_1.lib(once.obj) :error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ) Does anyone have any suggestions? M...

Escaping a C++ string

Hey, what's the easiest way to convert a C++ std::string to another std::string, which has all the unprintable characters escaped? for example for the string of length two which the content 0x61,0x01 - the result string might be "a\x01", or "a%01" Just looking for the easiest already-implemented solution. Specific output format is les...

Compiling boost on Sunos

I have just started with using boost libraries. For one of our projects i want to compile Boost 1.39.0 on Sun OS using sun compiler. However if i compile it using steps mentioned in http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html, not all of the targets are compiled. Can someone provide resources which would ...

Finding cells in a grid with varying grid cell sizes

I have a grid of rectangular cells covering a plane sitting at some distance from the coordinate system origin and would like to identify the grid cell where a straight line starting at the origin would intersect it. The cells on the grid have equal sizes (dx,dy) and there are no gaps between cells, but since every cell on the plane has...

How do you correctly use boost::make_shared_ptr?

This simple example fails to compile in VS2K8: io_service io2; shared_ptr<asio::deadline_timer> dt(make_shared<asio::deadline_timer>(io2, posix_time::seconds(20))); As does this one: shared_ptr<asio::deadline_timer> dt = make_shared<asio::deadline_timer>(io2); The error is: error C2664: 'boost::asio::basic_deadline_time...

Boost Solr results based on the field that contained the hit

Hi, I was browsing the web looking for a indexing and search framework and stumbled upon Solr. A functionality that we abolutely need is to boost results based on what field contained the hit. A small example: Consider a record like this: <movie> <title>The Dark Knight</title> <alternative_title>Batman Begins 2</alternative_title...

Which Singleton library in BOOST do you guys choose?

hi, Google results say there are more than 1 singleton template/baseclass in boost, which one do you suggest? Can anyone give me a clue? Thanks ...

Uses of a C++ Arithmetic Promotion Header

I've been playing around with a set of templates for determining the correct promotion type given two primitive types in C++. The idea is that if you define a custom numeric template, you could use these to determine the return type of, say, the operator+ function based on the class passed to the templates. For example: // Custom nume...