47
43
bool _DepBaseClass;
50
/** This constructor is to be used by classes inherited from
51
* CClassInfo. It makes it possible to set another object id
52
* than \c CLASS_INFO for abstractions not representing a
53
* standard C++ class (e.g. CClassInstance).
54
* \param id The object id to be used instead of \c CLASS_INFO. */
47
* \param id The object type. */
55
48
CClassInfo (ObjectId id);
58
/** Construct a new CClassInfo object. */
60
/** Destroy the CClassInfo object. If the object id is
61
* \c CLASS_INFO, Puma::CObjectInfo::CleanUp() is called. */
53
/** Destructor. If the object type is CObjectInfo::CLASS_INFO,
54
* then CObjectInfo::CleanUp() is called. */
64
/** Get the base info object of the info object. <b>The
65
* corresponding information is not yet set!</b>
66
* \return This method always returns \c NULL.
67
* \warning Do not use this method. */
68
CClassInfo *BaseObject () const;
69
/** Get the info object of the class definition.
70
* \return The info or \e this if the class is not defined. */
57
/** Get the semantic object of the class definition.
58
* \see CObjectInfo::DefObject() */
71
59
CClassInfo *DefObject () const;
72
/** Get the type information object for the class. */
60
/** Get the type information for the class. */
73
61
CTypeClass *TypeInfo () const;
75
63
/** Get the number of the base classes of the class. */
77
65
/** Get the number of classes derived from the class. */
78
66
unsigned DerivedClasses() const;
79
67
/** Get the n-th base class.
80
* \param n The number of the base class to return.
81
* \return The base class info or \c NULL if \e n is not valid. */
68
* \param n The index of the base class.
69
* \return The base class or if \e n is not valid. */
82
70
CBaseClassInfo *BaseClass (unsigned n) const;
83
71
/** Get the base class with the given name.
84
* \param name The name of the base class to return.
85
* \return The base class info or \c NULL if there is no base
72
* \param name The name of the base class.
73
* \return The base class or NULL if there is no base
86
74
* class with the given name. */
87
75
CBaseClassInfo *BaseClass (const char *name) const;
88
76
/** Get the n-th derived class.
89
* \param n The number of the derived class to return.
90
* \return The class info of the derived class or \c NULL
91
* if \e n is not valid. */
77
* \param n The index of the derived class.
78
* \return The derived class or NULL if \e n is not valid. */
92
79
CClassInfo *DerivedClass (unsigned n) const;
93
80
/** Get the derived class with the given name.
94
* \param name The name of the derived class to return.
95
* \return The class info of the derived class or \c NULL
96
* if there is no derived class with the given name. */
81
* \param name The name of the derived class.
82
* \return The derived class or NULL if there is no derived
83
* class with the given name. */
97
84
CClassInfo *DerivedClass (const char *name) const;
99
/** Return \e true if the given class is a base class of the class.
100
* \param ci The class info of the possible base class.
101
* \param recursive If \e false it is only checked whether \e ci
102
* is a direct base class. */
103
bool isBaseClass (const CClassInfo *ci, bool recursive = false) const;
104
/** Return \e true if the given class is a derived class of the class.
105
* \param ci The class info of the possible base class.
106
* \param recursive If \e false it is only checked whether \e ci
107
* is directly derived from the class. */
108
bool isDerivedClass (const CClassInfo *ci, bool recursive = false) const;
109
/** Mark the class to have a base class that depends on template
86
/** Check if the given class is a base class of this class.
87
* \param base The base class.
88
* \param recursive If \e false then only the direct base classes
90
bool isBaseClass (const CClassInfo *base, bool recursive = false) const;
91
/** Check if the given class is derived from this class.
92
* \param dc The derived class.
93
* \param recursive If \e false then only the directly derived classes
95
bool isDerivedClass (const CClassInfo *dc, bool recursive = false) const;
96
/** Set that this class has a base class that depends on template
111
98
* \param depends \e true if there is a dependent base class. */
112
99
void hasDepBaseClass (bool depends);
113
/** Return \e true if the class has a base class that depends on
100
/** Check if this class has a base class that depends on
114
101
* template parameters. */
115
102
bool hasDepBaseClass () const;
117
/** Add a base class to the class.
118
* \param bc The base class info object. */
104
/** Add a base class to this class.
105
* \param bc The base class. */
119
106
void addBaseClass (CBaseClassInfo *bc);
120
/** Add a derived class to the class.
121
* \param dc The class info object of the derived class. */
107
/** Add a derived class to this class.
108
* \param dc The derived class. */
122
109
void addDerivedClass (CClassInfo *dc);
123
/** Remove the given base class from the class.
124
* \param bc The base class info object to remove. */
110
/** Remove the given base class from this class.
111
* \param bc The base class. */
125
112
void removeBaseClass (const CBaseClassInfo *bc);
126
/** Remove the given base class from the class.
127
* \param bc The class info object of the base class to remove. */
113
/** Remove the given base class from this class.
114
* \param bc The base class. */
128
115
void removeBaseClass (const CClassInfo *bc);
129
/** Remove the given derived class from the class.
130
* \param dc The class info object of the derived class to remove. */
116
/** Remove the given derived class from this class.
117
* \param dc The derived class. */
131
118
void removeDerivedClass (const CClassInfo *dc);
133
/** Create a new base class info object.
134
* \param bc The class info of the base class or \c NULL to create
135
* an empty base class info object.
136
* \return The new base class info object. */
120
/** Create a new base class semantic object.
121
* \param bc The semantic information about the of the base class
122
* or NULL to create an empty base class semantic object. */
137
123
CBaseClassInfo *newBaseClass (CClassInfo *bc = 0);
139
/** Return \e true if the class is declared using the keyword 'struct'. */
125
/** Check if the class is declared using keyword 'struct'. */
140
126
bool isStruct () const;
142
/** Returns the accessibility of a particular member or base class member.
143
* For example, if the accessibility is "private", the object can be
144
* accessed by members of this class, but not by other classes.
145
* \param oi The object info of the checked function/attribute/...
146
* \return The accessibility, i.e. private, public, protected, or none */
128
/** Get the accessibility of a particular member or base class member.
129
* \param oi The semantic object for the member. */
147
130
CProtection::Type Accessibility (CObjectInfo *oi) const;
149
/** Returns true if the argument function overrides any virtual function
132
/** Check if the given function overrides any virtual function
150
133
* defined in this class or any of its base classes.
151
* \param fi function info object of the checked function. */
134
* \param fi The function. */
152
135
bool overridesVirtual (const CFunctionInfo *fi) const;
154
/** Returns true if this class is an aggregate according to 8.5.1-1. */
137
/** Check if this class is an aggregate according to
138
* paragraph 8.5.1-1 of the ISO C++ standard. */
155
139
bool isAggregate () const;