Mobile API Reference  MicroStrategy 2019
System.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : System.h
3 // AUTHOR : vovechkin
4 // CREATION : 2003-07-26
5 // Copyright (C) MicroStrategy Incorporated 2003
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MBase_System_h
9 #define MBase_System_h
10 
11 #include "Base.h"
12 
13 #include "ReturnString.h"
14 #include "BaseString.h"
15 
17 // 2003-07-26 vovechkin
18 // NOTE: this header file should not include system-dependent headers,
19 // such as "wtypes.h"
21 
22 // 2004-06-30 vovechkin
23 // use the anonymous namespace for this function,
24 // to ensure that on UNIX, each module references
25 // its own copy of this function.
26 namespace
27 {
28  inline void MBase_DummyFunction()
29  {
30  return;
31  }
32 }
33 
34 namespace MBase
35 {
42 #ifndef NO_WCHAR_SUPPORT
43  DLL_BASE_EXIM void OutputDebugString(const WCHAR* ipDebugString) throw();
44 #endif
45  DLL_BASE_EXIM void OutputDebugString(const char* ipDebugString) throw();
46 
52 
57 
62 
63 
67  DLL_BASE_EXIM ReturnWString GetComputerName();
68 
74 
79  DLL_BASE_EXIM const char* GetProcessLocale() throw();
80 
87 
97 
101  DLL_BASE_EXIM void Sleep(unsigned long inMilliseconds);
102 
106  DLL_BASE_EXIM ReturnWString IPAddress2MachineName(const MBase::String& ipAddr) throw();
107 
108 
112  DLL_BASE_EXIM ReturnWString MachineName2IPAddress(const MBase::String& ipMachineName) throw();
113 
114 
115  DLL_BASE_EXIM unsigned short GetNumberOfSystemProcessors() throw();
116 
122  DLL_BASE_EXIM MBase::ReturnWString GetModuleFileNameByAddressWithinModule(const void* ipAddressWithinModule);
123 
128  {
129  // 2004-07-26 yuwen
130  // some compilers (GNU C++) do not like a reinterpret_cast of a function pointer.
131  return GetModuleFileNameByAddressWithinModule((const void*) (&MBase_DummyFunction));
132  }
133 
140 
145  DLL_BASE_EXIM unsigned Int32 GetPseudoRandomInt32(unsigned Int32 iMaxValue) throw();
146 
150  inline bool IsBigEndian()
151  {
152  // 10/13/2004 yuwen make it more robust.
153  // Note that HP on Itanium64 is big endian; NT on Itanium64 is little endian
154 #if defined(_BIG_ENDIAN)
155  return true;
156 #elif defined (_LITTLE_ENDIAN)
157  return false;
158 #elif defined(WIN32) || defined(__i386) || defined(__x86_64)
159  return false;
160 #elif defined(__sparc) || defined(_POWER)
161  return true;
162 #else
163 #error Unknown Platform
164 #endif
165  }
166 
167 #ifndef WIN32
168 
172 
176  DLL_BASE_EXIM int UserNameToID(const WCHAR* ipUserName);
177 
182 
186  DLL_BASE_EXIM int GroupNameToID(const WCHAR* ipGroupName);
187 #endif // WIN32
188 
189  /*
190  Will return the Virtual Bytes(Commited) of the Iserver
191  */
192  DLL_BASE_EXIM unsigned long int GetPrivateBytes();
193 
194  /*
195  Will pause the Iserver process
196  */
198 
199  //xfan. 12/05/07.
200 #ifdef sun
201 #define SYSTEM_PAGE_SIZE 8192
202 #else
203 #define SYSTEM_PAGE_SIZE 4096
204 #endif
205  // Get the system page size
206  // return false in error condition
207  DLL_BASE_EXIM bool GetSymPageSize(size_t *opPageSize);
208 
212  DLL_BASE_EXIM ReturnWString GetCurrentProcessName();
213 }
214 
215 
216 #endif // MBase_System_h
wchar_t WCHAR
Definition: PDCwchar.h:23
DLL_BASE_EXIM void Sleep(unsigned long inMilliseconds)
DLL_BASE_EXIM const char * GetProcessLocale()
DLL_BASE_EXIM void YieldToAnotherThread()
DLL_BASE_EXIM MBase::ReturnWString UserIDToName(int iUserID)
DLL_BASE_EXIM int GroupNameToID(const WCHAR *ipGroupName)
DLL_BASE_EXIM ReturnWString GetComputerName()
bool IsBigEndian()
Definition: System.h:150
DLL_BASE_EXIM bool GetSymPageSize(size_t *opPageSize)
MBase::ReturnWString GetThisModuleFileName()
Definition: System.h:127
Definition: ReturnString.h:85
DLL_BASE_EXIM void PauseCurrentProcess()
DLL_BASE_EXIM MBase::ReturnWString GroupIDToName(int iGroupID)
#define DLL_BASE_EXIM
Definition: Base.h:20
DLL_BASE_EXIM ReturnWString MachineName2IPAddress(const MBase::String &ipMachineName)
DLL_BASE_EXIM MBase::ReturnWString GetModuleFileNameByAddressWithinModule(const void *ipAddressWithinModule)
DLL_BASE_EXIM unsigned Int32 GetPseudoRandomInt32(unsigned Int32 iMaxValue)
#define Int32
Definition: BasicTypes.h:20
DLL_BASE_EXIM Int32 GetUniqueMachineID()
DLL_BASE_EXIM void OutputDebugString(const WCHAR *ipDebugString)
DLL_BASE_EXIM ReturnWString GetCurrentProcessName()
DLL_BASE_EXIM int UserNameToID(const WCHAR *ipUserName)
Definition: Allocator.h:47
DLL_BASE_EXIM unsigned short GetNumberOfSystemProcessors()
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
DLL_BASE_EXIM unsigned Int32 GetCurrentProcessID()
DLL_BASE_EXIM MBase::ReturnWString GetEnvironmentVariableOrNULL(const WCHAR *ipVariableName)
DLL_BASE_EXIM ReturnWString IPAddress2MachineName(const MBase::String &ipAddr)
DLL_BASE_EXIM MBase::ReturnWString ReadEnvironmentVariable(const WCHAR *ipVariableName)
DLL_BASE_EXIM unsigned long int GetPrivateBytes()
DLL_BASE_EXIM MBase::ReturnWString GetCurrentLogin()
DLL_BASE_EXIM unsigned Int32 GetCurrentThreadID()