Need a solid dictionary/map/query interface
Hello, A little background, we've got Visual Studio 2008 C++/CLI library through which we'd like to expose a dictionary-mapped data abstraction. We'd like to be able to ask some questions about the dictionary mapping, whether for its keys, values, or some combination thereof. I've got a strong background in C# particularly with regard to its Generic Collections and the Linq area. This is how I'd like to think of the dictionary questions. The rub of course is that the support for C++/CLI Linq is rather slim, if at all. Does boost offer something along these lines comparable to Linq? Thanks... Best regards, Michael
A little background, we've got Visual Studio 2008 C++/CLI library through which we'd like to expose a dictionary-mapped data abstraction. We'd like to be able to ask some questions about the dictionary mapping, whether for its keys, values, or some combination thereof.
I've got a strong background in C# particularly with regard to its Generic Collections and the Linq area. This is how I'd like to think of the dictionary questions. The rub of course is that the support for C++/CLI Linq is rather slim, if at all.
Does boost offer something along these lines comparable to Linq?
If you mean sql-like syntax, then the answer is most likely no. However, putting syntax aside, MultiIndex offers very powerful and flexible facilities. Sometimes you can also combine it with Lambda or Phoenix to get some "syntactic sugar", like this: http://www.boost.org/doc/libs/1_47_0/libs/multi_index/doc/tutorial/basics.ht...
On Sat, Sep 24, 2011 at 11:00 AM, Igor R
A little background, we've got Visual Studio 2008 C++/CLI library through which we'd like to expose a dictionary-mapped data abstraction. We'd like to be able to ask some questions about the dictionary mapping, whether for its keys, values, or some combination thereof.
I've got a strong background in C# particularly with regard to its Generic Collections and the Linq area. This is how I'd like to think of the dictionary questions. The rub of course is that the support for C++/CLI Linq is rather slim, if at all.
Does boost offer something along these lines comparable to Linq?
If you mean sql-like syntax, then the answer is most likely no.
Well, not SQL-like exactly. In the C# world, I utilize the Linq extension methods almost exclusively and find that this meets 90% of our needs. So even if that had to appear like Where(my_list, () => { /* a lambda */ }), this would be perfectly fine.
However, putting syntax aside, MultiIndex offers very powerful and flexible facilities. Sometimes you can also combine it with Lambda or Phoenix to get some "syntactic sugar", like this:
http://www.boost.org/doc/libs/1_47_0/libs/multi_index/doc/tutorial/basics.ht...
May be worth looking into, thanks. For now, I'm going with STL/NET for its .NET-friendly map<> since I want to map C++/CLI managed classes into the structure. It's a little more work, but not a lot more work, to get at the keys and/or values for the questions we want to ask. This requirement may out-weigh using boost-collections, etc. Thanks for the response. ______________________________________________
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
A little background, we've got Visual Studio 2008 C++/CLI library through which we'd like to expose a dictionary-mapped data abstraction. We'd like to be able to ask some questions about the dictionary mapping, whether for its keys, values, or some combination thereof.
Does boost offer something along these lines comparable to Linq?
If you mean sql-like syntax, then the answer is most likely no.
If you are up to creating your own Domain Specific Language, look at boost::spirit.
From a different perspective, in free associating brain jump, if you actually want to use database structures and an approximated inline query language you could try emweb's dbo:
http://www.webtoolkit.eu/wt/doc/tutorial/dbo/tutorial.html -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
On Sat, Sep 24, 2011 at 11:18 AM, Raymond Burkholder
A little background, we've got Visual Studio 2008 C++/CLI library through which we'd like to expose a dictionary-mapped data abstraction. We'd like to be able to ask some questions about the dictionary mapping, whether for its keys, values, or some combination thereof.
Does boost offer something along these lines comparable to Linq?
If you mean sql-like syntax, then the answer is most likely no.
If you are up to creating your own Domain Specific Language, look at boost::spirit.
Nosir, probably overkill for what we're considering. I'd located Continuous Linq (CLINQ), but it seems to be somewhat stale or lacking support? Anyhow, it's the same old argument, C++/CLI is a second class citizen in the .NET realm, which is really what we want: to be able to use the Linq (or similar) extensions on some .NET collections like Dictionary (best case), or do some work through STL/NET map (acceptable, but far from "efficient" for the questions I'd like to ask "ad hoc").
From a different perspective, in free associating brain jump, if you actually want to use database structures and an approximated inline query language you could try emweb's dbo:
http://www.webtoolkit.eu/wt/doc/tutorial/dbo/tutorial.html
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Igor R
-
Michael Powell
-
Raymond Burkholder