Assets.c++
1.45 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
78
79
80
81
82
83
84
/*****************************************************************************
* File: Assets.c++
*
* General AEAsset Class Implementations
*
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "Assets.h"
/*****************************************************************************
*
* Initialization Routines
*
****************************************************************************/
AEAsset::AEAsset()
{
refList = new RefList;
assert(refList);
hdwrXRef = 0;
name = 0;
AssetMgrNode = 0;
}
AEAsset::~AEAsset()
{
delete refList;
if(name)
free(name);
}
/*****************************************************************************
*
* Asset's Methods
*
****************************************************************************/
void AEAsset::SetName(char *n)
{
name = (char*)malloc(strlen(n));
assert(name);
strcpy(name,n);
}
char* AEAsset::GetName(void)
{
return name;
}
void AEAsset::AddReference(AEAsset *asset)
{
refList->Append(asset);
}
void AEAsset::RemoveReference(AEAsset *asset)
{
refList->RemoveByData(asset);
}
int AEAsset::GetRefCt(void)
{
return refList->count;
}
void AEAsset::SetHdwrXRef(void *ref)
{
hdwrXRef = ref;
}
void* AEAsset::GetHdwrXRef(void)
{
return hdwrXRef;
}
int AEAsset::GetClass(void)
{
return classType;
}