From: Joe Wreschnig Date: 2002-07-09T04:05:40+09:00 Subject: Re: What to use for OS-specific module namespaces? --=-41/KkCliBzfTUlSQie9e Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2002-07-08 at 12:29, Mr. Sunblade wrote: > >I'd like to put the model under the Sys:: namespace for consistency; if > >you think it's a good idea; then I'm left with the question of what to > >call it again. :) Sys::Hardware? Sys::Info seems too generic a name > >(since Uptime, ProcTable, and Uname are both "Info" too). >=20 > Sys::ACPI seems appropriate. If you're interested, I could investigate > Solaris support once you've got your api fleshed out. Well, the problem is that while some parts of ACPI are solely ACPI (like AC adapter information), others (like processor SpeedStep or throttling) are closely tied to the non-ACPI parts of the processor. I guess I can just remove the Info namespace altogether and have Sys::CPU, Sys::ACPI, etc. (for a sample of the API right now - SysInfo::Linux::CPU[0].ghz =3D> 1.59 SysInfo::Linux::CPU[0].state.clock =3D> 1600 # Main power state SysInfo::Linux::CPU[0].state[1].clock =3D> 1200 # Lower-power state # Use low-power state for all CPUs SysInfo::Linux::CPU.each { |c| c.state =3D c.state[1] } SysInfo::Linux::CPU[0].state.clock =3D> 1200 If ACPI is not available, things like SysInfo::Linux::CPU[0]::state never get defined, but SysInfo::Linux::CPU[0].ghz will still work; only the SysInfo::Linux::ACPI::exists? function will be available otherwise.) --=20 - Joe Wreschnig - http://www.sacredchao.net "What I did was justified because I had a policy of my own... It's okay to be different, to not conform to society." -- Chen Kenichi, Iron Chef Chinese --=-41/KkCliBzfTUlSQie9e Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA9KeKCTFkUq7Drx3cRAosgAJ9TxAN6q9kGOs53uENvH1D0+TjetACgzWhE homizwIXkoAHsSxttVI1lws= =ATgG -----END PGP SIGNATURE----- --=-41/KkCliBzfTUlSQie9e--