gomd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gomd-devel] <DAEMON> Huge code cleanup


From: Gian Paolo Ghilardi
Subject: [gomd-devel] <DAEMON> Huge code cleanup
Date: Sun, 29 Jun 2003 12:07:57 +0200

Hi all.

Before adding new infos to the daemon, I've clean up a lot of code.
The main purpose was to remove stuff from gomd.h/gomd.cpp files (see notes
below).

NOTE: from this release libgtop library is required. ASAP I'll fix this
situation, but at this moment, I prefer to maintain this dependency. ;)
If you don't want to install this library (or you cannot do it), you can
compile the code with a simple trick (because sysInfo code is not used): you
need only to remove "sysInfo.o" from OBJECTS variable in "daemon/Makefile"
file (not tested, sorry... ;) ).




Here are the modifications.

IN Makefile
(+) added omInfo and sysInfo classes to compilation line
(+) objects now are compiled in alphabetical order ;)


IN gomd.h/gomd.cpp
(H) huge cleanup => now this class will contain only client-conn management
stuff.
    - oM infos code was moved to new omInfo class (omInfo.h/omInfo.cpp
files)
    - system (extra) infos will be placed into new sysInfo class
(sysInfo.h/sysInfo.cpp files)
(+) added support for new utils class.
(-) moved some vars and functions to new omInfo class (omInfo.h/omInfo.cpp
files):
        om_getDeadNodesList(), om_getInfo(), om_getLocalBlock(),
om_getLocalID(),
        om_getNodeByPID(string pid), om_getNodeIP(int nodeId),
                om_getNodesIPs(), om_getNodesList(), om_setLocalBlock(),
                om_setLocalDecay(), om_setLocalNoblock().
(-) moved some functions to utils class (utils.h/utils.cpp files):
                om_readFromFile(), om_writeToFile().


IN gomd2gomd.h/gomd2gomd.cpp
(+) added support to new utils class


IN main.cpp
(+) added support for new utils class.


IN omInfo.h/omInfo.cpp
(N) added new omInfo class. Provides all functions to get basic openMosix
infos (same as mosctl).
These functions were moved from gomd.h/gomd.cpp files => gomd.h/gomd.cpp now
contain only client-conn management stuff. ;)
(+) added new vars and functions (moved from gomd.h/gomd.cpp files. The
"om_" prefix was removed):
    getDeadNodesList(), getInfo(), getLocalBlock(), getLocalID(),
getNodeByPID(string pid),
            getNodeIP(int nodeId); getNodesIPs(), getNodesList(), 
setLocalBlock(),
setLocalDecay(),
            setLocalNoblock();


IN sysInfo.h/sysInfo.cpp
(N) new sysInfo class. Provides functions to get extra (non oM-specific)
system infos from the system (cpus loads, memory status, process list,...)
(R) Requires LIBGTOP library installed (please install it)!
(+) first import.
(+) added getCPULoad() function to get cpus load value (SMP is supported).
To be tested (not used at this moment).


IN utils.h/utils.cpp
(+) now utils is a class (and will be used as it)!
(+) added findInFile() function to search a string in a file (return a list
with all occurrencies)
(+) moved writeToFile() and readFromFile() functions (from gomd.h/gomd.cpp,
here) because they are generic! ;)
(+) added file inclusion verification (#ifndef,...)
(r) renamed readFromFile() to readLineFromFile()




As usual I'm waiting for comments... :)

Byez.

<rejected>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]