| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
System::ProcessDescriptor::ProcessHandle Class Reference

## Public Member Functions
| ProcessHandle (long pid)
virtual | ~ProcessHandle ()
long | item ()
void * | handle ()

## Private Attributes
void * | m_handle
bool | m_needRelease

## Detailed Description

Definition at line 110 of file ProcessDescriptor.h.

## Constructor & Destructor Documentation

System::ProcessDescriptor::ProcessHandle::ProcessHandle | ( | long | pid | ) |

Definition at line 400 of file ProcessDescriptor.cpp.

400 {
401 if ( pid > 0 ) {
402 if ( pid != s_myPid ) {
403 #ifdef _WIN32
404 m_handle = ::OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,
405 pid);
406 #else
407 // Note: the return type of getpid is pid_t, which is int on 64bit machines too
408 m_handle = reinterpret_cast<void*>(static_cast<long>(s_myPid));
409 #endif
410 m_needRelease = true;
411 return;
412 }
413 }
414 m_handle = processHandle();
415 m_needRelease = false;
416 }
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:126
GaudiKernel.Constants.FALSE
FALSE
Definition: Constants.py:21
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:112
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:111
s_myPid
#define s_myPid
Definition: ProcessDescriptor.cpp:373

System::ProcessDescriptor::ProcessHandle::~ProcessHandle | ( |  | ) |
| virtual

Definition at line 418 of file ProcessDescriptor.cpp.

418 {
419 if ( m_needRelease ) {
420 #ifdef _WIN32
421 ::CloseHandle(m_handle);
422 #else
423 m_handle = nullptr;
424 #endif
425 }
426 }
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:112
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:111

## Member Function Documentation

void* System::ProcessDescriptor::ProcessHandle::handle | ( |  | ) |
| inline

Definition at line 119 of file ProcessDescriptor.h.

119 {
120 return m_handle;
121 }
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:111

long System::ProcessDescriptor::ProcessHandle::item | ( |  | ) |
| inline

Definition at line 116 of file ProcessDescriptor.h.

116 {
117 return m_needRelease ? 1 : 0;
118 }
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:112

## Member Data Documentation

void* System::ProcessDescriptor::ProcessHandle::m_handle
| private

Definition at line 111 of file ProcessDescriptor.h.

bool System::ProcessDescriptor::ProcessHandle::m_needRelease
| private

Definition at line 112 of file ProcessDescriptor.h.

The documentation for this class was generated from the following files:

- GaudiKernel/src/Lib/ProcessDescriptor.h
- GaudiKernel/src/Lib/ProcessDescriptor.cpp