The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
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 118 of file ProcessDescriptor.h.

Constructor & Destructor Documentation

◆ ProcessHandle()

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

Definition at line 331 of file ProcessDescriptor.cpp.

331 {
332 if ( pid > 0 ) {
333 if ( pid != ::getpid() ) {
334 // Note: the return type of getpid is pid_t, which is int on 64bit machines too
335 m_handle = reinterpret_cast<void*>( static_cast<long>( ::getpid() ) );
336 m_needRelease = true;
337 return;
338 }
339 }
341 m_needRelease = false;
342}
GAUDI_API ProcessHandle processHandle()
Handle to running process.

◆ ~ProcessHandle()

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

Definition at line 344 of file ProcessDescriptor.cpp.

344 {
345 if ( m_needRelease ) { m_handle = nullptr; }
346}

Member Function Documentation

◆ handle()

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

Definition at line 126 of file ProcessDescriptor.h.

126{ return m_handle; }

◆ item()

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

Definition at line 125 of file ProcessDescriptor.h.

125{ return m_needRelease ? 1 : 0; }

Member Data Documentation

◆ m_handle

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

Definition at line 119 of file ProcessDescriptor.h.

◆ m_needRelease

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

Definition at line 120 of file ProcessDescriptor.h.


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