0
голосов
2ответов
179 просмотров

Regular expressions question

I've got the following string : const std::string args = "cmdLine=\"-d ..\data\configFile.cfg\" rootDir=\"C:\abc\def\""; // please note the space after -d I'd like to split it into 2 substrings : std::str1 = "cmdLine=..."; and std::str2 = "rootDir=..."; using boost/algorithm/string.hpp ....

0
голосов
1ответов
1056 просмотров

C++ char** -&gt; vector<string> -&gt; string -&gt; char** parsing problem</string>

Lets say that I'm trying to solve a parsing problem of string to char ** For some reason the below code generates a lot of trash, can anyone have a look at it please? Here's what it's supposed to do : Dump all argv into a string_array container Dump everything in the string_array container into...

0
голосов
1ответов
964 просмотров

Getting spaces with Boost::regex

I have a chunk of text like: Name=Long John Silver;Profession=cook;Hobby=Piracy And using the Boost::regex library I am trying to get the value of each attribute so I have the following regular expression for Name: regex(".*Name=([^;$]*).*") I understand it as "get everything after Name= u...

1
голосов
4ответов
2763 просмотров

Examples of OpenGL programs with networking code?

I'm wondering if anyone has/knows of any examples of networking code integrated with OpenGL. Basically, I need to send position coordinates of something over a network to my OpenGL display... which would then draw the object at the correct position. The problem I'm having is integrating my UDP...

1
голосов
1ответов
584 просмотров

Can someone post an example of creating a boost inv_adjacency_iterator using inv_adjacency_iterator_generator?

Given definitions: typedef typename boost::graph_traits::adjacency_iterator adjacency_iter; typedef typename boost::inv_adjacency_iterator_generator::type inv_adjacency_iter; I am interested in semantics of boost::tie(i, end) = inv_adjacent_vertices((*start); adjacent_vertices works fine where...

29
голосов
4ответов
2417 просмотров

A Better Boost reference?

The thing that really turns me off about Boost is their documentation. What I need is a good reference, and instead of explaining what a good reference is to me I would give example: java.sun.com/javase/6/docs/api/ Yes I love it. It is also this: cppreference.com/wiki/stl/vector/start On the ...

0
голосов
4ответов
2459 просмотров

C++ reference to a shared_ptr vs reference

All, I recently posted this question on DAL design. From that it would seem that passing a reference to an object into a function, with the function then populating that object, would be a good interface for a C++ Data Access Layer, e.g. bool DAL::loadCar(int id, Car&amp; car) {} I'm now ...

1
голосов
1ответов
1158 просмотров

Excluding boost signal calling

There is a signal and several objects with slots. I want to implement the behavior when one object calls signal and blocks its own connection. I guess a small snippet will be more informative: typedef boost::signal&lt;void()&gt; TSignal; template&lt;class TSignal&gt; class SlotObject { public...

2
голосов
1ответов
283 просмотров

Boost.Regex oddity

Does anyone have any idea why the following code would output "no match"? boost::regex r(".*\."); std::string s("app.test"); if (boost::regex_match(s, r)) std::cout &lt;&lt; "match" &lt;&lt; std::endl; else std::cout &lt;&lt; "no match" &lt;&lt; std::endl;

3
голосов
5ответов
4127 просмотров

How to get rid of C4800 warning produced by boost::flyweight in VS2008

I get a warning when compiling below code in VS2008 with MFC turned on. Boost version 1.39 include "boost/flyweight.hpp" include "boost/flyweight/key_value.hpp" class Foo { public: Foo(const CString&amp; item) : mfoo(item) {} const CString&amp; getkeyvalue() const {return mfoo;} pri...

0
голосов
1ответов
392 просмотров

Memory leak caused by a wrong usage of scoped_lock?

I have a memory leak, and I guess it's caused by a wrong usage of scoped_lock (Boost). I however don't manage to find the exact problem, and I do believe that the way the code has been written is not completely right neither. The code is in this class there: http://taf.codeplex.com/SourceControl...

5
голосов
2ответов
4519 просмотров

How do I make Boost build for i386 on OS X 64 bit?

I've been battling with Boost to make it compile as only 32 bit than 64 bit on a 64 bit OS X host. Is there an easy edit I can make to the darwin-specific bjam config file?

5
голосов
1ответов
1457 просмотров

C++, boost asio, receive null terminated string

How can I retrieve null-terminated string from a socket using the boost::asio library?

1
голосов
5ответов
1739 просмотров

Using Boost Graph to search through a DAG Graph?

I need to search through a DAG graph, but I don't want to advance past a node before I have seen all of the other nodes that have directed links pointing to it. Is there an existing algorithm to handle this particular situation, the depth first search and breath first search don't work for this ...

116
голосов
23ответов
188359 просмотров

Get path of executable

I know this question has been asked before but I still haven't seen a satisfactory answer, or a definitive "no, this cannot be done", so I'll ask again! All I want to do is get the path to the currently running executable, either as an absolute path or relative to where the executable is invoked...

2
голосов
2ответов
983 просмотров

Wildcard search inside a Boost.MultiIndex data structure?

I'm trying to optimize my application by reducing round-trips to my database. As part of that effort, I've been moving some of the tables into memory, storing them as Boost.MultiIndex containers. As a side-effect of this process, I've lost the ability to do wild-card matching on my strings. Fo...

40
голосов
14ответов
31931 просмотров

How to release pointer from boost::shared_ptr?

Can boost::shared_ptr release the stored pointer without deleting it? I can see no release function exists in the documentation, also in the FAQ is explained why it does not provide release function, something like that the release can not be done on pointers that are not unique. My pointers are...

1
голосов
1ответов
1676 просмотров

Boost equivalent of memcpy?

Is there a boost equivalent for memcpy? Thanks! EDIT: Sorry, I didn't realize memcpy was in the standard library :) I thought it was an OS call :(

0
голосов
1ответов
2231 просмотров

QT Eclipse Integration - Adding External Libs

I have set up the latest eclipse+cdt + mingw + qt + qt-eclipse-integration. I have 2 Problems: When i create "New -&gt; Qt Gui Project" it doesn't add the mingw includes (when i click new c++ project it adds them) I would like to use boost, too. How do I tell eclipse/qmake to add the ....

7
голосов
1ответов
4088 просмотров

How to resolve host (only) using Boost.Asio?

According to the documentation of boost::asio::ip::tcp::resolver::query in order to resolve host it should receive service as well. What if I want to resolve host without relation to port? How should I do it at all? Should I specify dummy port?

2
голосов
2ответов
948 просмотров

Binding operator new?

I'd like to bind operator new (see example below). If the constructor doesn't have any arguments, it works fine, but if it does have arguments, I apparently have trouble getting the bind syntax correct. #include &lt;map&gt; #include &lt;boost\function.hpp&gt; #include &lt;boost\lambda\lambda.hp...

10
голосов
6ответов
8031 просмотров

How can I use just one boost library/file?

Possible Duplicate: Building a subset of boost in windows I'm using Visual c++ 6.0, and I'd like to use boost::random. I can't find any examples showing how I would go about just using this and only this library. Can I just include it in my source?

12
голосов
2ответов
3394 просмотров

Boost equivalent of ManualResetEvent?

I'm wondering if there is a boost equivalent of ManualResetEvent? Basically, I'd like a cross-platform implementation... Or, could someone help me mimic ManualResetEvent's functionality using Boost::thread? Thanks guys

20
голосов
9ответов
6594 просмотров

Use a Graph Library/Node Network Library or Write My Own?

I'm trying to decide between going with a pre-made graph/node network library or to roll my own. I'm implementing some graph search algorithms which might require some significant customization to the class structure of the node and/or edges. The reason I'm not sure what to do is that I'm unsu...

3
голосов
1ответов
1463 просмотров

Boost Graph as basis for a simple DAG Graph?

I'm looking at using Boost Graph Library as the basis for a dag graph. I haven't really used it all that much before, so not too familiar with how it works. Although I don't need edge weights and clever traversing algorithms, I would quite like to get the serialisation for free, plus the constra...

4
голосов
2ответов
998 просмотров

Using flyweight pattern to share bitmaps between bitmap objects

Hello stack overflowers, I have a desing that uses the flyweight pattern to share bitmaps that are shared between bitmap objects which manage drawing ops, etc. and integrate in the gui library. This is an embedded device so memory is at a premium. Currently I have done a working implementation wi...

2
голосов
2ответов
620 просмотров

How to manage object life time using Boost library smart pointers?

There is a scenario that i need to solve with shared_ptr and weak_ptr smart pointers. Two threads, thread 1 &amp; 2, are using a shared object called A. Each of the threads have a reference to that object. thread 1 decides to delete object A but at the same time thread 2 might be using it. If i ...

7
голосов
2ответов
2805 просмотров

Is it possible to generate types with all combinations of template arguments?

I have a templated class template&lt;class U, class V, class W&gt; class S { //... implementations }; and some stock type implementations for type U, V and W: typedef boost::mpl::vector&lt;U0, U1&gt; u_types; typedef boost::mpl::vector&lt;V0, V1, V2, V3, V4&gt; u_types; typedef boost::mpl::...

4
голосов
6ответов
1208 просмотров

best lib for vector array in c++

I have to do calculation on array of 1,2,3...9 dimensional vectors, and the number of those vectors varies significantly (say from 100 to up to couple of millions). Of course, it would be great if the data container can be easily decomposed to enable parallel algorithms. I came across blitz++(a...

4
голосов
2ответов
410 просмотров

Why do Boost Parameter elected inheritance rather than composition?

I suppose most of the persons on this site will agree that implementation can be outsourced in two ways: private inheritance composition Inheritance is most often abused. Notably, public inheritance is often used when another form or inheritance could have been better and in general one shoul...