Changeset View
Changeset View
Standalone View
Standalone View
src/ProcessInfo.h
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
72 | class ProcessInfo | 72 | class ProcessInfo | ||
73 | { | 73 | { | ||
74 | public: | 74 | public: | ||
75 | /** | 75 | /** | ||
76 | * Constructs a new instance of a suitable ProcessInfo sub-class for | 76 | * Constructs a new instance of a suitable ProcessInfo sub-class for | ||
77 | * the current platform which provides information about a given process. | 77 | * the current platform which provides information about a given process. | ||
78 | * | 78 | * | ||
79 | * @param pid The pid of the process to examine | 79 | * @param pid The pid of the process to examine | ||
80 | * @param titleFormat The local title format - used to determine if it | | |||
81 | * contains %u which requires expensive prodecures to be used. | | |||
82 | */ | 80 | */ | ||
83 | static ProcessInfo *newInstance(int pid, const QString &titleFormat); | 81 | static ProcessInfo *newInstance(int pid); | ||
84 | 82 | | |||
85 | virtual ~ProcessInfo() | 83 | virtual ~ProcessInfo() | ||
86 | { | 84 | { | ||
87 | } | 85 | } | ||
88 | 86 | | |||
89 | /** | 87 | /** | ||
90 | * Updates the information about the process. This must | 88 | * Updates the information about the process. This must | ||
91 | * be called before attempting to use any of the accessor methods. | 89 | * be called before attempting to use any of the accessor methods. | ||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Line(s) | |||||
300 | */ | 298 | */ | ||
301 | class NullProcessInfo : public ProcessInfo | 299 | class NullProcessInfo : public ProcessInfo | ||
302 | { | 300 | { | ||
303 | public: | 301 | public: | ||
304 | /** | 302 | /** | ||
305 | * Constructs a new NullProcessInfo instance. | 303 | * Constructs a new NullProcessInfo instance. | ||
306 | * See ProcessInfo::newInstance() | 304 | * See ProcessInfo::newInstance() | ||
307 | */ | 305 | */ | ||
308 | explicit NullProcessInfo(int pid, const QString &titleFormat); | 306 | explicit NullProcessInfo(int pid); | ||
309 | protected: | 307 | protected: | ||
310 | void readProcessInfo(int pid) Q_DECL_OVERRIDE; | 308 | void readProcessInfo(int pid) Q_DECL_OVERRIDE; | ||
311 | bool readCurrentDir(int pid) Q_DECL_OVERRIDE; | 309 | bool readCurrentDir(int pid) Q_DECL_OVERRIDE; | ||
312 | void readUserName(void) Q_DECL_OVERRIDE; | 310 | void readUserName(void) Q_DECL_OVERRIDE; | ||
313 | }; | 311 | }; | ||
314 | 312 | | |||
315 | #if !defined(Q_OS_WIN) | 313 | #if !defined(Q_OS_WIN) | ||
316 | /** | 314 | /** | ||
317 | * Implementation of ProcessInfo for Unix platforms which uses | 315 | * Implementation of ProcessInfo for Unix platforms which uses | ||
318 | * the /proc filesystem | 316 | * the /proc filesystem | ||
319 | */ | 317 | */ | ||
320 | class UnixProcessInfo : public ProcessInfo | 318 | class UnixProcessInfo : public ProcessInfo | ||
321 | { | 319 | { | ||
322 | public: | 320 | public: | ||
323 | /** | 321 | /** | ||
324 | * Constructs a new instance of UnixProcessInfo. | 322 | * Constructs a new instance of UnixProcessInfo. | ||
325 | * See ProcessInfo::newInstance() | 323 | * See ProcessInfo::newInstance() | ||
326 | */ | 324 | */ | ||
327 | explicit UnixProcessInfo(int pid, const QString &titleFormat); | 325 | explicit UnixProcessInfo(int pid); | ||
328 | 326 | | |||
329 | protected: | 327 | protected: | ||
330 | /** | 328 | /** | ||
331 | * Implementation of ProcessInfo::readProcessInfo(); calls the | 329 | * Implementation of ProcessInfo::readProcessInfo(); calls the | ||
332 | * four private methods below in turn. | 330 | * four private methods below in turn. | ||
333 | */ | 331 | */ | ||
334 | void readProcessInfo(int pid) Q_DECL_OVERRIDE; | 332 | void readProcessInfo(int pid) Q_DECL_OVERRIDE; | ||
335 | 333 | | |||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |