| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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 387 of file ProcessDescriptor.cpp.

387 {
388 if ( pid > 0 ) {
389 if ( pid != ::getpid() ) {
390 #ifdef _WIN32
391 m_handle = ::OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,
392 pid);
393 #else
394 // Note: the return type of getpid is pid_t, which is int on 64bit machines too
395 m_handle = reinterpret_cast<void*>(static_cast<long>(::getpid()));
396 #endif
397 m_needRelease = true;
398 return;
399 }
400 }
401 m_handle = processHandle();
402 m_needRelease = false;
403 }
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:126
GaudiKernel.Constants.FALSE
bool 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

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

Definition at line 405 of file ProcessDescriptor.cpp.

405 {
406 if ( m_needRelease ) {
407 #ifdef _WIN32
408 ::CloseHandle(m_handle);
409 #else
410 m_handle = nullptr;
411 #endif
412 }
413 }
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