rad 6.2.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
scxml4cpp::ReplaceRules Class Reference

#include <ReplaceRules.h>

Public Types

enum  ElementType {
  State = 0 , Event , Guard , Action ,
  Activity
}
 

Public Member Functions

 ReplaceRules ()
 
 ReplaceRules (const ReplaceRules &)=default
 
ReplaceRulesoperator= (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)
 

Detailed Description

This class can be used to store rules to replace SCXML element identifiers with others when the model is loaded or appended.

Member Enumeration Documentation

◆ ElementType

Enumerator
State 
Event 
Guard 
Action 
Activity 

Constructor & Destructor Documentation

◆ ReplaceRules() [1/2]

scxml4cpp::ReplaceRules::ReplaceRules ( )

Constructor.

◆ ReplaceRules() [2/2]

scxml4cpp::ReplaceRules::ReplaceRules ( const ReplaceRules & )
default

Member Function Documentation

◆ add()

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.

Parameters
elementTypeType of the SCXML element (e.g. STATE, EVENT, etc.).
srcIdIdentifier to be replaced.
dstIdIdentifier to be used as replacement.

◆ apply()

std::string scxml4cpp::ReplaceRules::apply ( const ElementType elementType,
const std::string & srcId )

Apply a rule to a given SCXML element identifier.

Parameters
elementTypeType of SCXML element (e.g. STATE, EVENT, etc.).
srcIdIdentifier to be replaced.
Returns
Replacement for the given identifier.

◆ clear()

void scxml4cpp::ReplaceRules::clear ( )

Remove all added rules.

◆ get()

const std::map< std::string, std::string > & scxml4cpp::ReplaceRules::get ( ) const
Returns
The replacement rules.

◆ operator=()

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const ReplaceRules & rules )
friend

Allows to stream out the rules.

Parameters
rulesAn instance of the ReplaceRules.
Returns
The output stream.

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