OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
appdict.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of class TAppDictionary. This class manages associations between
7/// processes/tasks and TApplication pointers.
8//----------------------------------------------------------------------------
9
10#if !defined(OWL_APPDICT_H)
11#define OWL_APPDICT_H
12
13#include <owl/private/defs.h>
14#if defined(BI_HAS_PRAGMA_ONCE)
15# pragma once
16#endif
17
18#include <owl/defs.h>
19
20namespace owl {
21
22class _OWLCLASS TApplication;
23
24#include <owl/preclass.h>
25
26/// \addtogroup module
27/// @{
28/// \class TAppDictionary
29// ~~~~~ ~~~~~~~~~~~~~~
31 public:
32
33/// An application dictionary entry that associates a process ID (Pid) with an
34/// application (App). The dictionary is indexed by Pid and can have only 1 entry
35/// per process ID.
40
41/// A dictionary iterator function pointer type that receives a reference to an
42/// entry. You can supply a function of this type to the Iterate function to iterate
43/// through the entries in the dictionary.
44 typedef void (*TEntryIterator)(TEntry&);
45
46 public:
49
50 TApplication* GetApplication(uint pid = 0); // default to current pid
51
52 void Add(TApplication* app, uint pid = 0);
53 void Remove(TApplication* app);
54 void Remove(uint pid);
55 void Condemn(TApplication* app);
56
57 bool DeleteCondemned();
58 void Iterate(TEntryIterator iter);
59
60 private:
61 class TAppDictImp* Imp;
62};
63
64/// @}
65
66#include <owl/posclass.h>
67
68
69/// Global exported TAppDictionary in Owl. User Component DLLs should have a
70/// similar 'AppDictionary'.
71//
73
74//
75/// Global function that calls GetApplication() on owl's app-dictionary.
76/// Used by EXEs, or DLLs statically linking Owl. Never returns 0, will make
77/// an alias app if needed. Primarily for compatibility
78//
80
81
82} // OWL namespace
83
84
85//
86/// Convenient macro to define a 'AppDictionary' ref and object as needed
87/// for use in component DLLs and EXEs
88//
89#if defined(BI_APP_DLL) && defined(_OWLDLL)
90# define DEFINE_APP_DICTIONARY(AppDictionary) \
91 ::owl::TAppDictionary AppDictionary
92#else
93# define DEFINE_APP_DICTIONARY(AppDictionary) \
94 ::owl::TAppDictionary& AppDictionary = ::owl::OWLGetAppDictionary()
95#endif
96
97
98#endif // OWL_APPDICT_H
TAppDictionary implementation for DLLs only.
Definition appdict.h:30
Derived from TModule and TMsgThread and virtually derived from TEventHandler, TApplication acts as an...
Definition applicat.h:141
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
TApplication * GetApplicationObject(uint pid=0)
Global function that calls GetApplication() on owl's app-dictionary.
Definition appdict.cpp:298
TAppDictionary & OWLGetAppDictionary()
Global exported TAppDictionary in Owl.
Definition appdict.cpp:35
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
#define _OWLFUNC(p)
Definition defs.h:341
#define _OWLCLASS
Definition defs.h:338
An application dictionary entry that associates a process ID (Pid) with an application (App).
Definition appdict.h:36
TApplication * App
Definition appdict.h:38
uint Pid
Definition appdict.h:37