• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • TDevelop Interfaces Library
 

TDevelop Interfaces Library

Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
FunctionModel Class Reference

#include <codemodel.h>

Inheritance diagram for FunctionModel:
CodeModelItem FunctionDefinitionModel

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()

FunctionModel::FunctionModel ( CodeModel *  model)
protected

Constructor.

Parameters
modelCode 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
argThe 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.

◆ 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()

virtual bool FunctionModel::isFunction ( ) const
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()

void FunctionModel::read ( TQDataStream &  stream)
virtual

Reads an item from the stream.

Parameters
streamThe 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
argThe 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()

TQStringList FunctionModel::scope ( ) const
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
isAbstractThe abstract flag.

Definition at line 1148 of file codemodel.cpp.

◆ setAccess()

void FunctionModel::setAccess ( int  access)

Sets the access level of the function.

Parameters
accessThe 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
isConstantThe 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
isInlineThe 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
typeThe type of a function result.

Definition at line 1158 of file codemodel.cpp.

◆ setScope()

void FunctionModel::setScope ( const TQStringList &  scope)
inline

Sets the scope of the function.

Parameters
scopeThe 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
isSignalThe signal flag.

Definition at line 1250 of file codemodel.cpp.

◆ setSlot()

void FunctionModel::setSlot ( bool  isSlot)

Sets the function to be a slot.

Parameters
isSlotThe 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
isStaticThe 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
isVirtualThe virtual flag.

Definition at line 1108 of file codemodel.cpp.

◆ write()

void FunctionModel::write ( TQDataStream &  stream) const
virtual

Writes an item to the stream.

Parameters
streamThe stream to write to.

Reimplemented from CodeModelItem.

Definition at line 1596 of file codemodel.cpp.


The documentation for this class was generated from the following files:
  • codemodel.h
  • codemodel.cpp

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for TDevelop Interfaces Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.