Re: [Netnice-daemon] netniced Linux port
Status: Alpha
Brought to you by:
taost6
From: Takashi O. <ta...@cs...> - 2003-11-12 21:22:01
|
hi, Sergei Matusevich wrote: > > Okay, here's another tiny patch and now we have netniced > compiled for Linux! I have also managed to compile it with > gcc -Wall, mostly by commenting out some variables that > were declared but never used in the code. Please let me > know if we need this patch as well. thanks for the patch, again. i'll apply it shortly and commit. regarding the aesthetic changes, i think we may defer, since we'll need cleaning of the code anyway. > In addition, I have some general remarks about our code. > First of all, in our header files, we never use common > #ifndef/#define technique to prevent errors when the header > is included twice in some source (directly or indirectly). > I think we should add add such wrappers to each .h file - > please see the classes.h patch attached for an example. i definitely have no objection about this. just take the current code as a prototype. > I am also extremely confused with String, Integer, Boolean, > Process, ProcessGroup etc. typedefs defined in the > classes.h. It is very hard to tell from the code, whether, > say, SocketGroup is an object or a pointer. Things get even > more obscure if we decide to pass SocketGroup by reference > or store it in an STL container. I would suggest to get rid > of these typedefs completely in future. i think they are for automatic document generation by doc++. the problem is this; although the code is written in C++, the user needed to have a class library documentation (for the Java-like scripting language in the former version). http://www.netnice.org/documents/doc/index.html i used a lot of typedefs, just to fill this gap. if you have a good wayaround for this problem, i'm flexible also about this, as long as we provide a complete set of the class description automatically generated from the source code at a reasonable cost. > I have also noticed that some netniced classes, e.g. > process, socket, processgroup, socketgroup, have a lot of > things in common in both interface and implementation. > Maybe it make sense to move the common functionality and/or > interface to some generic base class and inherit from it. for the same reason as above, automatic document generation, i think the inheritance approach makes things more complicated. but, to write better common routines (e.g. for procfs access) is a good idea. i believe that netnice/netnice-common/src/netniced/TODO has a lot of suggestions for improvement, which can be a good starting point. thanks! -- taka p.s. btw, do you think the package structure, to support various platforms with a package, reasonable enough? for example, we have platform-dependent directories and a common directory (netnice-common), with some others (doc and contrib). do you like the idea? or, you have better plan? |