OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
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
20
namespace
owl
{
21
22
class
_OWLCLASS
TApplication
;
23
24
#include <
owl/preclass.h
>
25
26
/// \addtogroup module
27
/// @{
28
/// \class TAppDictionary
29
// ~~~~~ ~~~~~~~~~~~~~~
30
class
_OWLCLASS
TAppDictionary
{
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.
36
struct
TEntry
{
37
uint
Pid
;
38
TApplication
*
App
;
39
};
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
:
47
TAppDictionary
();
48
~TAppDictionary
();
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
//
72
extern
_OWLFUNC
(
TAppDictionary
&)
OWLGetAppDictionary
();
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
//
79
_OWLFUNC
(
TApplication
*)
GetApplicationObject
(
uint
pid = 0);
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
owl::TAppDictionary
TAppDictionary implementation for DLLs only.
Definition
appdict.h:30
owl::TAppDictionary::Condemn
void Condemn(TApplication *app)
Marks an application in this dictionary as condemned by zeroing its process ID so that the applicatio...
Definition
appdict.cpp:247
owl::TAppDictionary::GetApplication
TApplication * GetApplication(uint pid=0)
Looks up and returns the application associated with a given process ID.
Definition
appdict.cpp:192
owl::TAppDictionary::TEntryIterator
void(*) TEntryIterator(TEntry &)
A dictionary iterator function pointer type that receives a reference to an entry.
Definition
appdict.h:44
owl::TAppDictionary::TAppDictionary
TAppDictionary()
Application dictionary constructor.
Definition
appdict.cpp:171
owl::TAppDictionary::DeleteCondemned
bool DeleteCondemned()
Deletes all condemned applications from the dictionary.
Definition
appdict.cpp:280
owl::TAppDictionary::Iterate
void Iterate(TEntryIterator iter)
Iterates through the entries in the application dictionary, calling the iter callback function for ea...
Definition
appdict.cpp:270
owl::TAppDictionary::Remove
void Remove(TApplication *app)
Searches for the dictionary entry using the specified application (app).
Definition
appdict.cpp:218
owl::TAppDictionary::Add
void Add(TApplication *app, uint pid=0)
Adds an application object (app) and corresponding process ID to this dictionary.
Definition
appdict.cpp:205
owl::TApplication
Derived from TModule and TMsgThread and virtually derived from TEventHandler, TApplication acts as an...
Definition
applicat.h:141
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::GetApplicationObject
TApplication * GetApplicationObject(uint pid=0)
Global function that calls GetApplication() on owl's app-dictionary.
Definition
appdict.cpp:298
owl::OWLGetAppDictionary
TAppDictionary & OWLGetAppDictionary()
Global exported TAppDictionary in Owl.
Definition
appdict.cpp:35
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
General definitions used by all ObjectWindows programs.
defs.h
_OWLFUNC
#define _OWLFUNC(p)
Definition
defs.h:341
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
owl::TAppDictionary::TEntry
An application dictionary entry that associates a process ID (Pid) with an application (App).
Definition
appdict.h:36
owl::TAppDictionary::TEntry::App
TApplication * App
Definition
appdict.h:38
owl::TAppDictionary::TEntry::Pid
uint Pid
Definition
appdict.h:37
include
owl
appdict.h
Generated by
1.18.0