#include <codemodel.h>
Public Types | |
| typedef FunctionDom | 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 | isFunction () const |
| TQStringList | scope () const |
| void | setScope (const TQStringList &scope) |
| int | access () const |
| void | setAccess (int access) |
| bool | isSignal () const |
| void | setSignal (bool isSignal) |
| bool | isSlot () const |
| void | setSlot (bool isSlot) |
| bool | isVirtual () const |
| void | setVirtual (bool isVirtual) |
| bool | isStatic () const |
| void | setStatic (bool isStatic) |
| bool | isInline () const |
| void | setInline (bool isInline) |
| bool | isConstant () const |
| void | setConstant (bool isConstant) |
| bool | isAbstract () const |
| void | setAbstract (bool isAbstract) |
| TQString | resultType () const |
| void | setResultType (const TQString &type) |
| ArgumentList | argumentList () |
| const ArgumentList | argumentList () const |
| bool | addArgument (ArgumentDom arg) |
| void | removeArgument (ArgumentDom arg) |
| 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 FunctionModel *i) |
| bool | canUpdate (const FunctionModel *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 | isFunctionDefinition () const |
| virtual bool | isVariable () 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 | |
| FunctionModel (CodeModel *model) | |
Protected Member Functions inherited from CodeModelItem | |
| CodeModelItem (int kind, CodeModel *model) | |
Friends | |
| class | CodeModel |
Detailed Description
Function model.
Represents:
- functions;
- procedures;
- class methods;
In languages that have separate function declarations and definitions (c++) this represents only function declarations.
- See also
- FunctionDefinitionModel for a model of function definitions.
Instances of this class should be created using CodeModel::create method.
Definition at line 1245 of file codemodel.h.
Member Typedef Documentation
◆ Ptr
| typedef FunctionDom FunctionModel::Ptr |
A definition of safe pointer to the function model.
Definition at line 1254 of file codemodel.h.
Constructor & Destructor Documentation
◆ FunctionModel()
|
protected |
Constructor.
- Parameters
-
model Code model which stores this item.
Definition at line 1090 of file codemodel.cpp.
Member Function Documentation
◆ access()
| int FunctionModel::access | ( | ) | const |
- Returns
- The access level of the function. Can return either values of type CodeModelItem::Access or other integers if the function has other access level (for example pascal methods can have "published" access level).
Definition at line 1235 of file codemodel.cpp.
◆ addArgument()
| bool FunctionModel::addArgument | ( | ArgumentDom | arg | ) |
Adds an argument to the function.
- Parameters
-
arg The argument model to add as an argument to the function.
- Returns
- true if the addition was successful.
Definition at line 1173 of file codemodel.cpp.
◆ argumentList() [1/2]
| ArgumentList FunctionModel::argumentList | ( | ) |
Gets the list of arguments being passed to the function.
If there are no arguments, then the list is empty.
- Returns
- The ArgumentList object that contains the arguments for this function.
Definition at line 1163 of file codemodel.cpp.
◆ argumentList() [2/2]
| const ArgumentList FunctionModel::argumentList | ( | ) | const |
Gets the list of arguments being passed to the function.
If there are no arguments, then the list is empty.
- Returns
- The ArgumentList object that contains the arguments for this function.
- Note
- This is a const version provided for convenience.
Definition at line 1168 of file codemodel.cpp.
◆ canUpdate()
| bool FunctionModel::canUpdate | ( | const FunctionModel * | i | ) | const |
Definition at line 1189 of file codemodel.cpp.
◆ dump()
|
virtual |
Reimplemented from CodeModelItem.
Definition at line 261 of file codemodel.cpp.
◆ isAbstract()
| bool FunctionModel::isAbstract | ( | ) | const |
- Returns
- true if the function is an abstract function.
Definition at line 1143 of file codemodel.cpp.
◆ isConstant()
| bool FunctionModel::isConstant | ( | ) | const |
- Returns
- true if the function is a constant function.
Definition at line 1133 of file codemodel.cpp.
◆ isFunction()
|
inlinevirtual |
- Returns
- true if an item is a FunctionModel.
Reimplemented from CodeModelItem.
Definition at line 1256 of file codemodel.h.
◆ isInline()
| bool FunctionModel::isInline | ( | ) | const |
- Returns
- true if the function is an inline function.
Definition at line 1123 of file codemodel.cpp.
◆ isSignal()
| bool FunctionModel::isSignal | ( | ) | const |
- Returns
- true if the function is a signal.
Definition at line 1245 of file codemodel.cpp.
◆ isSlot()
| bool FunctionModel::isSlot | ( | ) | const |
- Returns
- true if the function is a slot.
Definition at line 1255 of file codemodel.cpp.
◆ isStatic()
| bool FunctionModel::isStatic | ( | ) | const |
- Returns
- true if the function is a static function.
Definition at line 1113 of file codemodel.cpp.
◆ isVirtual()
| bool FunctionModel::isVirtual | ( | ) | const |
- Returns
- true if the function is a virtual function.
Definition at line 1103 of file codemodel.cpp.
◆ read()
|
virtual |
Reads an item from the stream.
- Parameters
-
stream The stream to read from.
Reimplemented from CodeModelItem.
Definition at line 1574 of file codemodel.cpp.
◆ removeArgument()
| void FunctionModel::removeArgument | ( | ArgumentDom | arg | ) |
Removes an argument from the function.
- Parameters
-
arg The argument model to remove from the function.
Definition at line 1179 of file codemodel.cpp.
◆ resultType()
| TQString FunctionModel::resultType | ( | ) | const |
- Returns
- The result type of a function.
Definition at line 1153 of file codemodel.cpp.
◆ scope()
|
inline |
- Returns
- The scope of the function. Scope is a string list composed from names of parent functions, classes and namespaces.
Definition at line 1260 of file codemodel.h.
◆ setAbstract()
| void FunctionModel::setAbstract | ( | bool | isAbstract | ) |
Sets the function to be an inline function.
- Parameters
-
isAbstract The abstract flag.
Definition at line 1148 of file codemodel.cpp.
◆ setAccess()
| void FunctionModel::setAccess | ( | int | access | ) |
Sets the access level of the function.
- Parameters
-
access The access level.
Definition at line 1240 of file codemodel.cpp.
◆ setConstant()
| void FunctionModel::setConstant | ( | bool | isConstant | ) |
Sets the function to be a constant function.
- Parameters
-
isConstant The constant flag.
Definition at line 1138 of file codemodel.cpp.
◆ setInline()
| void FunctionModel::setInline | ( | bool | isInline | ) |
Sets the function to be an inline function.
- Parameters
-
isInline The inline flag.
Definition at line 1128 of file codemodel.cpp.
◆ setResultType()
| void FunctionModel::setResultType | ( | const TQString & | type | ) |
Sets the result type of a function.
- Parameters
-
type The type of a function result.
Definition at line 1158 of file codemodel.cpp.
◆ setScope()
|
inline |
Sets the scope of the function.
- Parameters
-
scope The scope to set.
Definition at line 1264 of file codemodel.h.
◆ setSignal()
| void FunctionModel::setSignal | ( | bool | isSignal | ) |
Sets the function to be a signal.
- Parameters
-
isSignal The signal flag.
Definition at line 1250 of file codemodel.cpp.
◆ setSlot()
| void FunctionModel::setSlot | ( | bool | isSlot | ) |
Sets the function to be a slot.
- Parameters
-
isSlot The slot flag.
Definition at line 1260 of file codemodel.cpp.
◆ setStatic()
| void FunctionModel::setStatic | ( | bool | isStatic | ) |
Sets the function to be a static function.
- Parameters
-
isStatic The static flag.
Definition at line 1118 of file codemodel.cpp.
◆ setVirtual()
| void FunctionModel::setVirtual | ( | bool | isVirtual | ) |
Sets the function to be a virtual function.
- Parameters
-
isVirtual The virtual flag.
Definition at line 1108 of file codemodel.cpp.
◆ update()
| void FunctionModel::update | ( | const FunctionModel * | i | ) |
Definition at line 1184 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 1596 of file codemodel.cpp.
Friends And Related Symbol Documentation
◆ CodeModel
|
friend |
Definition at line 1374 of file codemodel.h.
Member Data Documentation
◆ flags
| int FunctionModel::flags |
Definition at line 1365 of file codemodel.h.
◆ m_abstract
| int FunctionModel::m_abstract |
Definition at line 1363 of file codemodel.h.
◆ m_constant
| int FunctionModel::m_constant |
Definition at line 1362 of file codemodel.h.
◆ m_inline
| int FunctionModel::m_inline |
Definition at line 1361 of file codemodel.h.
◆ m_signal
| int FunctionModel::m_signal |
Definition at line 1357 of file codemodel.h.
◆ m_slot
| int FunctionModel::m_slot |
Definition at line 1358 of file codemodel.h.
◆ m_static
| int FunctionModel::m_static |
Definition at line 1360 of file codemodel.h.
◆ m_virtual
| int FunctionModel::m_virtual |
Definition at line 1359 of file codemodel.h.
The documentation for this class was generated from the following files:
Trinity API Reference
Public Types inherited from