AeClient.h
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// AeClient.h
//
// This abstract base class represents clients of the
// asset database which need to be notified whenever a
// change is made to asset data.
//
// The asset database notifies clients of data modifications
// through the virtual update messages - UpdateAsset,
// UpdateNewAsset, etc.
//
// At certain times, there may be a batch of modifications
// made to the database such as reading in an entire bank files
// assets. In this case, the database can be told to suspend
// updates until all data changes have been made. Then,
// when UpdateResume is called, all the necessary updates can
// take place at once.
//
// Note that when suspending updates, the database still calls
// the update routines but the suspended flag will be true. This
// means that the client is responsible for suspending all or part
// of the update process. This is important since editors may
// want to update internal data right away and only suspend UI processing.
//
#ifndef __AeClient__
#define __AeClient__
#include "AeTypes.h"
#define kInvalidRef -1
typedef int TClientRef;
class AeAssetBase;
class AeAsset;
class AeClient
{
public:
AeClient (void);
virtual ~AeClient (void);
virtual void SetAssetBase (AeAssetBase *);
AeAssetBase * GetAssetBase (void) { return fAssetBase; }
void SetRef (TClientRef ref) { fRef = ref; }
TClientRef GetRef (void) { return fRef; }
virtual void CreateAsset (AeAsset *, Boolean);
virtual void UpdateAsset (AeAsset *, Boolean);
virtual void DeleteAsset (AeAsset *, Boolean);
virtual void SelectAsset (AeAsset *, Boolean);
virtual void OnlineAsset (AeAsset *, Boolean);
virtual void UpdateResume (void);
protected:
AeAssetBase * fAssetBase;
TClientRef fRef;
};
#endif __AeClient__