boost

What am I doing wrong with boost::interprocess::message_queue?

I've created a boost::message_queue by the following way: namespace bipc = boost::interprocess; ... try { bipc::message_queue::remove("EDBA90AC-289D-4825-98D9-F85185041676"); // The below throws exception, no matter what's the name of the queue... boost::shared_ptr<bipc::message_queue> mq(new bipc::message_queue(bipc::cr...

handle management with boost::shared_ptr<>

I would like to use boost::shared_ptr<> to encapsulate the lifetime management of a handle. My handle and it's creation/destruction functions are declared like this: typedef const struct MYHANDLE__ FAR* MYHANDLE; void CloseMyHandle( MYHANDLE ); MYHANDLE CreateMyHandle(); Ideally, I would like to use the boost::shared_ptr<> like this ...

Boost autolinks libraries which are not build by Boost, but the intented once are build.

Hello, I am developing a Math application which can be extended by writing python scripts. I am using QT 4.6.3 (build as static library, debug and release versions) and Boost 1.43.0 (build as static library, runtime-link also set to static, multi-threaded version, debug and release). Everything is build with MSVC++2008. The boost build ...

Using a static initializer function

In this contrived example, I have a static initialization function that is run at construction time. I'd like to know if this a legal way to initialize a_, b_, and c_. Or, is it too early in the construction process to use them this way? DWORD SomeInitializationFunction( HANDLE*, DWORD*, DWORD* ); class MyClass { public: MyClass()...

bind two arguments

Consider I have the following struct: struct IDirect3D { IDirect3D() : ref_count_(0) {} unsigned long Release() { return --ref_count_; } private: long ref_count_; ~IDirect3D() {} }; I want to use shared_ptr to it like in the followed code (minimal example): int main() { boost::shared_ptr<IDirect3D> ptr; IDire...

Cmake add_library with boost source files introduces references to non-existant files

Hello all, we're building a cross-platform utility which must have a small footprint. We've been pulling header files from boost as and when we need them but now we must link against some boost C++ thread code. The easiest immediate solution was to create our own custom library using CMake's "add_library" command to create a static libra...

Can I use boost::iostreams with zlib filter for RFC1951-compliant compression?

I'm trying to use boost::iostreams with a zlib filter like this: std::ostringstream oss; boost::iostreams::filtering_stream<boost::iostreams::output> out; out.push(boost::iostreams::zlib_compressor()); out.push(oss); out << requestXML << std::flush; to compress a lump of xml in accordance with RFC1951, however I s...

Boost Filesystem: recursive_directory_iterator constructor causes SIGTRAPS and debug problems

I want to use the recursive_directory_iterator offered by boost::filesystem to delete a directory. But at construction time the debugger stops with the message Signal Received: Sigtrap . I can choose to continue ( have to do it several times because multiple Sigtraps are caught ) and the program will work as expected, but debugging with ...

boost bind template error

//error C2784: 'HRESULT get_wrapper(T *,boost::function<R(void)>)' : //could not deduce template argument for 'boost::function<R(void)>' //from 'boost::_bi::bind_t<R,F,L>' STDMETHODIMP CAttributeValue::get_Name(BSTR* pVal) { return get_wrapper(pVal, boost::bind<BSTR>(&CAttributeValue::getNameCOM, this)); //error here } template <...

Example to use shared_ptr ?

Hi I asked a question today about How to insert different types of objects in the same vector array and my code in that question was gate* G[1000]; G[0] = new ANDgate() ; G[1] = new ORgate; //gate is a class inherited by ANDgate and ORgate classes class gate { ..... ...... void Run() { //A virtual function } }; class ANDga...

Can anyone give some hints or point to a tutorial on how to extract just one specific piece from Boost?

I want to use smart pointers in my code but I can't figure out how to take them out from the Boost. Can anyone give some hints on how to extract things from Boost so that they can be used individually? Thanks, Boda Cydo. ...

HOW-TO: Client connection manager for Boost::asio?

Hi, I created a server using boost:asio. When a client connects it sends a file_size, file_name and the file_data. The server stores this in a file on disk. This works perfectly! Though now I'm running both client application and server application in the main thread of their application (so I've got a server and client app) which block...

Wrapping linked lists in iterators

A set of APIs that I commonly use follow a linked-list pattern: struct SomeObject { const char* some_value; const char* some_other_value; SomeObject* next; } LONG GetObjectList( SomeObject** list ); void FreeObjectList( SomeObject* list ); This API is not mine and I cannot change it. So, I'd like to encapsulate their...

Boost multi_index composite keys using MEM_FUN

Is there a way to use member functions in the specification of composite_key's in boost multi_index_container's? #include <boost/multi_index_container.hpp> #include <boost/multi_index/mem_fun.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/composite_key.hpp> #include <boost/multi_index/member.hpp> #includ...

fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory

I think I did all the necessary configuration but I am still getting this: Error 1 fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory File:c:\documents and settings\administrator\my documents\visual studio 2008\libs\boost_1_43_0\boost\smart_ptr\shared_ptr.hpp Line:17 Here are screenshots of s...

c++ filling matrix boost

hi i've looked into the vector duplicate of this but couldn't find answer ublas::matrix<int> input; fill(input.begin1(), input.end1(), in_val); fill(input.begin2(), input.end2(), in_val); but it gives me [2,3] {(3,3,3) (3,0,0)} as you can guess i just want to fill all of it with init_val=3 , Thanks. ...

Why did Boost's `bcp smart_ptr dir/` copy 6MB of source code?

So I wanted to separate out just the smart pointers from boost to use in my project and I was guided to use bcp utility. Today I got it compiled and did bcp smart_ptr to_copy_to_my_project/. The result: 6MB of code in to_copy_to_my_project/ directory. Are you kidding me? I don't want to add 6MB of header files to my 100KB project just...

Template classes and the friend keyword in c++ (specific example refers to boost::multi_index)

so you have a class employee class employee { public: employee(const string &name, int id) : m_name(name) , m_id(id) {} const string &getName() const { return m_name; } int getID() const { return m_id; } private: string &m_name; int m_id; }; and you have private data members for encapsulation. But now you want to...

Boost Multi_Index Question

Sorry I can't be more specific in the title. Let's say I have a class Foo class Foo { public: Foo() { m_bitset.reset(); } void set_i(int i) { m_bitset.set(1); m_i = i; } void set_j(int j) { m_bitset.set(2); m_j = j; } bool i_set() { return m_bitset(1); } bool j_set() { retur...

Boost.Test application debugging

When debugging a C++ Boost.Test application inside VS2010 (VS2008), how to make the debugger stop at Boost.Test assertion failure points? ...