-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContentManager.h
More file actions
77 lines (57 loc) · 2.86 KB
/
ContentManager.h
File metadata and controls
77 lines (57 loc) · 2.86 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
66
67
68
69
70
71
72
73
74
75
76
77
// ======================================================================================
// File : ContentManager.h
// Author : Li Chen
// Last Change : 01/07/2011 | 14:42:59 PM | Friday,January
// Description :
// ======================================================================================
#ifndef GAMESERVICE_CONTENT_MANAGER_H
#define GAMESERVICE_CONTENT_MANAGER_H
#include "Message.h"
namespace GameService
{
//--------------------------------------------------------------------------------------
// Name: ContentManager
// Desc: Maintains a list of installed content packages.
//--------------------------------------------------------------------------------------
class ContentManager : public MessageRecipient
{
public:
// Need to define these since I've declared the copy constructor
ContentManager(MessageMgr* msgMgr);
GS_BOOL Initialize();
GS_VOID Finalize();
//--------------------------------------------------------------------------------------
// Name: operator[]
// Desc: Used for iterating over the XCONTENT_DATA collection
//--------------------------------------------------------------------------------------
XCONTENT_DATA operator[](GS_DWORD dw) { return m_aContentData(dw);}
//--------------------------------------------------------------------------------------
// Name: Count
// Desc: report the number of elements in the XCONTENT_DATA collection
//--------------------------------------------------------------------------------------
GS_DWORD Count() { return m_aContentData.Num(); }
GS_BOOL Enumerate();
GS_VOID Cleanup();
// inherit from MessageHandler
GS_VOID MessageResponse(Message* message);
public:
//--------------------------------------------------------------------------------------
// Name: Update
// Desc: Checks to see if the enumerator is ready and if so updates the enumerator
//--------------------------------------------------------------------------------------
GS_VOID Update();
//--------------------------------------------------------------------------------------
// Name: OnContentInstalled
// Desc: This method is called in response to XN_LIVE_CONTENT_INSTALLED
// Kicks off another enumeration to discover new content packages
//--------------------------------------------------------------------------------------
GS_BOOL OnContentInstalled();
private:
TArray<XCONTENT_DATA> m_aContentData; // Collection of XCONTENT_DATA
HANDLE m_hEnumeration;
XOVERLAPPED m_Overlapped; // Overlapped structure for asynchronous I/O
GS_DWORD m_dwBufferSize; // Size of the enumeration buffer
GS_BYTE* m_pBuffer; // Pointer to the enumeration buffer
};
} // namespace
#endif // GAMESERVICE_CONTENT_MANAGER_H