Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6thread.h
Go to the documentation of this file.
1 
11 #ifndef P6THREAD_H__
12 #define P6THREAD_H__ 1
13 
14 #ifdef DOX_IGNORE
15 #include "p6com.h"
16 #endif
17 
18 #include "p6log.h"
19 #include "p6errorinfo.h"
20 
21 
22 #ifdef __cplusplus
23 namespace P6R {
24 extern "C" {
25 #endif
26 
41  #undef INTERFACE
42  #define INTERFACE p6ICreateErrorInfo
44  {
46 
78  P6DECLCOMMETHOD(initialize)(P6THIS_ P6ERR error,
79  const P6IID *piid,
80  const P6CHAR *pszFilename,
81  P6UINT32 cLine,
82  const P6WCHAR *pwszContext,
83  const P6WCHAR *pwszDescription) P6PURE;
84  };
85  // {D89A40FE-5144-4A4F-BFE6-93954BE2933B}
86  #define IF_p6ICreateErrorInfo {0xD89A40FE,0x5144,0x4A4F,{0xBF,0xE6,0x93,0x95,0x4B,0xE2,0x93,0x3B}}
87 
97  #undef INTERFACE
98  #define INTERFACE p6ICurThread
100  {
102 
113  P6DECLCOMMETHOD(setThreadState)(P6THIS_ const P6WCHAR *pcszwState) P6PURE;
114 
122  P6DECLCOMMETHOD(setPriority)(P6THIS_ P6THREADPRIORITY nPriority) P6PURE;
123 
135  P6DECLCOMMETHOD(getThreadInfo)(P6THIS_ P6THREADINFO *pInfoBuffer) P6PURE;
136 
144  P6DECLCOMMETHOD(getThreadId)(P6THIS_ P6THREADID *pId) P6PURE;
145 
157  P6DECLCOMMETHOD(getLogger)(P6THIS_ p6ILogProducer **ppThreadLogger) P6PURE;
158 
159 
168  P6DECLCOMMETHOD(sleep)(P6THIS_ P6INTERVAL tTimeout) P6PURE;
169 
185  P6DECLCOMMETHOD(createErrorInfo)(P6THIS_ p6ICreateErrorInfo **ppCreateInfo) P6PURE;
186 
203  P6DECLCOMMETHOD(setErrorInfo)(P6THIS_ p6ICreateErrorInfo *pInfo) P6PURE;
204 
214  P6DECLCOMMETHOD(getErrorInfo)(P6THIS_ p6IErrorInfo **ppInfo) P6PURE;
215 
227  P6DECLCOMMETHOD(flushErrorInfo)(P6THIS_ p6ILogProducer *pLog) P6PURE;
228  };
229  // {54F02315-49CB-4053-A3EF-2AD07DFCA448}
230  #define IF_p6ICurThread {0x54F02315,0x49CB,0x4053,{0xA3,0xEF,0x2A,0xD0,0x7D,0xFC,0xA4,0x48}}
231 
242  typedef P6VOID (*P6THREADMAIN)(p6ICurThread *pCurThread,p6ILogProducer *pThreadLogger,P6VOID *pArg);
243 
250  static const P6THREADFLAGS P6TF_NONE = 0x00000000;
251  static const P6THREADFLAGS P6TF_RESERVED1 = 0x80000000;
252  static const P6THREADFLAGS P6TF_RESERVED2 = 0x40000000;
262  #undef INTERFACE
263  #define INTERFACE p6IThread
265  {
267 
292  P6DECLCOMMETHOD(initialize)(P6THIS_ P6THREADFLAGS fFlags,const P6WCHAR *pcszwThreadName,P6UINT32 cStack,P6THREADPRIORITY nPriority,P6THREADMAIN pfnThread,P6VOID *pArg) P6PURE;
293 
300  P6DECLCOMMETHOD(start)(P6THIS) P6PURE;
301 
308 
320  P6DECLCOMMETHOD(getThreadInfo)(P6THIS_ P6THREADINFO *pInfoBuffer) P6PURE;
321 
329  P6DECLCOMMETHOD(setPriority)(P6THIS_ P6THREADPRIORITY nPriority) P6PURE;
330  };
331 
332  // {A6AF4610-CA9F-4B98-A98C-A7719AF6C69A}
333  #define IF_p6IThread {0xA6AF4610,0xCA9F,0x4B98,{0xA9,0x8C,0xA7,0x71,0x9A,0xF6,0xC6,0x9A}}
334 
335  // {CC7A814C-36B5-4729-8D9D-F270876A90EB}
336  #define COMP_p6Thread {0xCC7A814C,0x36B5,0x4729,{0x8D,0x9D,0xF2,0x70,0x87,0x6A,0x90,0xEB}}
337 
338 
344  #undef INTERFACE
345  #define INTERFACE p6IEnumThreadInfo
347  {
349 
368  P6DECLCOMMETHOD(next)(P6THIS_ P6UINT32 cElements,P6THREADINFO *parElements,P6UINT32 *pcReturned) P6PURE;
369 
378  P6DECLCOMMETHOD(reset)(P6THIS) P6PURE;
379  };
380  #define IF_p6IEnumThreadInfo {0x1E89BCB5,0xB0D7,0x4d56,{0xBE,0xAA,0x5C,0x6D,0xF3,0x40,0xAD,0x6D}}
381 
389  #undef INTERFACE
390  #define INTERFACE p6IThreadManager
392  {
394 
406  P6DECLCOMMETHOD(enumThreads)(P6THIS_ p6IEnumThreadInfo **ppEnum) P6PURE;
407 
408  P6DECLCOMMETHOD(getCurrentThread)(P6THIS_ p6ICurThread **ppCurThread) P6PURE;
409 
410  P6DECLCOMMETHOD(getCurrentThreadLogger)(P6THIS_ p6ILogProducer **ppLogger) P6PURE;
411  };
412  // {2F097B8D-3E90-4579-AB44-9A4550595FFD}
413  #define IF_p6IThreadManager {0x2F097B8D,0x3E90,0x4579,{0xAB,0x44,0x9A,0x45,0x50,0x59,0x5F,0xFD}}
414 
416 #ifdef __cplusplus
417 } // extern "C"
418 } // namespace
419 #endif
420 
421 
422 #endif
423 
P6UINT32 P6THREADFLAGS
Defines thread startup flags.
Definition: p6thread.h:249
uint32_t P6UINT32
Definition: p6types.h:77
#define P6DECLAREICOM
Definition: p6defs.h:191
Enumerator for the running thread table.
Definition: p6thread.h:346
#define P6PURE
Definition: p6defs.h:192
This interface is used by a thread to manage information about itself.
Definition: p6thread.h:99
This interface is used to externally manage a thread.
Definition: p6thread.h:264
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:111
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
This interface is used to create new threads as well as get an enumerator to get information about ea...
Definition: p6thread.h:391
Log producer component interfaces.
p6IErrorInfo interface definition
A universally unique indentifier (UUID).
Definition: p6types.h:162
P6UINT32 P6ERR
COM err return type see P6ERR.h.
Definition: p6types.h:141
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
P6VOID(* P6THREADMAIN)(p6ICurThread *pCurThread, p6ILogProducer *pThreadLogger, P6VOID *pArg)
Defines the signature of a thread main entry point.
Definition: p6thread.h:242
#define P6THIS_
Definition: p6defs.h:193
P6COM definitions and interfaces.
void P6VOID
Definition: p6types.h:109
#define P6THIS
Definition: p6defs.h:194
This interface is used to initialize a COM exception record with information about an error condition...
Definition: p6thread.h:43
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188