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...
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 ...
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 ...
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()...
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...
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...
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...
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 ...
//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 <...
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...
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.
...
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...
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...
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...
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...
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.
...
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...
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...
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...
When debugging a C++ Boost.Test application inside VS2010 (VS2008), how to make the debugger stop at Boost.Test assertion failure points?
...