#include <codemodel.h>
Public Types | |
| typedef VariableDom | Ptr |
| Public Types inherited from CodeModelItem | |
| enum | Kind { File , Namespace , Class , Function , Variable , Argument , FunctionDefinition , Enum , Enumerator , TypeAlias , Custom = 1000 } |
| enum | Access { Public , Protected , Private } |
| typedef ItemDom | Ptr |
Public Member Functions | |
| virtual bool | isVariable () const |
| int | access () const |
| void | setAccess (int access) |
| bool | isStatic () const |
| void | setStatic (bool isStatic) |
| TQString | type () const |
| void | setType (const TQString &type) |
| bool | isEnumeratorVariable () const |
| void | setEnumeratorVariable (bool b) |
| virtual void | read (TQDataStream &stream) |
| virtual void | write (TQDataStream &stream) const |
| virtual void | dump (std::ostream &file, bool recurse=false, TQString Info="") |
| void | update (const VariableModel *i) |
| bool | canUpdate (const VariableModel *i) const |
| Public Member Functions inherited from CodeModelItem | |
| void | update (const CodeModelItem *i) |
| bool | canUpdate (const CodeModelItem *i) const |
| virtual | ~CodeModelItem () |
| int | kind () const |
| void | setKind (int kind) |
| TQString | name () const |
| TQString | comment () const |
| void | setComment (TQString comment) |
| void | setName (const TQString &name) |
| FileDom | file () |
| const FileDom | file () const |
| TQString | fileName () const |
| void | setFileName (const TQString &fileName) |
| void | getStartPosition (int *line, int *col) const |
| void | setStartPosition (int line, int col) |
| void | getEndPosition (int *line, int *col) const |
| void | setEndPosition (int line, int col) |
| virtual bool | isFile () const |
| virtual bool | isNamespace () const |
| virtual bool | isClass () const |
| virtual bool | isFunction () const |
| virtual bool | isFunctionDefinition () const |
| virtual bool | isArgument () const |
| virtual bool | isEnum () const |
| virtual bool | isEnumerator () const |
| virtual bool | isTypeAlias () const |
| virtual bool | isCustom () const |
| virtual bool | isTemplateable () const |
| CodeModel * | codeModel () |
| const CodeModel * | codeModel () const |
Protected Member Functions | |
| VariableModel (CodeModel *model) | |
| Protected Member Functions inherited from CodeModelItem | |
| CodeModelItem (int kind, CodeModel *model) | |
Friends | |
| class | CodeModel |
Detailed Description
Variable model.
Represents variables and class attributes.
Instances of this class should be created using CodeModel::create method.
Definition at line 1409 of file codemodel.h.
Member Typedef Documentation
◆ Ptr
| typedef VariableDom VariableModel::Ptr |
A definition of safe pointer to the variable model.
Definition at line 1418 of file codemodel.h.
Constructor & Destructor Documentation
◆ VariableModel()
|
protected |
Constructor.
- Parameters
-
model Code model which stores this item.
Definition at line 1199 of file codemodel.cpp.
Member Function Documentation
◆ access()
| int VariableModel::access | ( | ) | const |
- Returns
- The access level of the variable. Can return either values of type CodeModelItem::Access or other integers if the variable has other access level (for example pascal attributes can have "published" access level).
Definition at line 1270 of file codemodel.cpp.
◆ canUpdate()
| bool VariableModel::canUpdate | ( | const VariableModel * | i | ) | const |
Definition at line 1652 of file codemodel.cpp.
◆ dump()
|
virtual |
just to get rid of the warning
Reimplemented from CodeModelItem.
Definition at line 292 of file codemodel.cpp.
◆ isEnumeratorVariable()
| bool VariableModel::isEnumeratorVariable | ( | ) | const |
- Returns
- If this is an enumerator, the enum it is part of, else an empty string. This is just a hack, necessary because EnumeratorModel is not used at all by the cpp-code-model.
Definition at line 1227 of file codemodel.cpp.
◆ isStatic()
| bool VariableModel::isStatic | ( | ) | const |
- Returns
- true if the variable is a static variable.
Definition at line 1207 of file codemodel.cpp.
◆ isVariable()
|
inlinevirtual |
- Returns
- true if an item is a VariableModel.
Reimplemented from CodeModelItem.
Definition at line 1420 of file codemodel.h.
◆ read()
|
virtual |
Reads an item from the stream.
- Parameters
-
stream The stream to read from.
Reimplemented from CodeModelItem.
Definition at line 1635 of file codemodel.cpp.
◆ setAccess()
| void VariableModel::setAccess | ( | int | access | ) |
Sets the access level of the variable.
- Parameters
-
access The access level.
Definition at line 1275 of file codemodel.cpp.
◆ setEnumeratorVariable()
| void VariableModel::setEnumeratorVariable | ( | bool | b | ) |
Definition at line 1231 of file codemodel.cpp.
◆ setStatic()
| void VariableModel::setStatic | ( | bool | isStatic | ) |
Sets the variable to be a static variable.
- Parameters
-
isStatic The static flag.
Definition at line 1212 of file codemodel.cpp.
◆ setType()
| void VariableModel::setType | ( | const TQString & | type | ) |
Sets the type of the variable.
- Parameters
-
type The type name.
Definition at line 1222 of file codemodel.cpp.
◆ type()
| TQString VariableModel::type | ( | ) | const |
- Returns
- A type of the variable.
Definition at line 1217 of file codemodel.cpp.
◆ update()
| void VariableModel::update | ( | const VariableModel * | i | ) |
Definition at line 1647 of file codemodel.cpp.
◆ write()
|
virtual |
Writes an item to the stream.
- Parameters
-
stream The stream to write to.
Reimplemented from CodeModelItem.
Definition at line 1641 of file codemodel.cpp.
Friends And Related Symbol Documentation
◆ CodeModel
|
friend |
Definition at line 1464 of file codemodel.h.
The documentation for this class was generated from the following files:
Trinity API Reference