diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 3 | ||||
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.h | 6 | ||||
-rwxr-xr-x | cpp/src/IceGrid/icegridnode.dsp | 4 |
4 files changed, 19 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 07e3824a16e..1a5be80b694 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -191,7 +191,8 @@ NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter, _hostname(IceInternal::getProtocolPluginFacade(adapter->getCommunicator())->getDefaultHost()), _proxy(proxy), _waitTime(adapter->getCommunicator()->getProperties()->getPropertyAsIntWithDefault("IceGrid.Node.WaitTime", 60)), - _serial(1) + _serial(1), + _platform(_traceLevels) { string dataDir = _adapter->getCommunicator()->getProperties()->getProperty("IceGrid.Node.Data"); if(!isAbsolute(dataDir)) diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index 347ea5f19db..607a88f3101 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -7,7 +7,11 @@ // // ********************************************************************** +#include <Ice/LocalException.h> +#include <Ice/LoggerUtil.h> + #include <IceGrid/PlatformInfo.h> +#include <IceGrid/TraceLevels.h> #if !defined(_WIN32) # include <sys/utsname.h> @@ -26,7 +30,7 @@ using namespace std; using namespace IceGrid; -PlatformInfo::PlatformInfo() +PlatformInfo::PlatformInfo(const TraceLevelsPtr& traceLevels) : _traceLevels(traceLevels) { // // Initialization of the necessary data structures to get the load average. @@ -78,7 +82,9 @@ PlatformInfo::PlatformInfo() // // Get the number of processors. // -#if defined(__APPLE__) +#if defined(_WIN32) + _info.nProcessors = 1; +#elif defined(__APPLE__) static int ncpu[2] = { CTL_HW, HW_NCPU }; size_t sz = sizeof(_info.nProcessors); if(sysctl(ncpu, 2, &_info.nProcessors, &sz, 0, 0) == -1) diff --git a/cpp/src/IceGrid/PlatformInfo.h b/cpp/src/IceGrid/PlatformInfo.h index 7c9bfe6a334..ba41071bd32 100644 --- a/cpp/src/IceGrid/PlatformInfo.h +++ b/cpp/src/IceGrid/PlatformInfo.h @@ -20,11 +20,14 @@ namespace IceGrid { +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + class PlatformInfo { public: - PlatformInfo(); + PlatformInfo(const TraceLevelsPtr&); ~PlatformInfo(); NodeInfo getNodeInfo() const; @@ -32,6 +35,7 @@ public: private: + const TraceLevelsPtr _traceLevels; NodeInfo _info; #if defined(_WIN32) diff --git a/cpp/src/IceGrid/icegridnode.dsp b/cpp/src/IceGrid/icegridnode.dsp index 24d288ee969..eeeb0e08c7c 100755 --- a/cpp/src/IceGrid/icegridnode.dsp +++ b/cpp/src/IceGrid/icegridnode.dsp @@ -170,6 +170,10 @@ SOURCE=.\ObserverSessionI.cpp # End Source File
# Begin Source File
+SOURCE=.\PlatformInfo.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\QueryI.cpp
# End Source File
# Begin Source File
|