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:
Inheritance graph
Collaboration diagram for GNEChange_Attribute:
Collaboration graph

Public Member Functions

 GNEChange_Attribute (GNENetElement *netElement, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
 Constructor for NetElements. More...
 
 GNEChange_Attribute (GNEAdditional *additional, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
 Constructor for Additionals. More...
 
 GNEChange_Attribute (GNEShape *shape, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
 Constructor for Shapes. 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...
 

Private Attributes

GNEAttributeCarriermyAC
 the net to which all operations shall be applied More...
 
GNEAdditionalmyAdditional
 used if AC is an additional element More...
 
SumoXMLAttr myKey
 The attribute name. More...
 
GNENetmyNet
 pointer to Net (used to simplify code) More...
 
GNENetElementmyNetElement
 used if AC is an net element More...
 
std::string myNewValue
 the original value More...
 
std::string myOrigValue
 the original value More...
 
GNEShapemyShape
 used if AC is a shape element More...
 

Detailed Description

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

Definition at line 47 of file GNEChange_Attribute.h.

Constructor & Destructor Documentation

◆ GNEChange_Attribute() [1/3]

GNEChange_Attribute::GNEChange_Attribute ( GNENetElement netElement,
const SumoXMLAttr  key,
const std::string &  value,
bool  customOrigValue = false,
const std::string &  origValue = "" 
)

Constructor for NetElements.

Parameters
[in]acThe attribute-carrier to be modified
[in]keyThe attribute key
[in]valueThe new value
[in]testingModeflag to indicate if netedit is running in testing mode

Definition at line 40 of file GNEChange_Attribute.cpp.

References toString().

◆ GNEChange_Attribute() [2/3]

GNEChange_Attribute::GNEChange_Attribute ( GNEAdditional additional,
const SumoXMLAttr  key,
const std::string &  value,
bool  customOrigValue = false,
const std::string &  origValue = "" 
)

Constructor for Additionals.

Parameters
[in]acThe attribute-carrier to be modified
[in]keyThe attribute key
[in]valueThe new value
[in]testingModeflag to indicate if netedit is running in testing mode

Definition at line 57 of file GNEChange_Attribute.cpp.

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

◆ GNEChange_Attribute() [3/3]

GNEChange_Attribute::GNEChange_Attribute ( GNEShape shape,
const SumoXMLAttr  key,
const std::string &  value,
bool  customOrigValue = false,
const std::string &  origValue = "" 
)

Constructor for Shapes.

Parameters
[in]acThe attribute-carrier to be modified
[in]keyThe attribute key
[in]valueThe new value
[in]testingModeflag to indicate if netedit is running in testing mode

Definition at line 74 of file GNEChange_Attribute.cpp.

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

◆ ~GNEChange_Attribute()

Member Function Documentation

◆ redo()

◆ redoName()

FXString GNEChange_Attribute::redoName ( ) const
virtual

get Redo name

Reimplemented from GNEChange.

Definition at line 163 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.

Referenced by GNELane::isValid().

◆ trueChange()

bool GNEChange_Attribute::trueChange ( )

wether original and new value differ

Definition at line 151 of file GNEChange_Attribute.cpp.

References myNewValue, and myOrigValue.

Referenced by GNEUndoList::p_add().

◆ undo()

◆ undoName()

FXString GNEChange_Attribute::undoName ( ) const
virtual

return undoName

Reimplemented from GNEChange.

Definition at line 157 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 112 of file GNEChange_Attribute.h.

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

◆ myAdditional

GNEAdditional* GNEChange_Attribute::myAdditional
private

used if AC is an additional element

Definition at line 130 of file GNEChange_Attribute.h.

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

◆ myForward

◆ myKey

SumoXMLAttr GNEChange_Attribute::myKey
private

The attribute name.

Definition at line 115 of file GNEChange_Attribute.h.

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

◆ myNet

GNENet* GNEChange_Attribute::myNet
private

pointer to Net (used to simplify code)

Definition at line 124 of file GNEChange_Attribute.h.

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

◆ myNetElement

GNENetElement* GNEChange_Attribute::myNetElement
private

used if AC is an net element

Definition at line 127 of file GNEChange_Attribute.h.

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

◆ myNewValue

std::string GNEChange_Attribute::myNewValue
private

the original value

Definition at line 121 of file GNEChange_Attribute.h.

Referenced by redo(), and trueChange().

◆ myOrigValue

std::string GNEChange_Attribute::myOrigValue
private

the original value

Definition at line 118 of file GNEChange_Attribute.h.

Referenced by trueChange(), and undo().

◆ myShape

GNEShape* GNEChange_Attribute::myShape
private

used if AC is a shape element

Definition at line 133 of file GNEChange_Attribute.h.

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


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