| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Public Member Functions | Private Attributes

# System::ProcessDescriptor::ProcessHandle Class Reference

List of all members.

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

                                                                  {
      if ( pid > 0 )    {
        if ( pid != s_myPid )    {
    #ifdef _WIN32
          m_handle = ::OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,
                                   pid);
    #else
          // Note: the return type of getpid is pid_t, which is int on 64bit machines too
          m_handle = reinterpret_cast<void*>(static_cast<long>(s_myPid));
    #endif
          m_needRelease = true;
          return;
        }
      }
      m_handle = processHandle();
      m_needRelease = false;
    }

System::ProcessDescriptor::ProcessHandle::~ProcessHandle | ( | ) | `[virtual]`

Definition at line 418 of file ProcessDescriptor.cpp.

                                                           {
      if ( m_needRelease )    {
    #ifdef _WIN32
        ::CloseHandle(m_handle);
    #else
          m_handle = 0;
    #endif
      }
    }

## Member Function Documentation

void* System::ProcessDescriptor::ProcessHandle::handle | ( | ) | `[inline]`

Definition at line 120 of file ProcessDescriptor.h.

                            {
            return m_handle;
          }

long System::ProcessDescriptor::ProcessHandle::item | ( | ) | `[inline]`

Definition at line 117 of file ProcessDescriptor.h.

                       {
            return m_needRelease ? 1 : 0;
          }

## Member Data Documentation

void* System::ProcessDescriptor::ProcessHandle::m_handle`[private]`

Definition at line 112 of file ProcessDescriptor.h.

bool System::ProcessDescriptor::ProcessHandle::m_needRelease`[private]`

Definition at line 113 of file ProcessDescriptor.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/src/Lib/ProcessDescriptor.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/src/Lib/ProcessDescriptor.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines