I'm just starting to use boost for my embedded C++ programming. Lambda looked interesting so I was reading up on it. When I tried using stl algorithms with lambdas on containers of shared_ptrs I ran into some problems. Doing some searching here on SO led me to a post that indicated Lambda was deprecated and Phoenix was to be used for all new code. As I try to learn more of boost I would like to avoid learning the deprecated parts. Where is this type of thing documented?
In general, the boost documentation will warn you of deprecated features. However, this information sometimes "leaks" out before the docs are updated, which is what seems to have happened in this case. You could always subscribe to one of the developer mailing lists if you really want to be at the cutting-edge, otherwise you should be just fine sticking to the official docs.
Related
I'm still in the process of learning C++ concepts, but I'm fairly comfortable with pointers, references, Object Oriented Programming, and other programming basics. But I still need to learn more about templates, iterators, and regular expressions. Are there any other concepts I should have a firm grounding in to get the best use out of Boost libraries?
There is no such thing as "proper" use of Boost. You use that part of Boost that helps you with your problem. For Boost Test, for example, you don't have to know much about anything specific. For Boost Graph or Algorithm, you should have a good grasp of templates.
Hence, there's no good way to answer your question. Look at the documentation of the library you want to use (Boost or otherwise), and if you think you can handle it, use it. Otherwise, come back here and ask a more specific question. ;-)
You should know how templates and inheritancy works and read carefully the documentation of the module you are planning to use. It should be enough for most cases.
Hard to say since boost is really a collection of libraries. You should have knowledge of the problem domain before using a library. For example, what are threads and how to deal with them before using boost.thread.
As for C++ specific stuff:
You should know what the standard library already provides you.
Have a firm grasp on how to use templates
I'm trying to write a gstreamer plugin in C++, using the GStreamermm bindings. Now, there's a good plugins writers guide (http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/), and on the web there's various examples and templates, but for gstreamermm, there's very little amount of documentation whatsoever.
I know I could just resort to using a mixture of C and C++, but using the C++ bindings seems so much more elegant.
Simply 'translating' the examples found in the gstreamer pwg to gstreamermm is kind of a dead end; gstreamer requires the use of quite a few macros for defining types, which I cannot see an immediate gstreamermm translation to. Additionally, I have only little experience with gstreamer, and absolutely no experience with gobj (so far).
Is anyone able to put me on the right track? Even the tiniest example or explanation would do.
Thanks
I've asked this on the gtkmm mailing list a couple of days ago, and got the following answer (from José Alburquerque):
Presently, the only plug-ins that have a (probably non-existent) possibility of being developed using gstreamermm are ones that are
private to applications. If that's possible, These plug-ins would be
registered using the Gst::Plugin::register_static()[1] method and not
the process that you've described above.
[1] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Plugin.html#ac0728bb285ae1bed9298c0f9ea522ad9
In theory, one would extend one of the gstreamermm base classes[2] and
call the Gst::ElementFactory::register_element()[3] method in the
Gst::Plugin::SlotInit slot (callback) so that an element factory that
generates these elements can be created. That factory can then be
added to the registry using Gst::Registry::add_feature()[4] in the
same Gst::Plugin::SlotInit slot.
[2] http://developer.gnome.org/gstreamermm/unstable/group__GstBaseClasses.html
[3] The Gst::ElementFactory::register_element() method is a method
that is not implemented yet but would wrap the gst_element_register()
function. That would be part of an upcoming release.
[4] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Registry.html#ae1f9a1ddd60ef5a7e1f8cddf14ec404f
I've not tested this and don't really know exactly how it would work
(or if it actually would) but it's how I'd try if I had to. However,
I think it's easier to write the plug-in in C presently, but that's
just a matter of making things easier.
I actually like the clean approach of Boost.GIL, standardized libraries are cool and Adobe certainly put some thought in it but when comparing to libs such as OpenCV its feature set is marginal. Do you use GIL and for what purposes?
Boost.GIL is not dead. There is a few maintainers interested in keeping the project up to date, fixing bugs, helping contributors to bring new features, etc.
Boost.GIL is preparing for refreshing release as part of the upcoming Boost 1.68, including new I/O implementation accepted to Boost.GIL during the official Boost review a longer while ago.
Stay tuned and if you have any specific questions, feel free to post to the official boost-gil mailing list
Boost is a widely accepted set of libraries, but it's not in the C++ standard. So don't feel that you've violated the ANSI/ISO code of conduct by using something that better suits your needs.
Do not use boost gil, recently I tried to use it to do a "complex" task of reading a png file, but for that it requires installing a bunch of libraries that have no install documentation for Windows, and to make matters worse gil documentation suggest the following regarding libpng and libjpeg(in year 2020):
The user has to make sure this library is properly installed. I
strongly recommend the user to build the library yourself. It could
potentially save you a lot of trouble.
I'm wanting to become conversant in the use of the Standard Template Library. If I come across a general reference or beginner's guide published around 1995-97, can I rely on the information in it? How much has STL changed in the last dozen years?
Yes! There are new additions. The TR1 update is now implemented in most environments.
Your older book is still useful to learn the basics. But you will want to find a reference for TR1 to learn about some very useful new features. In a couple of areas, the new features are preferred over older ones. (What comes to mind is bind1st and bind2nd functionality is fully encapsulated in the more general bind construct.)
In addition, there are the boost libraries. (boost.org) Boost is a a collection of libraries, some are very useful, others are obscure. Some of the features in TR1 came from boost, so there is some overlap. There is at least one good book about Boost out there.
Not a whole lot, if at all. The current standard was published in 1998.
cplusplus.com has a more up-to-date reference, which you can compare for yourself.
I'd recommend also that you get a copy of Scott Meyers' Effective STL.
I like the SGI reference to the STL
http://www.sgi.com/tech/stl
Which includes a set of resource for further reading
http://www.sgi.com/tech/stl/other_resources.html
I think that this documentation was done by the crater of the STL (could bee wrong on that).
But the STL has not changed since it was made official.
The new additions for TR1 are currently not officially available but will be part of the new standard. Though you can grab them via boost. Which is another set of libraries you should look at.
The documentation available on the boost website is... limited.
From what I've been able to read, the general consensus is that it is simply difficult to find good documentation on the boost::asio library.
Is this really the case? If so, why?
Notes:
I have already found the (non-boost) Asio website - and the documentation looks to be identical to that on the boost website.
I know that Boost::asio is new! I'm looking for solutions not excuses.
Edit:
There is a proposal to add a networking library to standard library for TR2 written by the author of Boost:asio (Christopher Kohlhoff). While it isn't documentation for boost:asio, it does use it as a base for the TR2 proposal. Since the author put more effort into this document, I have found it to be somewhat helpful, if not as a reference, then at least as an overview.
Some nice documentation on boost including a chapter on asio can be found in a (free) boost book at http://en.highscore.de/cpp/boost/index.html. The chapter on asio provides a general overview and then goes as far as how to develop your own custom asio extensions. Really fantastic effort by Boris Schäling!
First, I've been using Boost.Asio for quite a while already -- and I share your concern. To address your question:
There really is very scarce documentation about Boost.Asio aside from the introduction and tutorial. I am not the author, but this is mostly because there are just too many things to document for something as low-level as an Asynchronous IO Library.
The examples give more away than the tutorials do. If you don't mind spending a little time looking at the different examples, I would think they should suffice to get you started. If you want to run away with it, then the reference documentation should help you a lot.
Ask around in the Boost Users and Boost Developers mailing list if you're really stuck or looking for specific guidance. I'm pretty sure a lot of people will be willing to address your concerns on the mailing lists.
There are efforts (not part of Boost.Asio) to expose a lot of the functionality and possible alternative use cases. This at best is scattered around the web in blogs and other forms of non-packaged documentation.
One thing that is unclear and which will really need close coordination with the author and developers of the Boost.Asio library would be as far as extending and customizing it for a specific platform or adding specific new functionality. This should be improved though but the good thing is it's looking like Asio will be a reference implementation for a standard library technical report (for an asynchronous IO library in the STL) in the future.
I wrote two small articles that could be used as introductions to boost.asio. They are available from my site
NOTE: I have contacted gamedev.net to let them know about the formatting issues. Unfortunately at the time of writing this comment, this resource is more difficult to recommend because of some changes with their website which hide/delete the #include statements + a missing .zip file resource.
A relatively new and very good beginner tutorial for Boost.Asio (which also introduces how to use it effectively with bind, shared_ptr, and threads) can be found here:
http://www.gamedev.net/blog/950/entry-2249317-a-guide-to-getting-started-with-boostasio?pg=1
Note: If you're using c++0x features many of the simple uses of bind for creating a functor can be replaced with lambdas, and shared_ptr/bind are also available in the latest version of visual studio (or gcc which also includes threads.)
When I was searching for documentation or a tutorial this question kept popping up at the top of search results, so it is important to keep it updated as new tutorials come around.
I came along to 3 videos that I've found helpful once you get past the official boost asio overview:
Thinking asynchronously - designing applications with asio
Are you ready for ipv6
Why c-0x is the awesomest language for network programming
And
Thinking asynchronously slides
Are you ready for ipv6 slides
Why c-0x is the awesomest language for network programming
slides
The asio documentation, the one available in boost, is minimalist but very precise, each word is significant. That said,I have learned asio (and continue to learn) mainly from SO.
In my opinion, the answer to 'Confused when boost::asio::io_service run method blocks/unblocks' is the very first step, read an read again until you really understand it, second answer is also helpful.
Then I have RSS subscribed to newest SO boost-asio tag question and to these two answerers:
Tanner Sansburry, the author of the answer above, his answers are always very precise, comprehensive, with references, even beautiful schemas. RSS feed
Sehe (sorry Sehe, only 2nd). RSS feed
With all that material, you will soon be an asio expert !
I was quite curious about that, too but this page gave me some head start. It's in French, but you could use google translate which is pretty readable (I had to follow down this path myself).
http://gwenael-dunand.developpez.com/tutoriels/cpp/boost/asio/
A little late to the party but there's a book out called "Boost Asio Network Programming" (Packt publishing).
I bought a copy of this, read it over the weekend and then wrote a full on server in C++ without much problem.
Disclaimer: I have nothing to do with the book
I stumbled on the following pdf:
http://boost.cowic.de/rc/pdf/asio_doc.pdf