NCL Composer  0.1.5
 All Classes Functions Variables Pages
composer::core::model::Entity Class Reference

An Entity is the main class of the internal Composer core. More...

#include <Entity.h>

Inheritance diagram for composer::core::model::Entity:
Collaboration diagram for composer::core::model::Entity:

Public Member Functions

QString getAttribute (QString name)
 This method is used to get an specific attribute of the element. More...
 
void getAttributeIterator (QMap< QString, QString >::iterator &begin, QMap< QString, QString >::iterator &end)
 This method is used to get the iterator in the <map> of attributes. More...
 
bool hasAttribute (const QString &name)
 This method is used to verify if this element has certain attribute. More...
 
QString getUniqueId ()
 
QString getType ()
 
EntitygetParent ()
 
QString getParentUniqueId ()
 
void setDeleteChildren (bool mustDelete)
 Tell if the children should be deleted when this entity is deleted through destructor. More...
 
QVector< Entity * > getChildren ()
 
QString toString (int ntabs, bool writeuid=true)
 Convert the current Entity to a XML String. More...
 
EntitycloneEntity ()
 Creates a clone of the current entity. More...
 

Protected Member Functions

 Entity (QObject *parent=0)
 Constructor. More...
 
 Entity (QMap< QString, QString > &atts, QObject *parent=0)
 Constructor. More...
 
 Entity (QString uniqueId, QString type, QMap< QString, QString > &atts, QObject *parent=0)
 Contructor. More...
 
 ~Entity ()
 Destructor.
 
void setAttribute (QString name, QString value)
 This method is used to set an specific attribute of the element. More...
 
void setAtrributes (QMap< QString, QString > &newatts)
 Set the attributes of the current entity to the value passed as parameter. More...
 
void setType (QString type)
 Set the entity's type to the value passed as parameter. More...
 
void setUniqueID (QString uniqueId)
 Set the unique identifier of the entity to the value passed as parameter. More...
 
void setParent (Entity *parent)
 Set the parent of the Entity. More...
 
bool addChild (Entity *entity)
 
bool deleteChild (Entity *entity)
 This call deletes the child and his children in a recursive way. More...
 
bool removeChildAppendChildren (Entity *entity)
 This call removes the child and append his children to his parent. More...
 
void print ()
 Prints the Entity and its children.
 

Friends

class composer::core::model::Project
 
class composer::core::MessageControl
 
class composer::core::ProjectReader
 
class composer::core::util::EditCommand
 
class composer::core::util::AddCommand
 
class composer::core::util::RemoveCommand
 

Detailed Description

An Entity is the main class of the internal Composer core.

The internal model Composer model is a tree of Entities.

Definition at line 45 of file Entity.h.

Constructor & Destructor Documentation

composer::core::model::Entity::Entity ( QObject *  parent = 0)
explicitprotected

Constructor.

Parameters
parentThe QObject parent.

Definition at line 16 of file Entity.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

composer::core::model::Entity::Entity ( QMap< QString, QString > &  atts,
QObject *  parent = 0 
)
explicitprotected

Constructor.

Parameters
attsattributes to be set to this Entity.
parentthe QObject parent.

Definition at line 25 of file Entity.cpp.

Here is the call graph for this function:

composer::core::model::Entity::Entity ( QString  uniqueId,
QString  type,
QMap< QString, QString > &  atts,
QObject *  parent = 0 
)
explicitprotected

Contructor.

Parameters
uniqueIdthe uniqueId of this Entiy.
typethe type of the Entity.
attsattributes to be set to this Entity.
parentthe QObject parent.

Definition at line 36 of file Entity.cpp.

Here is the call graph for this function:

Member Function Documentation

Entity * composer::core::model::Entity::cloneEntity ( )

Creates a clone of the current entity.

All the content of the entity will be cloned, including its uniqueId.

Definition at line 246 of file Entity.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool composer::core::model::Entity::deleteChild ( Entity entity)
protected

This call deletes the child and his children in a recursive way.

Deletes the child and its children in a recursive way.

Parameters
entityThe Entity child to be removed.

Definition at line 113 of file Entity.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString composer::core::model::Entity::getAttribute ( QString  name)

This method is used to get an specific attribute of the element.

Parameters
name- The name of the attribute been requested
Returns
A string with the requested attribute.

Definition at line 130 of file Entity.cpp.

void composer::core::model::Entity::getAttributeIterator ( QMap< QString, QString >::iterator &  begin,
QMap< QString, QString >::iterator &  end 
)

This method is used to get the iterator in the <map> of attributes.

Parameters
begin- a reference to be filled with the begin of the map.
end- a reference to be filled with the end of the map.

Definition at line 136 of file Entity.cpp.

bool composer::core::model::Entity::hasAttribute ( const QString &  name)

This method is used to verify if this element has certain attribute.

Parameters
name- The name of the attribute to be verified.
Returns
an boolean depending of the existence of the attribute.

Definition at line 144 of file Entity.cpp.

bool composer::core::model::Entity::removeChildAppendChildren ( Entity entity)
protected

This call removes the child and append his children to his parent.

Removes the child and append his children to his parent.

Parameters
entity

Definition at line 185 of file Entity.cpp.

Here is the call graph for this function:

void composer::core::model::Entity::setAtrributes ( QMap< QString, QString > &  newatts)
protected

Set the attributes of the current entity to the value passed as parameter.

Parameters
newAttsthe new value of entity's attributes.

Definition at line 68 of file Entity.cpp.

Here is the caller graph for this function:

void composer::core::model::Entity::setAttribute ( QString  name,
QString  value 
)
protected

This method is used to set an specific attribute of the element.

Parameters
name- The name of the attribute to be set
value- The value this attribute is going to be set

Definition at line 62 of file Entity.cpp.

void composer::core::model::Entity::setDeleteChildren ( bool  mustDelete)

Tell if the children should be deleted when this entity is deleted through destructor.

Parameters
mustDeletetell if the children also must be deleted.

Definition at line 173 of file Entity.cpp.

Here is the caller graph for this function:

void composer::core::model::Entity::setParent ( Entity parent)
protected

Set the parent of the Entity.

Parameters
parentThe new parent of this Entity.

Definition at line 91 of file Entity.cpp.

Here is the caller graph for this function:

void composer::core::model::Entity::setType ( QString  type)
protected

Set the entity's type to the value passed as parameter.

Parameters
typeThe type of the entity.

Definition at line 79 of file Entity.cpp.

Here is the caller graph for this function:

void composer::core::model::Entity::setUniqueID ( QString  uniqueId)
protected

Set the unique identifier of the entity to the value passed as parameter.

Parameters
_idThe new uniqueId of the entity.

Definition at line 85 of file Entity.cpp.

Here is the caller graph for this function:

QString composer::core::model::Entity::toString ( int  ntabs,
bool  writeuid = true 
)

Convert the current Entity to a XML String.

Parameters
ntabsthe number of tabs to be inserted before the current entity.

Definition at line 210 of file Entity.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: