n.torrey.pines | 1 Mar 04:51
Picon

[filesystem] ..\foo\bar - invalid path syntax?

Hi

As you know, on Windows, it is conventional to use backslashes in paths. 
I am not out to teach Windows users a different convention, let alone 
"generic syntax". So I'd like to construct paths from strings like 
..\foo\bar.

The constructors like path(const std::string&) treat this as an invalid 
syntax however (changing '\' to '/' works fine).

Is there a different procedure I should invoke that respects the native 
platform syntax? I've looked in the docs, but I didn't find it. There 
are only procedures for native printing.

I could of course manually replace '\' with '/' in the string, but such 
solution probably wouldn't be very robust.

Thanks
Diego Molla | 1 Mar 06:53
Picon
Picon
Favicon

Re: Problem using regex library in Windows/cygwin

Thanks John, spot on. I've used a new iterator variable for the result of  
regex_search and it works now. Now the code is:

if (regex_search(what[1].str(),what2,attrMarkup)) {

> There's at least one issue with your code, in:
> if (regex_search(what[1].str(),what,attrMarkup)) {
> the result of what[1].str() is a temporary string object: by the time the
> call returns the object has gone out of scope, and the iterators stored  
> in
> "what" are invalid.
> HTH, John.

Diego

--

-- 
Do you want to know what is going on in Language Technology in
Australia and New Zealand? Join ALTA -- http://www.alta.asn.au/

     This message is intended for the addressee named and may
     contain confidential information.  If you are not the intended
     recipient, please delete it and notify the sender.  Views expressed
     in this message are those of the individual sender, and are not
     necessarily the views of Macquarie University.

---------------------------------------------------------------------
Diego MOLLA ALIOD                                 diego <at> ics.mq.edu.au
Department of Computing               http://www.ics.mq.edu.au/~diego
Macquarie University
(Continue reading)

tricycle | 1 Mar 11:54
Picon

Performance of object_pool

The most important reason to use a memory pool is performance. BUT object_pool 
doesn't!

When I use object_pool to construct a lot of objects, the destroy method 
become very slow. And I found object_pool use ordered_free to free the memory, 
and it amortized O(N). It is a very serious problem, I hope it can be fixed in 
the next release. 

thanks.
Aaron Windsor | 1 Mar 12:51
Picon
Gravatar

Re: [BGL] - filesystem graph

On 2/28/07, Shams <shams <at> orcon.net.nz> wrote:
> Hi,
>
> I would like to know how to "best" represent a filesystem using BGL.
> In this case the filesystem I want to describe is the unix/linux filesystem
> and its various paths from the root node "/".

Hi Shams,

> My questions:
> 1. What kind of graph is this filesystem and what is best to use in BGL to
> describe this?

The graph defined by the hard links is a tree. The BGL graph you use would
depend on what you want to do. For instance, you might want to use a directed
graph with edges pointing from a directory to each of its contents, but I'd have
to know more about what you want to do to suggest anything.

> 2. How can I also best describe symbolic links (symlinks) and what kind of
> graph
> would this be, does this graph defer from the above?

Symbolic links can create cycles in the graph, so that the graph is no longer
a tree. You can use edge properties to specify the type of link an edge
represents here - filtering on the hard link properties gives you a tree.

> 3. How can I describe the metadata of a file (including symlinks) using BGL
> eg. given a path /usr/bin/ls I also want to stores its creation date, acl
> etc in BGL,
> how can I best describe this, is there where properties come in handy?
(Continue reading)

Frank Mori Hess | 1 Mar 15:38
Favicon
Gravatar

Re: [signals] dropping ThreadingModel template parameter


On Wednesday 28 February 2007 18:19 pm, Timmo Stange wrote:
> Gottlob Frege wrote:
> >
> > What if I want to use a single-threaded signal in a multi-threaded
> > program?  ie some of my signals are multi-threaded, but I also have
> > some signals (for UI updates?) that will only ever be on the main/UI
> > thread.
>
> Yes, same here. I also would like to set deferred notification (through
> a message queue) on top of signals where that is advised for performance
> reasons. There are several scenarios in which you can ensure the thread-
> safety externally and use a single-threaded signal.

I guess if that's what the people want.  Allthough, I note that more 
ubiquitous and lower-level libraries like smart_ptr have gotten away with 
not providing a thread-safety template parameter.  In any case, a problem 
I'd like to address is how painful it currently is to declare a 
thread-safe signal, the threading model being at the end of a long list of 
template parameters.  Two possibilities come to mind.  One is making 
lightweight_mutex the default ThreadingModel, maybe called "auto_threaded" 
and still providing single_threaded and multi_threaded for those 
determined enough to plow through all the template parameters.  The other 
is providing a templated typedef class that uses a tweaked set of defaults 
for the template parameters appropriate for thread-safety.  For example,

mt_signal<Signature>::type

might be a signal type using last_value<optional<R> > for the combiner and 
signals::multi_threaded for the ThreadingModel.
(Continue reading)

misiu | 1 Mar 11:47
Picon
Favicon

Re: boost 1.33.1 + qt 3.3.7 free on linux


> Did you try gdb? 
No, because I've never used it so for. I'm thinking whether there is 
already known problem with combining Qt and boost. As I wrote I'm 
developing everything on Windows and then porting to Linux.

Regards,
Bartek
Frank Mori Hess | 1 Mar 15:51
Favicon
Gravatar

[signals] per slot mutexes


I've got thread_safe_signals working with a single mutex per signal, which 
is only locked/unlocked once per signal invocation.  However, it is 
causing problems with deletion_test.cpp.  The deletion test checks if a 
slot is able to disconnect another slot which is ordered later in the same 
signal invocation.  From the signals docs:

"If a signal/slot connection is disconnected at any time during a signal's 
calling sequence, the calling sequence will still continue but will not 
invoke the disconnected slot."

When the list of blocked slots is created at the beginning of signal 
invocation, before running any slots, then the signal invocation never 
notices that a later slot has been disconnected by an earlier slot.  It 
seems to me the only solutions are to either keep per-slot locking, or to 
drop the requirement that the signal recognize changes to the connection 
status that happen while the invocation is in progress.  I don't have a 
good feel for how important a feature this is.  My inclination is to just 
keep per-slot locking.

--

-- 
Frank
Picon
Favicon

Re: boost 1.33.1 + qt 3.3.7 free on linux

I've been happily using Boost 1.33 with Qt 3.3.3 with gcc 3.4.4 on
Fedora.

Regards,
Randy

-----Original Message-----
From: boost-users-bounces <at> lists.boost.org
[mailto:boost-users-bounces <at> lists.boost.org] On Behalf Of misiu
Sent: Thursday, March 01, 2007 4:47 AM
To: boost-users <at> lists.boost.org
Subject: Re: [Boost-users] boost 1.33.1 + qt 3.3.7 free on linux

> Did you try gdb? 
No, because I've never used it so for. I'm thinking whether there is
already known problem with combining Qt and boost. As I wrote I'm
developing everything on Windows and then porting to Linux.

Regards,
Bartek

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Jeffrey Holle | 1 Mar 17:54

Re: [the Boost Graph library] no matching function : vertices(const Graph& g)

Gerd Menche wrote:

> Is there a different vertices() function defined
> anywhere, that gets in the way?
>

Yes, boost::graph defines a vertices templated function for each type of 
graph.  It returns a bounding iterator pair to the vertices of the 
graph.  Its one parameter is a "const Graph&".

There is also an edges function that provides similar access to the 
graph's edges.
n.torrey.pines | 1 Mar 19:09
Picon

[filesystem] why no exceptions?

Wouldn't it make more sense for

filesystem::ifstream in("invalid_file_name");

to throw an exception rather than treat the error in the old fashion?

Gmane