[boost] boost::random problem
Hi, Trying to use the new random library on borland gives runtime problems. The following program below gives a constant result of 85. I have tracked the problem to variate_generator.hpp, where the internal engine type is computed typedef typename random::detail::engine_helper::BOOST_NESTED_TEMPLATE impl::type internal_engine_type; In the example program it is using uniform_int_float instead of uniform_01 (engine_helper instead of engine_helper) I could patch the engine_helper to work using mpl::bool_, but the dependency is probably not wanted? Regards, Hugo #include "boost/random/mersenne_twister.hpp" #include "boost/random/normal_distribution.hpp" #include "boost/random/variate_generator.hpp" #include int main(int,char**) { boost::mt19937 generator; boost::normal_distribution<> normal_dist(85,88); boost::variate_generator > normal(generator, normal_dist); for (std::size_t i=0;i<100;++i) std::cout << normal() << std::endl; } ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: bind and __fastcall
On Fri, 4 Jul 2003 20:12:40 +0300, Peter Dimov <[EMAIL PROTECTED]> wrote: Seems like the compiler can't handle __fastcall (and __stdcall) function pointers properly as required by bind. I was under the mistaken impression that __fastcall was a borland only thing. __fastcall member functions appear to work, though, if you remove BOOST_BIND_ENABLE_FASTCALL and leave only the BOOST_MEM_FN_ENABLE_FASTCALL define. Working well. Thank you Peter :-) ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] bind and __fastcall
Hi, I am trying to use bind with __fastcall member funtion. Just including bind.hpp with BOOST_BIND_ENABLE_FASTCALL defined is giving compile errors on bcc 5.5 and cbuilder 6 with patch 4. Am I missing something, or is this broken? Hugo #define BOOST_BIND_ENABLE_FASTCALL #define BOOST_MEM_FN_ENABLE_FASTCALL #include "boost/bind.hpp" Error E2188 c:\usr\boost\boost/bind/bind_cc.hpp 17: Expression syntax + Full parser context + bind_test.cpp, line 24: #include c:\usr\boost\boost/bind.hpp + c:\usr\boost\boost/bind.hpp, line 42: namespace boost + c:\usr\boost\boost/bind.hpp, line 1496: #include c:\usr\boost\boost/bind/bind_cc.hpp ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] mpl size::type varies across compilers
Aleksey and all, mpl::size returns integral_c on gcc, vc7.1 but integral_c on bcc564. Is this intentional? I am writing specialisations of classes instantiated with the result of mpl::size. The above difference in types means that the specialisations have to be different for bcc. If this is unavoidable could we have (or does it already exits?) a typedef for the the fundamental integer type used in the returned integral type constant? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Eric Ford's Unit package
On 6 Mar 2003 00:34:23 -, Eric Ford <[EMAIL PROTECTED]> wrote: This looks most interesting, and there most definitely remains a great need for a units handling package. Definitely! - SIUnits includes some "advanced" features which introduce run-time cost, while my library does not include such features. The main example is the ability within SIUnits to change at runtime that a dimensioned quantity should be displayed in terms of various units (introducing an automatically applied scale factor) and with various labels (used when printing). While I "power user" could implement this within my framework (e.g., by specializing scale and label in mks_tag), I don't see much point. If I want a time in years rather than seconds (default in mks), I can easily write cout << time_till_graduation / year; I have found in the past that there is a need to distinguish between dimension handling and unit handling. In the case of a physical calculation, I usually ensure that the code works with a self consistent set of units, and thus only need dimensionality, compile time, code. Units then become important only in the user interface, and I have a list of the units used in the physical calculation for each dimension. This is obviously only one way of using dimensions and units, but I think an important one. The usual exception to the above is for money where you are working with multiple currencies. A couple of use cases, that I am unsure would be handled by the current proposal: I have a "Cost" class that records costs for different factories in different countries. The "unit" used for each is factory is different, eg USD for factories in US, GBP for those in UK. ie the unit varies per instance. A similar situation occurs for "dimensions" of physical units. eg. if you want a list of quantities used per output weight or output pieces, then each item in the list has different dimensions, eg. Watt seconds/time, Litre/piece, number/kg. In this case I obviously have to give up the type checking, but still need to be able to record a dimension, to allow display in appropriate units. - My library allows for users to add qualifiers to dimensioned quantities which are strongly typed by default. Users may choose weak typing (e.g., automatic conversion from mass of apples to mass of fruit or allowing a sum of mass of apples and mass of oranges to equal a mass of fruit) by relatively easy specializations. Excellent! Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] BOOST_PP_XX_INCCLUDE
On Mon, 27 Jan 2003 12:42:14 -0800, "Paul Mensonides" <[EMAIL PROTECTED]> wrote: > #define BOOST_PP_HEADERS \ > (...), /* i.e. "no path" */ \ > (iostream)(fstream)(vector)(string) \ > (map)(cstdlib)(sstream) \ > /**/ > > ??=include BOOST_PP_ANGLED_INCLUDE() > > effectively does this: > > #include > #include > #include > #include > #include > #include > #include Looks good to me. > > The other problem that I have when using this is that it removes > > dependencies for the build process. To solve this, the files can > > be preprocess. Is there a standard toolset/method for preprocessing > > header files ? > > I'm not sure what you mean here. I would like to take a file that uses BOOST_PP_HEADERS, say > #define BOOST_PP_HEADERS \ > (...), /* i.e. "no path" */ \ > (iostream)(fstream)(vector)(string) \ > (map)(cstdlib)(sstream) \ > /**/ > > ??=include BOOST_PP_ANGLED_INCLUDE() and preprocess it to generate the file that says > #include > #include > #include > #include > #include > #include > #include > You can simply make a source file that includes all the files that you want > to pre-preprocess (if that is what your getting at), run it through your > compiler's preprocessor, and then include the result file. I don't think bjam supports just running the preprocessor, but as you say the poblem is more tricky; I would like to stop preprocessing at a certain include depth. > but this is outside the scope of the pp-lib can automate because it > requires a separate build step to produce the preprocessor equivalent of a > "pre-compiled header." I didn't mean to imply it was within scope. I know MPL does preprocessing using python, but I don't know how reuseable that code is, so I was just hunting for tips, suggestions and pointers. Thanks for your help. Look forward to seeing BOOST_PP_INCLUDE when you have time. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: Re: MPL include problem with BOOST_PP_ITERATE
Aleksey, On Sat, 25 Jan 2003 11:53:50 -0600, Aleksey Gurtovoy <[EMAIL PROTECTED]> wrote: > would the BOOST_PP_ANGLED_INCLUDE() mechanism Paul referred to in another > message in this thread help you to implement what you are currently trying > to do with BOOST_PP_ITERATE()? Yes > If it would, let's pursue that solution, > then, since your case _is_ somewhat special and apparently is in conflict > with "recommended" usage of file iteration mechanism. Fine with me. Thanks for looking at this. The combination of PP and MPL is very powerful, and is stimulating interesting ideas! Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Re: MPL include problem with BOOST_PP_ITERATE
On Fri, 24 Jan 2003 16:51:47 -0800, "Paul Mensonides" <[EMAIL PROTECTED]> wrote: > The problems involved are not as easy to solve as > you're are suggesting (see my other post in response to Aleksey). Thanks for the explaination - I don't consider any advanced use of the preprocessor "easy" - I am just happy to use a library that does all the difficult bits :-) > At one point in the past, however, I wrote a mechanism explicitly for > including a set of files. It was intended to "shorthand" the process of > including a lot of files from the same library. Something like: > > #define BOOST_PP_HEADERS \ > (boost/preprocessor, > (tuple/elem.hpp)(repetition/repeat.hpp)(list/adt.hpp)) \ > /**/ > > #include BOOST_PP_ANGLED_INCLUDE() > > (I had BOOST_PP_QUOTED_INCLUDE as well.) I'd be happy to add such a > mechanism, but I'd like to hear what people want from the mechanism and any > thoughts on syntactic issues, etc.. BOOST_PP_xx_INCLUDE( directory, list_of_filenames_with_paths ) is good as long as directory can be empty, for the case where the filenames have different paths. The other problem that I have when using this is that it removes dependencies for the build process. To solve this, the files can be preprocess. Is there a standard toolset/method for preprocessing header files ? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL include problem with BOOST_PP_ITERATE
Usage may be clearer with some code leaving out pp includes. The file models/Furnace.h includes IncludeAllModels.h #define SUBCLASS_LIST \ BOOST_PP_TUPLE_TO_LIST( \ 3, \ ( \ Slitter, \ Scalper, \ Furnace \ ) \ ) \ //< List of all models #define FILE_SUFFIX .h #define FILE_PATH models/ #define LIST SUBCLASS_LIST #include "ComputedInclude.h" ComputedInclude.h #define LIST_SIZE BOOST_PP_LIST_SIZE (LIST) #define ITER_SIZE BOOST_PP_DEC (LIST_SIZE) #define BOOST_PP_ITERATION_LIMITS (0, ITER_SIZE) #define BOOST_PP_FILENAME_1 "ComputedIncludeIteration.h" #define HARPS_CI 1 #include BOOST_PP_ITERATE() #undef HARPS_CI ComputedIncludeIteration.h #define ITER BOOST_PP_ITERATION() #define THIS_ITEM BOOST_PP_LIST_AT ( LIST, ITER) #define FILE_NAME BOOST_PP_CAT (THIS_ITEM, FILE_SUFFIX) #define FULL_NAME BOOST_PP_CAT (FILE_PATH, FILE_NAME) #define FN BOOST_PP_STRINGIZE (FULL_NAME) #include FN ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL include problem with BOOST_PP_ITERATE
On Fri, 24 Jan 2003 17:01:21 -0500, David Abrahams <[EMAIL PROTECTED]> wrote: > Hugo Duncan <[EMAIL PROTECTED]> writes: > > > I think I have found a problem with boost/mpl/list.hpp > > > > I am including files using BOOST_PP_ITERATE. One of the files > > that I include happens itself to include boost/mpl/list.hpp. > > Normally you shouldn't be making general #includes inside a vertical > iteration loop. Why don't you just hoist the include of > ? Maybe my use of ITERATE is slightly different, in that I am using it to include a LIST of files. The LIST provides a single integration point. Hoisting all the includes reduces the utility of using ITERATE. I can hoist the include of (and have done so for the moment), but I don't think that I should have to. The way I look at it, the fact that MPL uses ITERATE in its header files is an implementation convenience for MPL, and should not be visible to the user. But that's just my opinion, and I may have misunderstood how MPL is using ITERATE, and/or the purpose of ITERATE. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL include problem with BOOST_PP_ITERATE
On Fri, 24 Jan 2003 13:53:00 -0800, "Paul Mensonides" <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: "Hugo Duncan" <[EMAIL PROTECTED]> > > > I am including files using BOOST_PP_ITERATE. One of the files > > that I include happens itself to include boost/mpl/list.hpp. > > I'm not sure what you mean here. If you are iterating over a file (or > section of a file) with the file-iteration mechanism. That iterated text > should *never* include regular headers. Paul, I was not aware of that restriction - it doesn't seem to be mentioned in the docs. > [Snipped example] > > It is defined when the file-iteration mechanism is iterating over a file. > Its purpose is to distinguish between a normal inclusion and an "iteration" > inclusion so that the same file can iterate over itself. When a file that > is iterated includes other files *during an iteration*, > BOOST_PP_IS_ITERATING is still defined and the other files probably won't > know how to handle it. ( is one example of this.) The > solution is simply to not include any files during a particular iteration. This, for me, is a nuisance, as the files that I am including through ITERATE are included individualy at times, and could add header dependencies that I do not know about elsewhere. The reason for my using ITERATE is to be able to provide an extensible list of files to include as a single extension/maintenance point for my library, so having to write 2.hpp reduces the incentive to use ITERATE in the first place. I still think that this could be solved by checking something like the following in #if !BOOST_PP_IS_ITERATING || !BOOST_MPL_PREPROCESSING_MODE Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] MPL include problem with BOOST_PP_ITERATE
I think I have found a problem with boost/mpl/list.hpp I am including files using BOOST_PP_ITERATE. One of the files that I include happens itself to include boost/mpl/list.hpp. boost/mpl/list.hpp begins #if !defined(BOOST_PP_IS_ITERATING) / header body #ifndef BOOST_MPL_LIST_HPP_INCLUDED #define BOOST_MPL_LIST_HPP_INCLUDED Because I am using BOOST_PP_ITERATE, BOOST_PP_IS_ITERATING is defined, and problems occur. I assume BOOST_PP_IS_ITERATING is checked for logic associated with preprocessed file generation. Is it possible to combine the check with a library macro that is defined when preprocessed files are generated ? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: RE: Re: MPL usage for code generation
On Fri, 24 Jan 2003 10:44:58 -0600, Aleksey Gurtovoy <[EMAIL PROTECTED]> wrote: > Good, thank you. Fixed in the CVS now - please check if it works and report > back. Aleksey, Thanks! Works. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: Re: MPL usage for code generation
On Fri, 24 Jan 2003 09:17:00 -0600, Aleksey Gurtovoy <[EMAIL PROTECTED]> wrote: > I don't have access to 5.6.1, so I would need some cooperation to fix it. 5.6.1 is 5.6 with patch 2 applied. I *think* this is the same as kylix compiler, though I haven't run the latter. > Off the top of my head, can you please check if changing the offending line > from > > static int const value = F::arity; > > to > enum { value = F::arity }; > > helps at all? Making this change allows test/for_each.cpp to run correctly Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL usage for code generation
On Wed, 22 Jan 2003 16:25:40 -0800, "Andrei Alexandrescu" <[EMAIL PROTECTED]> wrote: > > inline void do_my_function(string&, void_) {} > > template > inline void do_my_function(string& s, Lst lst) > { > my_function::type>(s); > do_my_function(s, pop_front::type()); > } > > do_my_function(s, my_list()); > This is interesting as it also gives run-time control of how much of the list is iterated over. eg. template inline void do_my_function(string& s, Lst lst) { if (!my_function::type>(s)) do_my_function(s, pop_front::type()); } ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Re: MPL usage for code generation
On Thu, 23 Jan 2003 11:22:02 -0500, David Abrahams <[EMAIL PROTECTED]> wrote: > Hugo Duncan <[EMAIL PROTECTED]> writes: > > > Including for_each.hpp on bcc561 gives > > > > Error E2230 > > c:\usr\boost\boost/mpl/aux_/preprocessed/bcc/template_arity.hpp > > 20: In-line data member initialization requires an > > integral constant expression > > > > Any chance of finding a fix for this? I am having > > problems working through the code to see what to > > change. > > Is this with the CVS or with boost 1.29.0? > I don't think Borland support was very solid at 1.29.0. > > BC551 processes for_each.hpp just fine at the moment. With current CVS. BC551 works fine for me too (with lots of warnings) ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL usage for code generation
Including for_each.hpp on bcc561 gives Error E2230 c:\usr\boost\boost/mpl/aux_/preprocessed/bcc/template_arity.hpp 20: In-line data member initialization requires an integral constant expression Any chance of finding a fix for this? I am having problems working through the code to see what to change. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: MPL usage for code generation
Thanks! Works a treat and is even intelligable once you have seen it ! Just need to get bcc561 to accept it now . Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: MPL usage for code generation
On Wed, 22 Jan 2003 18:23:50 -0500, "Rozental, Gennadiy" <[EMAIL PROTECTED]> wrote: > > I have looked for code to copy in test/examples/mpl paper and > > have not found anything similar to what I need (which doesn't > > mean it isn't there somewhere). Any pointers? Is this possible? > use for_each I tried. for_each seems to default construct an instance of each type, which is unfortunately not possible for my application. Is this what you had in mind? What I am I missing? mpl::for_each(&my_function<_1>(s)); ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] MPL usage for code generation
I am trying to use MPL to generate code. I have a list of types, which I would like to use to call a template function with arguments that are not dependent on the list. eg given: template void my_function(std::string& s); typedef list my_list; std::string s; what do I write using MPL to generate the equivalent of the following ? my_function(s); my_function(s); my_function(s); I have looked for code to copy in test/examples/mpl paper and have not found anything similar to what I need (which doesn't mean it isn't there somewhere). Any pointers? Is this possible? Thanks Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Re: sockets library question
On Mon, 13 Jan 2003 19:31:03 -0700, Jeff Garland <[EMAIL PROTECTED]> wrote: > I believe we have gradually built enough > base that if we could find a few volunteers with a some > time to invest we could finally get a kernal of the library > available for review. There is a basic low level socket implementation (socket_base), and Michel André has put together an extension of this for the asynchronous methods on NT. At this stage we need to decide what would be the scope of an initial submission. Is the basic socket design useful in itself, or would the proactor and reactor patterns be required for the library to have any meaning? Is the level 1 design (without reactor/proactor classes) sufficient for client usage? Ultimately I would like to hope that we can build a framework where the choice of procator, reactor and threading decisons can be completely seperated from the application code, with these decisions being implemented as policies. But that is going to take quite a while to get right So far everythng has been tested on NT only (vc7, bcc, gcc), so we are especially in need of volunteers for trying things out on unix platforms. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: re: Borland regression test failures
On Fri, 13 Dec 2002 20:16:18 GMT, Hugo Duncan <[EMAIL PROTECTED]> wrote: > This gets rid of most of the failures > oops, cut and paste error. try this RCS file: /cvsroot/boost/boost/boost/mpl/bool_c.hpp,v retrieving revision 1.3 diff -r1.3 bool_c.hpp 38c38 < using mpl::bool_c; --- > //using mpl::bool_c; ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: re: Borland regression test failures
On Fri, 13 Dec 2002 14:59:37 -0500, Beman Dawes <[EMAIL PROTECTED]> wrote: > At 07:54 AM 12/13/2002, John Maddock wrote: > It is failing on filesystem tests which include only a few headers. I'll > start a process of elimination. > This gets rid of most of the failures diff -r1.3 bool_c.hpp 44c44 < } // namespace boost --- > } // namespace boost ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Win32/Borland failures
On Fri, 13 Dec 2002 12:20:38 -, "John Maddock" <[EMAIL PROTECTED]> wrote: > I still can't reproduce the problem: for example I tried array1.cpp with > Builder 4, 5 and 6, and all are compiling fine with the latest cvs, so it's I am also getting assertion failures compiling array1.cpp with 561 from the command line. Compiling the file from ide works fine. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: throw_exception missing inline ?
On Fri, 29 Nov 2002 19:20:35 +0200, "Peter Dimov" <[EMAIL PROTECTED]> wrote: > From: "Hugo Duncan" <[EMAIL PROTECTED]> > > I have started getting multiply defined symbols for throw_exception. > > > > Is the template missing an inline modifier ? > > Compiler/platform? Out of line function templates are supposed to generate a > single instantiation. > Bcc 5.6.1 Given the dates on the throw_exception header, I am supprised that I have not seen this before if it were really a problem in bcc. I shall check project files for stray options. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] throw_exception missing inline ?
I have started getting multiply defined symbols for throw_exception. Is the template missing an inline modifier ? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Sockets!
Michel, On Sun, 24 Nov 2002 13:24:38 +0100, Michel André <[EMAIL PROTECTED]> wrote: > How do i access the cvs sandbox? > cvs update -P (in directory C:\Packages\boost_sandbox\) > cvs server: Updating . Sorry - I missed this message. Hopefully you have gained access by now, but if not then you could try cvs update -Pd Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Socket Address and Name Resolution
There seems to be support for independent resolution, proposed as a getaddrinfo wrapper for hostname+service resolution, or by Michel's ip_resolver class for hostname resolution. Which other protocols can use name resolution? There is also a strong push for unified ip4, ip6 address class. Michel has made a very good ip_address proposal. Do we need 3 ip address classes or just the final one ? * an ip4 address class, * an ip6 address class, * a combined ip4/ip6 address class. Michel has also proposed changing the address concept to add a to_str() representation of an address, and return the representation through: std::pair representaion(); Michel Andre and another (anonymous as far as I can tell) poster have commented on addressing at: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket/AddressConcept Boris Schaeling also commented in news://news.gmane.org/gmane.comp.lib.boost.devel/12305 ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Re: Socket errors
Hamish, On 25 Nov 2002 17:17:41 +, Hamish Mackenzie <[EMAIL PROTECTED]> wrote: > On Mon, 2002-11-25 at 15:43, Hugo Duncan wrote: > > A write on an ssl stream can > > > block attempting to read from the underlying socket (and vice-versa). > > > > Not sure I fully understand this. Could you elaborate please. > > is want_read equivalent to "Would Block On Write" ? > > want_read indicates that the call is blocking because there is no data > to read from the socket at present. In the case of an ssl socket this > could be returned from recv or send. want_read and want_write could > also be returned from ssl connect. presumably that should be "want_read indicates that the call is blocking because there is data to read from the socket at present" without the negative? Do you have a reference for ssl connect somewhere - I am struggling with this... Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Socket Multiplexing
Boris and Hamish have presented examples using objects that provide fat interfaces for event notification. By this I mean they use seperate onEvent() handlers for each type of event as member functions of an event sink or observer class. ACE (I think) uses enums to register interest in read/write, close, exception activity on a resource. What are the features that should be supported? I'll have a go: * a multiplexing library should cope with: files, sockets, timers, signals, user interface events (though need more description for this) others not mentioned but probably useful - pipes, named pipes * should be simple. Not as many "design rules" as http://www.cs.wustl.edu/~schmidt/PDF/reactor-rules.pdf * should allow the use of function objects as handlers * one handler per (event, resource) pair * should allow reuse of handler for different (event,resource) pairs * should not provide for handler reuse across multiple multiplexers, as the only use of multiple multiplexers would be in multiple threads. * should not require virtual base class interface * the implementation could use select, poll, epoll WaitForMultipleObjects or anything else that is available. * should accept the native descriptor types (socket, file, etc) and do the "right thing" I have tried to collect previous comments below: Hamish MacKenzie http://aspn.activestate.com/ASPN/Mail/Message/boost/1448661 Boris Schaeling http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket/Multiplexing Thread concerns Markus Schoepflin news://news.gmane.org/gmane.comp.lib.boost.devel/12399 Eric Woodruff news://news.gmane.org/gmane.comp.lib.boost.devel/12337 Hu Xinwei news://news.gmane.org/gmane.comp.lib.boost.devel/12414 ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Re: SocketSetConcept (fd_set wrapper)
Hamish, On 24 Nov 2002 23:23:27 +, Hamish Mackenzie <[EMAIL PROTECTED]> wrote: > > > is_set -> count (I'm not fussed about this one) > > Not sure about "count", how about something like "active" > Yes, or "contains"? or "find". Having looked at set maybe count is better, but that suggests an integer return value. mm. > > > Also for library implementors I think we need > > > update_width() > > > To be called after the OS has updated the fd_set > > > > I saw this in ACE, but couldn't quite work out what it > > was doing? > > I have not looked at the code but from what I read in C++NP it scans > fd_set for the highest file_descriptor. I am still thinking that this is detail that is obviated by having iterators provided by the class itself. > I have attached the > implementation of file_descriptor_set I have been using in my code > recently. Is there really any difference except in the name? The use of friend is for select is certainly worth thinking about. I'll change the name to file_descriptor_set. The reason I had left it as socket_set was that I was not sure how to mix SOCKET and files on windows - but htat looks to be easy from your code Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Sockets
Pavol, On Sun, 24 Nov 2002 10:12:36 +0100, Pavol Droba <[EMAIL PROTECTED]> wrote: > Is there an interest to support also non-TCP/IP based protocols like > IRDA/TP or raw sockets? I think this should be feasable, though I know nothing of IRDA/TP. Is it just a case of using the appropriate sockaddr_?? class and protocol constants? Or are there any requirements on the communciation once connection is established? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: Re: AW: Re: AW: Sockets
Boris On Sun, 24 Nov 2002 01:05:37 +0100, Boris Schäling <[EMAIL PROTECTED]> wrote: > I will try to set up another page at Boost Wiki to explain in detail what= > I > mean by multiplexing library. Thanks for putting up the page http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket/Multiplexing It is going to take some time to digest this. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Socket errors
Hamish, On 24 Nov 2002 20:49:06 +, Hamish Mackenzie <[EMAIL PROTECTED]> wrote: > >http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket/SocketErrorConcept > [snip] A write on an ssl stream can > block attempting to read from the underlying socket (and vice-versa). Not sure I fully understand this. Could you elaborate please. is want_read equivalent to "Would Block On Write" ? [snip] > Another tricky issue with openssl is the ability to have different read > and write file descriptors for an ssl connection. Is this effectively using one socket for communication in each direction? ie non-duplex operation ? > In my opinion socket_exception should derive from std::exception. definitely > However what() should return nothing more than "socket error". The > reason for this is that any more information like "dns lookup error for > host xyz.abc.com" could reveal sensitive information about ones network. Not sure that his is the right place to be hiding information > I like the idea of having an error policy So do I. What is the reasoning for passing socket_function and args ? I have aded a preliminary ErrorPolicy, without the arguments to handle_error. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: SocketSetConcept (fd_set wrapper)
Hamish, On 24 Nov 2002 19:01:01 +, Hamish Mackenzie <[EMAIL PROTECTED]> wrote: > >http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket/SocketSetConcept > Can we use std::set like method names... > > remove -> erase > add -> insert Sure. > is_set -> count (I'm not fussed about this one) Not sure about "count", how about something like "active" > Also for library implementors I think we need > update_width() > To be called after the OS has updated the fd_set I saw this in ACE, but couldn't quite work out what it was doing? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: AW: Re: AW: Sockets
Boris, On Sat, 23 Nov 2002 21:35:58 +0100, Boris Schäling <[EMAIL PROTECTED]> wrote: > favoured independent socket classes. Not sure what you mean by independent classes? > java.net and java.nio packages provide different approaches to Had a quick look at these. Isn't java.nio just a layer on top of jav.net ? Which library corresponds to which usage ? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Socket Implemnentation
I have put together an initial implementation in the boost-sandbox. The aim of this code is really just to have something concrete to discuss and to have as a base to experiment on. The implementation more or less reflects the design presented at http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket The sandbox contains the simple client and server test shown on the Wiki. At the moment the examples it compiles on: gcc 3.2 cygwin borland Bcc5.5.1 borland Bcc5.6.1 vc7 vc6 sp5 Note the lack of unix :-(, though given the cygwin implementation, it should not be too difficult to get working. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Sockets
Thorsten, On Sat, 23 Nov 2002 23:57:56 +0100, Thorsten Ottosen <[EMAIL PROTECTED]> wrote: > socket_base::initialise(); > > socket.close(); > socket_base::finalise(); > > Why doesn't this happen in the constructor/destructor of some object? Basically because I am not sure of the requirements for initialisation and finalisation. I know Winsock2 requires initialisation. Any other platform? This is really implementation detail that should happen automatically in the final design. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Sockets
On Sat, 23 Nov 2002 14:23:37 -0600, Rob Tougher <[EMAIL PROTECTED]> wrote: >Where should I post these? Wherever you see fit :-) I would suggest the mail list for discussion, and the wiki for capturing points that you don't wan't to get lost. ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: Sockets
On Sat, 23 Nov 2002 11:18:24 -0700, "Jeff Garland" <[EMAIL PROTECTED]> wrote: > I see you have already captured Beman and > others prior work. I have added a references page for pointers to > other C++ socket libraries and other references as well as a few > other quick thoughts. See > > http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?RecentChanges > Jeff, Thanks. As regards times, we should definitely be using the time_duration from boost date_time! Would you have any code references for the usage scenarios that you added ? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: AW: Sockets
On Sat, 23 Nov 2002 19:13:14 +0100, Boris Schäling <[EMAIL PROTECTED]> wrote: > I read your library requirements. Thanks. > I don't agree that a socket library should wrap rather than invent. Agreed that the C++ library should leverage the power of C++, but we could do this while remaining in some way familiar. The intent is to provide a clean C++ interface. Certainly at a higher level some form of smart address resolution should be provided, but I don't think that obviates the need for seperate address classes for seperate protocols, for those people who do not want to pay for functionality that they do not need. eg. for address resolution - should it also resolve decnet addresses? osi addreses? Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Sockets
Sockets have come up from time to time on this list, without concrete results. I am no expert, but based on previous discussions, I have tried to start describing a design at: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket (I don't often write formal designs, so please excuse (or correct) misuse of terminology etc.) I propose working with a group of interested people to develop this design and put together some code. As my socket programming experience is limited to tcp/ip streams, I would also like to ask people to provide small test cases. In particular, examples of datagram usage, multicast, broadcast, and non-ip usage. Please feel free to edit the wiki pages with comments, etc. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: Upcoming changes to shared_ptr
On Sun, 17 Nov 2002 23:13:37 +0200, "Peter Dimov" <[EMAIL PROTECTED]> wrote: > implication, operator== and operator<. None of my projects use them although I am using the operators (which aren't defined on the result of get but on the address of the counted base), as I have a map of weak pointers. I would not need the map if i could attatch arbitrary data to the shared pointer though (might remove the need, being discussed in another thread, to be able to obtain the deleter for the pointer). In my case I attatch a GUID. Hugo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost