On Thu, Jun 12, 2008 at 5:51 PM, nathan binkert <[EMAIL PROTECTED]> wrote: >> I was wondering why we had both 'type' and 'cxx_classname'... last >> time I recall working on that code (before Nate finished the params >> auto-gen stuff), the point of 'type' was to be the C++ class name. >> When is the "Params.Foo" thing different from the Python class name, >> and is there a good reason for it being that way? > I'm not sure, but type was what was being used, not the class name. > If we switch it to the class name, then we can probably use type and > get rid of cxx_classname. There are several things going on here. > One is that the python name and the c++ name can be different. > Another is that there can actually be multiple c++ classes any one of > which could be generated for one python class (think cache builder).
I'm not sure any of that fully explains why we have both attributes though. It is important to remember as in the cache builder example that the 'type' is really something that identifies the function that creates the C++ object and isn't necessarily the type of the resulting object (or even a c++ type at all)... but in those cases there is no single c++ type, so there still isn't any point in having two different attributes. >> Seems to me like we ought to be able to have a single parameter that's >> the C++ classname including namespaces if any. I don't think that the >> Python inheritance should affect the C++ classname implicitly (though >> that's just a gut reaction, and if there are good counterexamples I'm >> willing to change). > I agree with steve. I'd like to just see something like type = > "Foo::Bar::Baz" and have the code do the right thing. Yup. >>>>> The second option would be to put the C++ namespace hierarchy into the >>>>> header file names. That's going to be truly unique, unlike the names in >>>>> python which can be made locally unique through modules. We could for >>>>> instance either do that with directories a la java, which I don't >>>>> particular like the aesthetics of, or something like >>>>> namespace1.namespace2.class.hh. >> >> Why don't you like the java directory hierarchy method? It makes sense to >> me... > Seems like it would be better to actually create directories for the > files and do namespace1/namespace2/class.hh That's what I meant by "java directory hierarchy method" (since Gabe made that analogy). Steve _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
