Dependency Injection framework for C++ [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there a DI framework comparable to Google Guice? And what does Google use?

There is nothing as mature or standard as Guice in the C++ world. However, some people have put together simplistic implementations on their own. Here's a couple.
http://adam.younglogic.com/2008/07/dependency-injection-in-c/ (source for implementation is at the end of the post)
http://sourceforge.net/projects/qtioccontainer/ (requires Qt)
http://code.google.com/p/autumnframework/ (hasn't been touched since 2007)
http://programmaticallyspeaking.blogspot.com/2010/04/beautiful-dependency-injection-in-c.html (more of a description, really)
http://sourceforge.net/projects/cpp-resolver/ ("Alpha" quality)
You're unlikely to be satisfied by any of these.
If you really wanted to put in the effort to rally the world around a DI framework for C++, probably the way to go about it would be to make a proposal to the Boost guys.

I'm the author of wallaroo. It's actively developed and has the following features:
it's lightweight but powerful
its interface supports both C++11 and C++98 with boost
it's type safe
it doesn't need custom preprocessors / code generators
you can load classes defined in shared libraries
you can use a DSL syntax for object creation and wiring or
you can get object creation and wiring by parsing one or more xml / json file.
Any comment, suggestion or request are welcome.

There is a recent one that looks very interesting called Hypodermic, i haven't tested it but it looks pretty active

I am currently authoring one called sauce, whose design (and name) is directly inspired by guice. I still consider it alpha, but you may find it useful.

Related

Source code edition C++ framework [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to include a source code editor inside my software.
The editor should provide at least the following features:
syntax coloration;
syntax validation;
auto-commpletion;
code folding;
inline documentation (displays a called function documentation for example);
extensible, so that it can support more languages in the future; support at least C++, Python, Java, Doc-book, XML, Latex.
Additionnaly, the framework should be in C++, as my own software that wishes to include the framework is in C++ as well. Ideally, it would use the Qt framework.
Finally, it should work at least for GNU/Linux, Mac OS X and Windows.
I wish to avoid develop it myself, as this seems a long and difficult task, and as I expect this need is quite common and many solutions already exist in the outside world.
So far, I only found QScintilla, but I am surprised there is not much more choice.
Do you have any other suggestions ?
Perhaps KatePart is what you are looking for? It's the editor component used in the Kate editor and the KDevelop IDE included in KDE.

C++ Libraries to parsing [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm doing a software to generate animations for algorithms. These algorithms are written in an interpreted language, near to C (more or less a C-oriented pseudocode). Thus, my program must interprets algorithms written in these language. Also, this language will be incremented all the time to support more and more features. The key issue here is to search an library allowing increase the language easily and making easy integrate different parsers in the same program. The app is written in C++ licensed under GPL.
A object-oriented parser is my target solution indeed. I need help to choose a good library with this purposes. Also it's desirable the library is multiplataform and available in official repositories of commons distributions: Ubuntu, Suse and so on.
Actually, I know more or less well the next two libraries/tools:
Flex/Bison++: Both are Flex/Bison wrappers that allow generate C++ code instead of C code, and choose a name for your class. Problems: if you install Flex/Bison++, Flex/Bison are overwritten. I don't want to complicate users if they want compile my code. Moreover, CMake fails search the version number of the library. This can be solved manually, but isn't elegant.
Boost.Spirit: It doesn't have the previous problems and match with all desirable features I described above. But, I've read it isn't fine to parse big languages and to solve grammar ambiguities. Moreover, the compilation times are enormous. But, I love it can compose grammars in a constructive manner. This is very important to make the code/language/programm extensible.
What is your recommendation?

Why C++ can't be made as Python in terms of convenience [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
This question may seem to be naive.
But I think it'll be much worse if I don't ask it at all.
When a discussion begins about the features of Python that the developers love the most, they usually mention list comprehension, syntax relying on indentation (thus avoiding brackets, etc.) and some other.
At such moments I ask myself a question why there can't be made a language based on C++ but having a syntax like in Python and having all the features like list comprehensions, generators.
I understand that such a language won't have all the features that Python has, e.g. eval or exac statements (because they rely on Python being an interpreting language), may be some others that I don't know of.
But I also know that there is a project called Shedskin which makes a C code of a Python code (with some restrictions on what can be used in Python code).
So, are there some real reasons why it's impossible to create such a language that will combine all the best features of Python and a very fast code that produces C++? Or it's just the turn of events that Python for some reasons became very popular and it turned out to be interpreted, so a lot of people use it for its greatest features still discontent at the speed of the code, and some of them struggle to create something (like Shedskin or Psyco) to speed it up?
Google as created a language called Golang ( or Go). It is a compiled language with python like syntaxe. There are alot of video and documenttation that will answer your question there.

Useful features to learn in boost for immediate use [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I know this could be seen as subjective off-the-cuff (thus a poor question), but bear with me.
Boost has recently become available on the project on which I'm working, and I don't have much experience with it. Boost has so many parts and features that it's hard to know where to get started in learning it - especially since I'll be trying to learn it while making production code.
So, I would greatly appreciate it if someone could list around 3 to 5 features which are very useful in general, every-day programming and state why they're useful. I'm not asking you which is best, or trying to get a debate - I just want to know some good features to start learning and using immediately. I don't need code samples either, I'll be more than happy to research how to use the features myself after I know which ones are sensible to start learning now.
I'll accept any answer with a concise list of features that are sensible :)
format and lexical_cast are great for string manipulation, I find them invaluable. I use them every day.
bind is great for ad hoc functors, you'll find it is reused throughout many of the boost libraries.
multi_index fills the gap of when you need the same data in two search structures at once, it is very handy at times. Keep it out of your headers though.
type_traits defines useful traits for template specializations.
signals is a signal/slot mechanism implementation, great for event driven designs.
shared_pointer is critical. It lets you automatically handle memory usage.
http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/shared_ptr.htm

Open source examples of well designed applications [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Do you know of well designed open source applications that are instructive to analyse?
Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality.
If you include well designed open source libraries that are instructive to analyse, have a look at Boost.
About persistence / serialization (not relational mapping though), have a look at Boost Serialization, you might find nice ideas!
"...one of the most highly regarded and expertly designed C++ library projects in the world."
— Herb Sutter and Andrei Alexandrescu, C++ Coding Standards
"Item 55: Familiarize yourself with Boost."
— Scott Meyers, Effective C++, 3rd Ed.
"The obvious solution for most programmers is to use a library that provides an elegant and efficient platform independent to needed services. Examples are BOOST..."
— Bjarne Stroustrup, Abstraction, libraries, and efficiency in C++
While this doesn't fit your specific requirements (it's not a business app for a start), I think that OGRE 3D is a great example of an open source C++ project.
V8 javascript engine is said to be very well engineered. http://code.google.com/p/v8/
Google Chrome also has an interesting architecture and high quality code base. http://code.google.com/chromium/
Both are open source, under BSD-like license.