Eclipse SUMO - Simulation of Urban MObility
GNEChange_Attribute Class Reference

the function-object for an editing operation (abstract base) More...

#include <GNEChange_Attribute.h>

Inheritance diagram for GNEChange_Attribute:
Collaboration diagram for GNEChange_Attribute:

Public Member Functions

 GNEChange_Attribute (GNEAttributeCarrier *ac, GNENet *net, bool forceChange, const SumoXMLAttr key, const std::string &value)
 Constructor. More...
 
 GNEChange_Attribute (GNEAttributeCarrier *ac, GNENet *net, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
 Constructor. More...
 
virtual FXuint size () const
 return actual size More...
 
bool trueChange ()
 wether original and new value differ More...
 
 ~GNEChange_Attribute ()
 Destructor. More...
 
inherited from GNEChange

get undo Name

FXString undoName () const
 return undoName More...
 
FXString redoName () const
 get Redo name More...
 
void undo ()
 undo action More...
 
void redo ()
 redo action More...
 

Protected Attributes

bool myForward
 we group antagonistic commands (create junction/delete junction) and keep them apart by this flag More...
 
GNENetmyNet
 the net to which operations shall be applied or which shall be informed about gui updates (we are not responsible for the pointer) More...
 

Private Attributes

GNEAttributeCarriermyAC
 the net to which all operations shall be applied More...
 
bool myForceChange
 flag used to force set attributes More...
 
const SumoXMLAttr myKey
 The attribute name (or the original attribute if we're editing a disjoint attribute) More...
 
const std::string myNewValue
 the original value More...
 
const std::string myOrigValue
 the original value More...
 

Detailed Description

the function-object for an editing operation (abstract base)

Definition at line 48 of file GNEChange_Attribute.h.

Constructor & Destructor Documentation

◆ GNEChange_Attribute() [1/2]

GNEChange_Attribute::GNEChange_Attribute ( GNEAttributeCarrier ac,
GNENet net,
const SumoXMLAttr  key,
const std::string &  value,
bool  customOrigValue = false,
const std::string &  origValue = "" 
)

Constructor.

Parameters
[in]acThe attribute-carrier to be modified
[in]netNet in which AC is saved
[in]keyThe attribute key
[in]valueThe new value

Definition at line 37 of file GNEChange_Attribute.cpp.

References toString().

◆ GNEChange_Attribute() [2/2]

GNEChange_Attribute::GNEChange_Attribute ( GNEAttributeCarrier ac,
GNENet net,
bool  forceChange,
const SumoXMLAttr  key,
const std::string &  value 
)

Constructor.

Parameters
[in]acThe attribute-carrier to be modified
[in]netNet in which AC is saved
[in]forceChangeenable or disable force change
[in]keyThe attribute key
[in]valueThe new value

Definition at line 50 of file GNEChange_Attribute.cpp.

References GNEReferenceCounter::incRef(), myAC, myKey, and toString().

◆ ~GNEChange_Attribute()

Member Function Documentation

◆ redo()

◆ redoName()

FXString GNEChange_Attribute::redoName ( ) const
virtual

get Redo name

Reimplemented from GNEChange.

Definition at line 150 of file GNEChange_Attribute.cpp.

References GNEAttributeCarrier::getTagStr(), and myAC.

◆ size()

FXuint GNEChange::size ( ) const
virtualinherited

return actual size

Definition at line 45 of file GNEChange.cpp.

◆ trueChange()

bool GNEChange_Attribute::trueChange ( )

wether original and new value differ

Definition at line 133 of file GNEChange_Attribute.cpp.

References myForceChange, myNewValue, and myOrigValue.

Referenced by GNEUndoList::p_add().

◆ undo()

◆ undoName()

FXString GNEChange_Attribute::undoName ( ) const
virtual

return undoName

Reimplemented from GNEChange.

Definition at line 144 of file GNEChange_Attribute.cpp.

References GNEAttributeCarrier::getTagStr(), and myAC.

Field Documentation

◆ myAC

GNEAttributeCarrier* GNEChange_Attribute::myAC
private

the net to which all operations shall be applied

Note
we are not responsible for the pointer

Definition at line 103 of file GNEChange_Attribute.h.

Referenced by GNEChange_Attribute(), redo(), redoName(), undo(), undoName(), and ~GNEChange_Attribute().

◆ myForceChange

bool GNEChange_Attribute::myForceChange
private

flag used to force set attributes

Definition at line 109 of file GNEChange_Attribute.h.

Referenced by trueChange().

◆ myForward

◆ myKey

const SumoXMLAttr GNEChange_Attribute::myKey
private

The attribute name (or the original attribute if we're editing a disjoint attribute)

Definition at line 106 of file GNEChange_Attribute.h.

Referenced by GNEChange_Attribute(), redo(), undo(), and ~GNEChange_Attribute().

◆ myNet

◆ myNewValue

const std::string GNEChange_Attribute::myNewValue
private

the original value

Definition at line 115 of file GNEChange_Attribute.h.

Referenced by redo(), and trueChange().

◆ myOrigValue

const std::string GNEChange_Attribute::myOrigValue
private

the original value

Definition at line 112 of file GNEChange_Attribute.h.

Referenced by trueChange(), and undo().


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