boost

Help with Boost Graph Library and C++

I am trying to use the boost graph library in C++* I want to create a topological sort for my graph. However the output I want on my graph is the actual names of the vertex, not the number positions. For example on the following example I get the following output: A topological ordering: 45 40 41 34 35 33 43 30 31 36 32 26 27 25 23 24 1...

Side effects of global static variables

I'm writing a UDP server that currently receives data from UDP wraps it up in an object and places them into a concurrent queue. The concurrent queue is the implementation provided here: http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html A pool of worker threads pull data ou...

boost spirit v2 compile error - trying to use symbols for something slightly harder and missing an important point somewhere

Hi, I have tried various approaches to fixing this issue with maps and casts, splitting the parse into different sub-pieces, using std::vector directly and trying _r1 etc. but I seem to have failed to grasp something fundamental about the use of attributes. I want to parse a line such as: DEFMACRO macroname param1 param2 param3 ... pa...

How to add boost to my project?

I work on a cross-platform (Windows, Linux, Solaris) project. I want to use Boost's shared_ptr in this project. How can I install it, and redistribute it with the project to the customers? I don't have root permissions on Linux/Solaris, so I probably have to add Boost' sources to my sources, and build it together. Also, our version of...

Date/Time parsing in C++

While doing the data/time parsing in c++ (converting a string in any format to a date), i found the following useful methods 1) strptime() - here the %d, %m etc can have either 1 or 2 characters. The function will take care of that. As a result of this it will enforce that we use a separator between two conversion specifiers. Ex: Its n...

C++ boost forward declaration question

Hello! I spend some time examining boost:: libraries architecture and was interested with the following fact: In some parts of the libraries a yyy_fwd.hpp idea is used pretty common (see boost/detail or boost/flyweight for examples). These files obviously contain only forward declarations of some template-based classes and as far as I...

Boost::Signals encapsulation over network

I am currently involved in the development of a software using distributed computing to detect different events. The current approach is : a dozen of threads are running simultaneously on different (physical) computers. Each event is assigned a number ; and every thread broadcasts its detected events to the other and filters the releva...

c++, boost: how to fill buffer and transfer (image) file data over network ?

Hi! I'm working on an application where I need to send a "filename", "filesize" and the filedata over the network. I created a server using boost which, for now, reads in the filesize and name. I'm wondering how I can fill a buffer with the file data (if necessary) and how to transfer it to the server. This is what I've got now: #i...

Trying to replace my boost::asio::read with boost::asio::async_read

So, the code I started with and which works (with important caveats below) int reply_length = boost::asio::read(*m_socketptr, boost::asio::buffer((char*)reply, 6)); This works, I get the header which I then decode and follow up with another read which gets me my message and then I loop back to the top and read another header. This pe...

C Preprocessor, Macro "Overloading"

Hi, I'm trying to do some kind of Macro "Overloading", so that MACRO(something), gets expanded differently than MACRO(something, else). Using a snippet I got from here (I'm not sure if it's 100% portable) and some functions from the Boost PP Library, I was able to make it work :D //THESE TWO COUNT THE NUMBER OF ARGUMENTS #define VA_NA...

How to build facebook's scribe?

Hi All, I just downloaded the source code of facebook's scribe. I'm new to it and having read the readme.build file , I can say I could barely understand how to build it. Could anyone give me the step by step procedures? thanks... :) ...

Boost documentation problem

I'm trying to view the boost documentation at their website: http://www.boost.org/doc/ But it says Forbidden. Any way I can download the documentation, or get past this error? ...

Input_iterator, find_if and modulus

I implemented an iterator, which has Fibonacci numbers as output. In my main() I'd like to find a number which is dividable by 17 (it's 34). Why doesn't work my find_if statement. Thank you! #include <boost/operators.hpp> #include <algorithm> #include <tr1/functional> struct FibIter: boost::input_iterator_helper<FibIter,uns...

Does boost have portable way to use ntohl/htonl/ntohs/htons type functions?

I am using UDP in particular boost::asio::ip::udp::socket sockets if that helps? What is the header file? What headers/classes do I need to handle network byte ordering with the UDP under boost? ...

block all connections connected to a boost signal

boost signals allows temporarily blocking a connection via a connection member function. However, I have a single signal with many connections. The connections are stored and maintained by their respective listeners. Now the broadcaster decides that it wants to stop sending signals for a while. There does not seem to be a way to iterate ...

How to pass complex objects ( std::string ) through boost::interprocess::message queue

Does anybody have some example code showing the pipeline of serializing a std::string sending it through a boost::interprocess::message_queue and getting it back out again? ...

How can I compress a wide character stream using boost::iostreams?

Hello everyone, I'm working with some code which writes to a wostream. I'd like take its output and write it to a gzip'ed file. This seemed like a good job for boost::iostreams. However, my attempts so far at this haven't been successful. (in all the below, assume using namespace boost::iostreams and that I have some function void my_...

boost library in microsoft c++

i am using microsoft visual c++ 2010 can i use boost library or does it requires different compiler? ...

Boost crash when linking Visual Studio 2008 Express '/Mtd' setting.

TLDR Linking my fresh boost build with Visual Studio (/Mtd) causes boost to throw a 'bad_alloc' exception before entering the main function. Details I built the boost library using the instructions from the Getting Started instructions. After setting up the prerequisites I used the following build command: bjam -j8 --build-dir="C:\De...

+= on a vector without boost

Is there any way to use the += operator with a vector without using boost or using a derivated class? Eg. somevector += 1, 2, 3, 4, 5, 6, 7; would actually be somevector.push_back(1); somevector.push_back(2); somevector.push_back(3); etc. ...