| The Gaudi Framework v29r1 (5cd95fa2)

- 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 111 of file ProcessDescriptor.h.

## Constructor & Destructor Documentation

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

Definition at line 356 of file ProcessDescriptor.cpp.

357 {
358 if ( pid > 0 ) {
359 if ( pid != ::getpid() ) {
360 #ifdef _WIN32
361 m_handle = ::OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
362 #else
363 // Note: the return type of getpid is pid_t, which is int on 64bit machines too
364 m_handle = reinterpret_cast<void*>( static_cast<long>(::getpid() ) );
365 #endif
366 m_needRelease = true;
367 return;
368 }
369 }
370 m_handle = processHandle();
371 m_needRelease = false;
372 }
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
GaudiKernel.Constants.FALSE
bool FALSE
Definition: Constants.py:21
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:114
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:113

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

Definition at line 374 of file ProcessDescriptor.cpp.

375 {
376 if ( m_needRelease ) {
377 #ifdef _WIN32
378 ::CloseHandle( m_handle );
379 #else
380 m_handle = nullptr;
381 #endif
382 }
383 }
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:114
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:113

## Member Function Documentation

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

Definition at line 120 of file ProcessDescriptor.h.

120 { return m_handle; }
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:113

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

Definition at line 119 of file ProcessDescriptor.h.

119 { return m_needRelease ? 1 : 0; }
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:114

## Member Data Documentation

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

Definition at line 113 of file ProcessDescriptor.h.

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

Definition at line 114 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