boost

How might one create an extra worker thread for a single threaded GUI application?

I am currently developing new features for an existing VCL application. The application creates charts and static images using a thirdparty package called TeeChart. There is one instance where I have to load in 2 million data points to create a static image chart. However, this takes a while to load and the user can't do anything in the ...

Boost library for RTTI

Hi, which boost library should I use to implement RTTI in my project?? Is it Statechart library? Thanks and Regards, Jabez. ...

Force deletion of slot in boost::signals2

Hi! I have found that boost::signals2 uses sort of a lazy deletion of connected slots, which makes it difficult to use connections as something that manages lifetimes of objects. I am looking for a way to force slots to be deleted directly when disconnected. Any ideas on how to work around the problem by designing my code differently ar...

How can I get a callback when there is some data to read on a boost.asio stream without reading it into a buffer?

It seems that since boost 1.40.0 there has been a change to the way that the the async_read_some() call works. Previously, you could pass in a null_buffer and you would get a callback when there was data to read, but without the framework reading the data into any buffer (because there wasn't one!). This basically allowed you to writ...

boost memorybuffer and char array

Hello, I'm currently unpacking one of blizzard's .mpq file for reading. For accessing the unpacked char buffer, I'm using a boost::interprocess::stream::memorybuffer. Because .mpq files have a chunked structure always beginning with a version header (usually 12 bytes, see http://wiki.devklog.net/index.php?title=The_MoPaQ_Archive_Format#2...

How to get Boost libraries binaries that work with Visual Studio?

Here's a question you may have seen around the 'nets in various forms...summed up here for you googling pleasure :-) I have a project that is built with Microsoft's Visual Studio and uses functionality from boost (http://www.boost.org/). I already have my project working with some of the libraries that are header only (no binary librar...

Virtual destructor for boost:noncopyable classes?

I have a question about the following code: class MyClass : private boost::noncopyable { public: MyClass() {} virtual ~MyClass() {} } class OtherClass : private boost::noncopyable { private: MyClass* m_pMyClass; } My thoughts are that MyClass cannot be copied using construction or assignment. Using a virtual des...

initalize boost::multi_array in a class

Hi to all, for start i would like to say that i am newbie. i am trying to initialized boost:multi_array inside my class. I know how to create a boost:multi_array: boost::multi_array<int,1> foo ( boost::extents[1000] ); but as part of a class i have problems: class Influx { public: Influx ( uint32_t num_elements ); bo...

What's the purpose of a leading "::" in a C++ method call

I've been using the Boost libraries, and in Boost.Exception, I've noticed code like the following: #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) Just out of curiosity: what is the purpose of the leading "::" before "boost::throw_exception(x)"? ...

Linker options for Boost

I'm wondering if there are any simple ways to link boost libraries (all or individual) via some entry like.... -lSDL_ttf The above links SDL's True Type Font library. Can this be done with boost? If so, I'm not sure what file I'm linking for to link. I'm currently using boost_1_40_0. If this isn't possible, or there are better ways t...

Why can't I access a public var using the getter?

having a file containing these statements: public: boost::shared_ptr<TBFControl::TbfCmdHandler> _tbfCmdHandlerPtr; // will be private later... boost::shared_ptr<TBFControl::TbfCmdHandler> getTBFCmdHandler() { return _tbfCmdHandlerPtr; } I can use it this way: boost::shared_ptr<TBFControl::TbfCmdHandler>myTbfCmdHandlerPtr( this->...

How do I create a simple boost::lambda function?

Hi, I'm trying to create a simple function that makes a simple test and return true or false. myfunct = (_3 < someArray[i]); When I do this, I get this error : error: no match for 'operator<' in '<unnamed>::_1 < depths[i]' What I hope is get something equivalent to this bool myFunct(unsigned int a, unsigned int b, unsigned int c, ...

Howto add a link to a library in autoconf configure script / makefile

Hi, I am an autotools newb and I have difficulties figuring out howto easily link a specific library into one of the configured targets. I have a source package that I want to build the usual way: ./configure && make && make install Unfortunately one of the cpps has a missing reference to another library. Compiling it by hand (adjustin...

If-Then-Else Conditionals in Regular Expressions and using capturing group

I have some difficulties in understanding if-then-else conditionals in regular expressions. After reading If-Then-Else Conditionals in Regular Expressions I decided to write a simple test. I use C++, Boost 1.38 Regex and MS VC 8.0. I have written this program: #include <iostream> #include <string> #include <boost/regex.hpp> int ma...

What makes deployment successful for some users and unsuccessful for others?

I am trying to deploy a Visual C++ application (developed with Microsoft Visual Studio 2008) using a Setup and Deployment Project. After installation, users on some target computers get the following error message after launching the application executable: “This application has failed to start because the application configuration is in...

Boost.MPL and type list generation

Background This is for a memory manager in a game engine. I have a freelist implemented, and would like to have a compile-time list if these. (A MPL or Fusion vector, for example). The freelist's correspond to allocation sizes, and when allocating/deallocating objects of size less than a constant, they will go to the corresponding freel...

Is there a simple way to get scaled unix timestamp in C++

I'm porting some PHP to C++. Some of our database code stores time values as unix time stamps *100 The php contains code that looks a bit like this. //PHP static function getTickTime() { return round(microtime(true)*100); } I need something like this: //C++ uint64_t getTickTime() { ptime Jan1st1970(date(1970, 1, 1)); ptime ...

boost regex sub-string match

I want to return output "match" if the pattern "regular" is a sub-string of variable st. Is this possible? int main() { string st = "some regular expressions are Regxyzr"; boost::regex ex("[Rr]egular"); if (boost::regex_match(st, ex)) { cout << "match" << endl; } else { cout << "not match" << endl; } } ...

Extend asynchronous file io in boost::asio to Mac OS X

The boost::asio package contains classes for doing asynchronous file io in Windows using IO completion ports. To my understanding, there is no support for asynchronous file io for other platforms included in the asio package. I am wondering what would need to be done in order to extend asio with asynchronous file io support for at least...

What is wrong with this boost::lambda use?

Why is this boost::lambda expression not working? boost::function<bool (boost::uint64_t, boost::uint64_t&, unsigned int, float)> myFunct = boost::lambda::_3 < 1; I get theses compilation errors, that won't probably help, because they are really cryptic. || In file included from /usr/include/boost/function/detail/maybe_include.hpp:33,...