• 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
NamespaceModel Class Reference

#include <codemodel.h>

Inheritance diagram for NamespaceModel:
ClassModel CodeModelItem FileModel

Public Types

typedef std::set< NamespaceAliasModel > NamespaceAliasModelList
typedef std::set< NamespaceImportModel > NamespaceImportModelList
typedef NamespaceDom Ptr
Public Types inherited from ClassModel
typedef ClassDom 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 isClass () const
virtual bool isNamespace () const
NamespaceList namespaceList ()
const NamespaceList namespaceList () const
bool hasNamespace (const TQString &name) const
NamespaceDom namespaceByName (const TQString &name)
const NamespaceDom namespaceByName (const TQString &name) const
bool addNamespace (NamespaceDom ns)
void removeNamespace (NamespaceDom ns)
void update (const NamespaceModel *ns)
bool canUpdate (const NamespaceModel *ns) const
virtual void read (TQDataStream &stream)
virtual void write (TQDataStream &stream) const
virtual void dump (std::ostream &file, bool recurse=false, TQString Info="")
void addNamespaceImport (const NamespaceImportModel &import)
void addNamespaceAlias (const NamespaceAliasModel &alias)
void removeNamespaceImport (const NamespaceImportModel &import)
void removeNamespaceAlias (const NamespaceAliasModel &alias)
const NamespaceAliasModelList & namespaceAliases () const
const NamespaceImportModelList & namespaceImports () const
Public Member Functions inherited from ClassModel
TQStringList scope () const
void setScope (const TQStringList &scope)
TQStringList baseClassList () const
bool addBaseClass (const TQString &baseClass)
void removeBaseClass (const TQString &baseClass)
ClassList classList ()
const ClassList classList () const
bool hasClass (const TQString &name) const
ClassList classByName (const TQString &name)
const ClassList classByName (const TQString &name) const
bool addClass (ClassDom klass)
void removeClass (ClassDom klass)
FunctionList functionList ()
const FunctionList functionList () const
bool hasFunction (const TQString &name) const
FunctionList functionByName (const TQString &name)
const FunctionList functionByName (const TQString &name) const
bool addFunction (FunctionDom fun)
void removeFunction (FunctionDom fun)
FunctionDefinitionList functionDefinitionList ()
const FunctionDefinitionList functionDefinitionList () const
bool hasFunctionDefinition (const TQString &name) const
FunctionDefinitionList functionDefinitionByName (const TQString &name)
const FunctionDefinitionList functionDefinitionByName (const TQString &name) const
bool addFunctionDefinition (FunctionDefinitionDom fun)
void removeFunctionDefinition (FunctionDefinitionDom fun)
VariableList variableList ()
const VariableList variableList () const
bool hasVariable (const TQString &name) const
VariableDom variableByName (const TQString &name)
const VariableDom variableByName (const TQString &name) const
bool addVariable (VariableDom var)
void removeVariable (VariableDom var)
TypeAliasList typeAliasList ()
const TypeAliasList typeAliasList () const
bool hasTypeAlias (const TQString &name) const
TypeAliasList typeAliasByName (const TQString &name)
const TypeAliasList typeAliasByName (const TQString &name) const
bool addTypeAlias (TypeAliasDom typeAlias)
void removeTypeAlias (TypeAliasDom typeAlias)
EnumList enumList ()
const EnumList enumList () const
bool hasEnum (const TQString &name) const
EnumDom enumByName (const TQString &name)
const EnumDom enumByName (const TQString &name) const
bool addEnum (EnumDom e)
void removeEnum (EnumDom e)
void update (const ClassModel *i)
bool canUpdate (const ClassModel *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 isFunction () 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

 NamespaceModel (CodeModel *model)
Protected Member Functions inherited from ClassModel
 ClassModel (CodeModel *model)
Protected Member Functions inherited from CodeModelItem
 CodeModelItem (int kind, CodeModel *model)

Friends

class CodeModel

Detailed Description

Namespace model.

Represents a namespace in the code model. Namespace model can represent either usual c++ namespaces and packages or modules from other languages.

Instances of this class should be created using CodeModel::create method.

Definition at line 1039 of file codemodel.h.

Member Typedef Documentation

◆ NamespaceAliasModelList

typedef std::set<NamespaceAliasModel> NamespaceModel::NamespaceAliasModelList

Definition at line 1047 of file codemodel.h.

◆ NamespaceImportModelList

typedef std::set<NamespaceImportModel> NamespaceModel::NamespaceImportModelList

I'm using std-sets here, because TQt-3 has no appropriate replacement.

Definition at line 1048 of file codemodel.h.

◆ Ptr

typedef NamespaceDom NamespaceModel::Ptr

A definition of safe pointer to the namespace model.

Definition at line 1051 of file codemodel.h.

Constructor & Destructor Documentation

◆ NamespaceModel()

NamespaceModel::NamespaceModel ( CodeModel * model)
protected

Constructor.

Parameters
modelCode model which stores this item.

Definition at line 664 of file codemodel.cpp.

Member Function Documentation

◆ addNamespace()

bool NamespaceModel::addNamespace ( NamespaceDom ns)

Adds a namespace to the model.

Parameters
nsThe namespace model to add to the model.
Returns
true if addition was successful.

Definition at line 695 of file codemodel.cpp.

◆ addNamespaceAlias()

void NamespaceModel::addNamespaceAlias ( const NamespaceAliasModel & alias)

Definition at line 1453 of file codemodel.cpp.

◆ addNamespaceImport()

void NamespaceModel::addNamespaceImport ( const NamespaceImportModel & import)

Definition at line 1449 of file codemodel.cpp.

◆ canUpdate()

bool NamespaceModel::canUpdate ( const NamespaceModel * ns) const

Test if all aliases are same, if not return false

Test if all imports are same, if not return false

Definition at line 1482 of file codemodel.cpp.

◆ dump()

void NamespaceModel::dump ( std::ostream & file,
bool recurse = false,
TQString Info = "" )
virtual

Reimplemented from ClassModel.

Definition at line 235 of file codemodel.cpp.

◆ hasNamespace()

bool NamespaceModel::hasNamespace ( const TQString & name) const

Checks if the namespace referenced by name is in the model.

Parameters
nameThe name of a namespace.
Returns
true if the namespace was found.

Definition at line 690 of file codemodel.cpp.

◆ isClass()

virtual bool NamespaceModel::isClass ( ) const
inlinevirtual
Returns
true if an item is a ClassModel.

Reimplemented from ClassModel.

Definition at line 1053 of file codemodel.h.

◆ isNamespace()

virtual bool NamespaceModel::isNamespace ( ) const
inlinevirtual
Returns
true if an item is a NamespaceModel.

Reimplemented from CodeModelItem.

Definition at line 1054 of file codemodel.h.

◆ namespaceAliases()

const NamespaceAliasModelList & NamespaceModel::namespaceAliases ( ) const
inline

Must not be called on temporary objects because a reference is returned(for performance-reasons).

Definition at line 1107 of file codemodel.h.

◆ namespaceByName() [1/2]

NamespaceDom NamespaceModel::namespaceByName ( const TQString & name)

Gets the namespace specified by name.

If there are no matches, then the NamespaceDom object returned is empty.

Parameters
nameThe name of a namespace.
Returns
The NamespaceDom object that contains the match.

Definition at line 680 of file codemodel.cpp.

◆ namespaceByName() [2/2]

const NamespaceDom NamespaceModel::namespaceByName ( const TQString & name) const

Gets the namespace specified by name.

If there are no matches, then the NamespaceDom object returned is empty.

Parameters
nameThe name of a namespace.
Returns
The NamespaceDom object that contains the match.
Note
This is a const version provided for convenience.

Definition at line 685 of file codemodel.cpp.

◆ namespaceImports()

const NamespaceImportModelList & NamespaceModel::namespaceImports ( ) const
inline

Must not be called on temporary objects because a reference is returned(for performance-reasons).

Definition at line 1112 of file codemodel.h.

◆ namespaceList() [1/2]

NamespaceList NamespaceModel::namespaceList ( )
Returns
The list of namespaces in this model.

Definition at line 670 of file codemodel.cpp.

◆ namespaceList() [2/2]

const NamespaceList NamespaceModel::namespaceList ( ) const
Returns
The list of namespaces in this model.
Note
This is a const version provided for convenience.

Definition at line 675 of file codemodel.cpp.

◆ read()

void NamespaceModel::read ( TQDataStream & stream)
virtual

Reads an item from the stream.

Parameters
streamThe stream to read from.

Reimplemented from ClassModel.

Reimplemented in FileModel.

Definition at line 1421 of file codemodel.cpp.

◆ removeNamespace()

void NamespaceModel::removeNamespace ( NamespaceDom ns)

Removes the namespace from the model.

Parameters
nsThe namespace model to remove from the model.

Definition at line 704 of file codemodel.cpp.

◆ removeNamespaceAlias()

void NamespaceModel::removeNamespaceAlias ( const NamespaceAliasModel & alias)

Definition at line 1461 of file codemodel.cpp.

◆ removeNamespaceImport()

void NamespaceModel::removeNamespaceImport ( const NamespaceImportModel & import)

Definition at line 1457 of file codemodel.cpp.

◆ update()

void NamespaceModel::update ( const NamespaceModel * ns)

Updates this model so it has the same content as the other one.

Only the line/column is updated. canUpdate(..) must be tested before.

Parameters
nsthe namespace to match

Definition at line 1519 of file codemodel.cpp.

◆ write()

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

Writes an item to the stream.

Parameters
streamThe stream to write to.

Reimplemented from ClassModel.

Reimplemented in FileModel.

Definition at line 1465 of file codemodel.cpp.

Friends And Related Symbol Documentation

◆ CodeModel

friend class CodeModel
friend

Definition at line 1124 of file codemodel.h.


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.15.0
This website is maintained by Timothy Pearson.