VirtualBox

Changeset 26186 in vbox for trunk/src/VBox/Main/HostImpl.cpp


Ignore:
Timestamp:
Feb 3, 2010 1:07:12 PM (15 years ago)
Author:
vboxsync
Message:

Main: coding style fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r26177 r26186  
    225225     */
    226226# if defined (RT_OS_DARWIN)
    227     m->pUSBProxyService = new USBProxyServiceDarwin (this);
     227    m->pUSBProxyService = new USBProxyServiceDarwin(this);
    228228# elif defined (RT_OS_LINUX)
    229     m->pUSBProxyService = new USBProxyServiceLinux (this);
     229    m->pUSBProxyService = new USBProxyServiceLinux(this);
    230230# elif defined (RT_OS_OS2)
    231231    m->pUSBProxyService = new USBProxyServiceOs2 (this);
    232232# elif defined (RT_OS_SOLARIS)
    233     m->pUSBProxyService = new USBProxyServiceSolaris (this);
     233    m->pUSBProxyService = new USBProxyServiceSolaris(this);
    234234# elif defined (RT_OS_WINDOWS)
    235     m->pUSBProxyService = new USBProxyServiceWindows (this);
     235    m->pUSBProxyService = new USBProxyServiceWindows(this);
    236236# elif defined (RT_OS_FREEBSD)
    237     m->pUSBProxyService = new USBProxyServiceFreeBSD (this);
     237    m->pUSBProxyService = new USBProxyServiceFreeBSD(this);
    238238# else
    239     m->pUSBProxyService = new USBProxyService (this);
     239    m->pUSBProxyService = new USBProxyService(this);
    240240# endif
    241241    HRESULT hrc = m->pUSBProxyService->init();
     
    248248
    249249#if defined (RT_OS_WINDOWS)
    250     m->pHostPowerService = new HostPowerServiceWin (m->pParent);
     250    m->pHostPowerService = new HostPowerServiceWin(m->pParent);
    251251#elif defined (RT_OS_DARWIN)
    252     m->pHostPowerService = new HostPowerServiceDarwin (m->pParent);
     252    m->pHostPowerService = new HostPowerServiceDarwin(m->pParent);
    253253#else
    254     m->pHostPowerService = new HostPowerService (m->pParent);
     254    m->pHostPowerService = new HostPowerService(m->pParent);
    255255#endif
    256256
     
    11571157    ComObjPtr<HostUSBDeviceFilter> filter;
    11581158    filter.createObject();
    1159     HRESULT rc = filter->init (this, aName);
     1159    HRESULT rc = filter->init(this, aName);
    11601160    ComAssertComRCRet (rc, rc);
    11611161    rc = filter.queryInterfaceTo(aFilter);
     
    12031203
    12041204    if (pFilter->mInList)
    1205         return setError (E_INVALIDARG,
    1206             tr ("The given USB device filter is already in the list"));
     1205        return setError(E_INVALIDARG,
     1206                        tr("The given USB device filter is already in the list"));
    12071207
    12081208    /* iterate to the position... */
     
    12481248
    12491249    if (!m->llUSBDeviceFilters.size())
    1250         return setError (E_INVALIDARG,
    1251             tr ("The USB device filter list is empty"));
     1250        return setError(E_INVALIDARG,
     1251                        tr("The USB device filter list is empty"));
    12521252
    12531253    if (aPosition >= m->llUSBDeviceFilters.size())
    1254         return setError (E_INVALIDARG,
    1255             tr ("Invalid position: %lu (must be in range [0, %lu])"),
    1256             aPosition, m->llUSBDeviceFilters.size() - 1);
     1254        return setError(E_INVALIDARG,
     1255                        tr("Invalid position: %lu (must be in range [0, %lu])"),
     1256                        aPosition, m->llUSBDeviceFilters.size() - 1);
    12571257
    12581258    ComObjPtr<HostUSBDeviceFilter> filter;
     
    13691369
    13701370    if (!found)
    1371         return setError (E_INVALIDARG, HostNetworkInterface::tr (
    1372                              "The host network interface with the given name could not be found"));
     1371        return setError(E_INVALIDARG,
     1372                        HostNetworkInterface::tr("The host network interface with the given name could not be found"));
    13731373
    13741374    found->setVirtualBox(m->pParent);
     
    14071407
    14081408    if (!found)
    1409         return setError (E_INVALIDARG, HostNetworkInterface::tr (
    1410                              "The host network interface with the given GUID could not be found"));
     1409        return setError(E_INVALIDARG,
     1410                        HostNetworkInterface::tr("The host network interface with the given GUID could not be found"));
    14111411
    14121412    found->setVirtualBox(m->pParent);
     
    14481448
    14491449STDMETHODIMP Host::FindUSBDeviceByAddress(IN_BSTR aAddress,
    1450                                          IHostUSBDevice **aDevice)
     1450                                          IHostUSBDevice **aDevice)
    14511451{
    14521452#ifdef VBOX_WITH_USB
     
    24022402
    24032403#ifdef VBOX_WITH_RESOURCE_USAGE_API
    2404 void Host::registerMetrics (PerformanceCollector *aCollector)
     2404void Host::registerMetrics(PerformanceCollector *aCollector)
    24052405{
    24062406    pm::CollectorHAL *hal = aCollector->getHAL();
    24072407    /* Create sub metrics */
    2408     pm::SubMetric *cpuLoadUser   = new pm::SubMetric ("CPU/Load/User",
     2408    pm::SubMetric *cpuLoadUser   = new pm::SubMetric("CPU/Load/User",
    24092409        "Percentage of processor time spent in user mode.");
    2410     pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel",
     2410    pm::SubMetric *cpuLoadKernel = new pm::SubMetric("CPU/Load/Kernel",
    24112411        "Percentage of processor time spent in kernel mode.");
    2412     pm::SubMetric *cpuLoadIdle   = new pm::SubMetric ("CPU/Load/Idle",
     2412    pm::SubMetric *cpuLoadIdle   = new pm::SubMetric("CPU/Load/Idle",
    24132413        "Percentage of processor time spent idling.");
    2414     pm::SubMetric *cpuMhzSM      = new pm::SubMetric ("CPU/MHz",
     2414    pm::SubMetric *cpuMhzSM      = new pm::SubMetric("CPU/MHz",
    24152415        "Average of current frequency of all processors.");
    2416     pm::SubMetric *ramUsageTotal = new pm::SubMetric ("RAM/Usage/Total",
     2416    pm::SubMetric *ramUsageTotal = new pm::SubMetric("RAM/Usage/Total",
    24172417        "Total physical memory installed.");
    2418     pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used",
     2418    pm::SubMetric *ramUsageUsed  = new pm::SubMetric("RAM/Usage/Used",
    24192419        "Physical memory currently occupied.");
    2420     pm::SubMetric *ramUsageFree  = new pm::SubMetric ("RAM/Usage/Free",
     2420    pm::SubMetric *ramUsageFree  = new pm::SubMetric("RAM/Usage/Free",
    24212421        "Physical memory currently available to applications.");
    24222422    /* Create and register base metrics */
     
    24242424    ComObjPtr<Host> tmp = this;
    24252425    tmp.queryInterfaceTo(&objptr);
    2426     pm::BaseMetric *cpuLoad = new pm::HostCpuLoadRaw (hal, objptr, cpuLoadUser, cpuLoadKernel,
     2426    pm::BaseMetric *cpuLoad = new pm::HostCpuLoadRaw(hal, objptr, cpuLoadUser, cpuLoadKernel,
    24272427                                          cpuLoadIdle);
    24282428    aCollector->registerBaseMetric (cpuLoad);
    2429     pm::BaseMetric *cpuMhz = new pm::HostCpuMhz (hal, objptr, cpuMhzSM);
     2429    pm::BaseMetric *cpuMhz = new pm::HostCpuMhz(hal, objptr, cpuMhzSM);
    24302430    aCollector->registerBaseMetric (cpuMhz);
    2431     pm::BaseMetric *ramUsage = new pm::HostRamUsage (hal, objptr, ramUsageTotal, ramUsageUsed,
     2431    pm::BaseMetric *ramUsage = new pm::HostRamUsage(hal, objptr, ramUsageTotal, ramUsageUsed,
    24322432                                           ramUsageFree);
    24332433    aCollector->registerBaseMetric (ramUsage);
    24342434
    2435     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadUser, 0));
    2436     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadUser,
    2437                                                new pm::AggregateAvg()));
    2438     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadUser,
    2439                                                new pm::AggregateMin()));
    2440     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadUser,
    2441                                                new pm::AggregateMax()));
    2442 
    2443     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadKernel, 0));
    2444     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadKernel,
    2445                                                new pm::AggregateAvg()));
    2446     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadKernel,
    2447                                                new pm::AggregateMin()));
    2448     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadKernel,
    2449                                                new pm::AggregateMax()));
    2450 
    2451     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadIdle, 0));
    2452     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadIdle,
    2453                                                new pm::AggregateAvg()));
    2454     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadIdle,
    2455                                                new pm::AggregateMin()));
    2456     aCollector->registerMetric (new pm::Metric(cpuLoad, cpuLoadIdle,
    2457                                                new pm::AggregateMax()));
    2458 
    2459     aCollector->registerMetric (new pm::Metric(cpuMhz, cpuMhzSM, 0));
    2460     aCollector->registerMetric (new pm::Metric(cpuMhz, cpuMhzSM,
    2461                                                new pm::AggregateAvg()));
    2462     aCollector->registerMetric (new pm::Metric(cpuMhz, cpuMhzSM,
    2463                                                new pm::AggregateMin()));
    2464     aCollector->registerMetric (new pm::Metric(cpuMhz, cpuMhzSM,
    2465                                                new pm::AggregateMax()));
    2466 
    2467     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageTotal, 0));
    2468     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageTotal,
    2469                                                new pm::AggregateAvg()));
    2470     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageTotal,
    2471                                                new pm::AggregateMin()));
    2472     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageTotal,
    2473                                                new pm::AggregateMax()));
    2474 
    2475     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageUsed, 0));
    2476     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageUsed,
    2477                                                new pm::AggregateAvg()));
    2478     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageUsed,
    2479                                                new pm::AggregateMin()));
    2480     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageUsed,
    2481                                                new pm::AggregateMax()));
    2482 
    2483     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageFree, 0));
    2484     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageFree,
    2485                                                new pm::AggregateAvg()));
    2486     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageFree,
    2487                                                new pm::AggregateMin()));
    2488     aCollector->registerMetric (new pm::Metric(ramUsage, ramUsageFree,
    2489                                                new pm::AggregateMax()));
     2435    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadUser, 0));
     2436    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadUser,
     2437                                              new pm::AggregateAvg()));
     2438    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadUser,
     2439                                              new pm::AggregateMin()));
     2440    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadUser,
     2441                                              new pm::AggregateMax()));
     2442
     2443    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadKernel, 0));
     2444    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadKernel,
     2445                                              new pm::AggregateAvg()));
     2446    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadKernel,
     2447                                              new pm::AggregateMin()));
     2448    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadKernel,
     2449                                              new pm::AggregateMax()));
     2450
     2451    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadIdle, 0));
     2452    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadIdle,
     2453                                              new pm::AggregateAvg()));
     2454    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadIdle,
     2455                                              new pm::AggregateMin()));
     2456    aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadIdle,
     2457                                              new pm::AggregateMax()));
     2458
     2459    aCollector->registerMetric(new pm::Metric(cpuMhz, cpuMhzSM, 0));
     2460    aCollector->registerMetric(new pm::Metric(cpuMhz, cpuMhzSM,
     2461                                              new pm::AggregateAvg()));
     2462    aCollector->registerMetric(new pm::Metric(cpuMhz, cpuMhzSM,
     2463                                              new pm::AggregateMin()));
     2464    aCollector->registerMetric(new pm::Metric(cpuMhz, cpuMhzSM,
     2465                                              new pm::AggregateMax()));
     2466
     2467    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageTotal, 0));
     2468    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageTotal,
     2469                                              new pm::AggregateAvg()));
     2470    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageTotal,
     2471                                              new pm::AggregateMin()));
     2472    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageTotal,
     2473                                              new pm::AggregateMax()));
     2474
     2475    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageUsed, 0));
     2476    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageUsed,
     2477                                              new pm::AggregateAvg()));
     2478    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageUsed,
     2479                                              new pm::AggregateMin()));
     2480    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageUsed,
     2481                                              new pm::AggregateMax()));
     2482
     2483    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageFree, 0));
     2484    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageFree,
     2485                                              new pm::AggregateAvg()));
     2486    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageFree,
     2487                                              new pm::AggregateMin()));
     2488    aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageFree,
     2489                                              new pm::AggregateMax()));
    24902490};
    24912491
    24922492void Host::unregisterMetrics (PerformanceCollector *aCollector)
    24932493{
    2494     aCollector->unregisterMetricsFor (this);
    2495     aCollector->unregisterBaseMetricsFor (this);
     2494    aCollector->unregisterMetricsFor(this);
     2495    aCollector->unregisterBaseMetricsFor(this);
    24962496};
    24972497#endif /* VBOX_WITH_RESOURCE_USAGE_API */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette