8 #ifndef __DIADES__AUTOMATA__EXPERIMENTAL__IO__HH__ 9 #define __DIADES__AUTOMATA__EXPERIMENTAL__IO__HH__ 23 namespace Experimental
33 os <<
"digraph G {\n";
34 os <<
"\tratio=fill;\n";
35 os <<
"\tpage=\"8.5,11.6\";\n";
36 os <<
"\tsize=\"7.5,10.5\";\n";
47 template<
typename StateMachine>
52 os <<
"\tlabel=\"Component name = " << fsm.
name() <<
"\\nState Number= ";
63 template<
typename StateMachine>
73 os <<
"\t init" << indexInitial <<
"\t [label=\"\",color=white];\n";
74 os <<
"\t init" << indexInitial <<
" -> " << *it <<
";\n";
81 typename PrintStateProperty>
89 os <<
"\t" << *stateIt <<
"\t [shape=rectangle,label=\"";
95 template<
typename S,
typename I,
typename NS,
typename NI,
typename Pr
intStateProperty>
102 os <<
"\t" << *stateIt <<
"\t [shape=";
105 os <<
"doubleoctagon";
118 template<
typename StateMachine>
127 os <<
"\t" << *stateIt <<
"\t [shape=rectangle,label=\"";
134 template<
typename S,
typename I,
typename NS,
typename NI>
143 os <<
"\t" << *stateIt <<
"\t [shape=";
146 os <<
"doubleoctagon";
168 typename PrintEventInfo>
177 os <<
"\t" << transIt->source() <<
" -> " << transIt->target()
179 eventPrinter.print(os, fsm.
getEvent(*transIt));
185 template<
typename StateProperty,
typename EventInfo,
typename Pr
intEventInfo>
188 const PrintEventInfo & eventPrinter, ostream & os)
196 os <<
"\t" << transIt->source() <<
" -> " << transIt->target()
198 eventPrinter.print(os, fsm.
getEvent(*transIt));
201 os <<
"\",color=red];\n";
211 template<
typename StateMachine>
221 os <<
"\t" << transIt->source() <<
" -> " << transIt->target()
229 template<
typename StateProperty,
typename EventInfo>
239 os <<
"\t" << transIt->source() <<
" -> " << transIt->target()
244 os <<
"\",color=red];\n";
265 typename PrintStateProperty,
typename PrintEventInfo>
269 const PrintStateProperty & statePrinter,
270 const PrintEventInfo & eventPrinter)
288 template<
typename StateMachine>
308 template<
typename StateMachine>
313 std::ofstream file(filename);
340 return descriptor.
toDot(os);
ostream & toDotHeader(ostream &os)
ostream & toDotTransitions(const StateMachine &fsm, const PrintEventInfo &eventPrinter, ostream &os)
bool isFaulty(const EventPropertyId &e) const
ostream & toDotEnding(ostream &os)
ostream & toDotInitialStates(const StateMachine &fsm, ostream &os)
InitialStateIterator initialStateEnd() const
StateIterator stateEnd() const
ostream & toDotStates(const StateMachine &fsm, const PrintStateProperty &statePrinter, ostream &os)
ostream & toDot(ostream &os, const StateMachine &fsm, const PrintStateProperty &statePrinter, const PrintEventInfo &eventPrinter)
const EventPropertyId & getEvent(Transition t) const
Namespace of the Diades project.
unsigned numberOfStates() const
InitialStateIterator initialStateBegin() const
unsigned numberOfTransitions() const
StateIterator stateBegin() const
TransitionIterator transitionBegin() const
const StatePropertyId & getStatePropertyId(State state) const
ostream & toDot(ostream &os) const
bool isAcceptingState(State s) const
const string & name() const
TransitionIterator transitionEnd() const