-
Notifications
You must be signed in to change notification settings - Fork 2
/
ClassBrowserInfo.h
46 lines (38 loc) · 1.85 KB
/
ClassBrowserInfo.h
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
#pragma once
#include "Compile\ScriptOM.h"
//
// This represents a node in the class browser tree. It contains a reference to a
// class, the class's name, and its superclass and subclasses.
//
// In addition, it contains methods that allow you to enumerate all the methods
// on object (by following its superclasses).
//
class SCIClassBrowserNode
{
public:
SCIClassBrowserNode(const sci::Script *pScriptIn) { _pScript = pScriptIn; _pClass = NULL; _pSuperClass = NULL; }
SCIClassBrowserNode() { _pScript = NULL; _pClass = NULL; _pSuperClass = NULL; }
~SCIClassBrowserNode();
int ComputeAllMethods(sci::MethodVector &map) const;
int ComputeAllProperties(sci::ClassPropertyVector &map) const;
void AddSubClass(SCIClassBrowserNode* pSubClass) { _subClasses.push_back(pSubClass); }
void RemoveSubClass(SCIClassBrowserNode* pSubClass);
// public accessors
const std::string &GetName() const { return _name; }
void SetName(const std::string &name) { _name = name; }
const sci::ClassDefinition *GetClassDefinition() const { return _pClass; }
void SetClassDefinition(const sci::ClassDefinition *pClass) { _pClass = pClass; }
const std::vector<SCIClassBrowserNode*> &GetSubClasses() const { return _subClasses; }
std::vector<SCIClassBrowserNode*> &GetSubClasses() { return _subClasses; }
const SCIClassBrowserNode *GetSuperClass() const { return _pSuperClass; }
SCIClassBrowserNode *GetSuperClass() { return _pSuperClass; }
void SetSuperClass(SCIClassBrowserNode *pClass) { _pSuperClass = pClass; }
void SetScript(const sci::Script *pScript) { _pScript = pScript; }
const sci::Script *GetScript() const { return _pScript; }
private:
std::string _name;
const sci::ClassDefinition *_pClass;
std::vector<SCIClassBrowserNode*> _subClasses;
SCIClassBrowserNode *_pSuperClass;
const sci::Script *_pScript;
};