rad 6.2.0
|
#include <ReplaceRules.h>
Public Types | |
enum | ElementType { State = 0 , Event , Guard , Action , Activity } |
Public Member Functions | |
ReplaceRules () | |
ReplaceRules (const ReplaceRules &)=default | |
ReplaceRules & | operator= (const ReplaceRules &)=default |
void | add (const ElementType elementType, const std::string &srcId, const std::string &dstId) |
void | clear () |
std::string | apply (const ElementType elementType, const std::string &srcId) |
const std::map< std::string, std::string > & | get () const |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const ReplaceRules &rules) |
This class can be used to store rules to replace SCXML element identifiers with others when the model is loaded or appended.
scxml4cpp::ReplaceRules::ReplaceRules | ( | ) |
Constructor.
|
default |
void scxml4cpp::ReplaceRules::add | ( | const ElementType | elementType, |
const std::string & | srcId, | ||
const std::string & | dstId ) |
Add a rule to replace a given SCXML element identifier with another one. Note that if more than one rule with the same elementType and srcId is added, it will overwrite the existing one.
elementType | Type of the SCXML element (e.g. STATE, EVENT, etc.). |
srcId | Identifier to be replaced. |
dstId | Identifier to be used as replacement. |
std::string scxml4cpp::ReplaceRules::apply | ( | const ElementType | elementType, |
const std::string & | srcId ) |
Apply a rule to a given SCXML element identifier.
elementType | Type of SCXML element (e.g. STATE, EVENT, etc.). |
srcId | Identifier to be replaced. |
void scxml4cpp::ReplaceRules::clear | ( | ) |
Remove all added rules.
const std::map< std::string, std::string > & scxml4cpp::ReplaceRules::get | ( | ) | const |
|
default |
|
friend |
Allows to stream out the rules.
rules | An instance of the ReplaceRules. |