out << " NodeID m_version;" << endl;
out << " Network* m_net_ptr;" << endl;
out << " MachineID m_machineID;" << endl;
- out << " static " << component << "_Profiler s_profiler;" << endl;
+ out << " " << component << "_Profiler s_profiler;" << endl;
out << " static int m_num_controllers;" << endl;
// internal function protypes
out << "stringstream " << component << "_" << "transitionComment;" << endl;
out << "#define APPEND_TRANSITION_COMMENT(str) (" << component << "_" << "transitionComment << str)" << endl;
- out << "/** \\brief static profiler defn */" << endl;
- out << component << "_Profiler " << component << "_Controller::s_profiler;" << endl;
- out << endl;
-
out << "/** \\brief constructor */" << endl;
out << component << "_Controller::" << component
// << "_Controller(int version, Network* net_ptr)" << endl;
// initialize objects
out << " // Objects" << endl;
+ out << " s_profiler.setVersion(m_version);" << endl;
for(int i=0; i < numObjects(); i++) {
const Var* var = m_objs[i];
if (!var->existPair("network")) {
out << "class " << component << "_Profiler {" << endl;
out << "public:" << endl;
out << " " << component << "_Profiler();" << endl;
+ out << " void setVersion(int version);" << endl;
out << " void countTransition(" << component << "_State state, " << component << "_Event event);" << endl;
out << " void possibleTransition(" << component << "_State state, " << component << "_Event event);" << endl;
out << " void dumpStats(ostream& out) const;" << endl;
out << " int m_counters[" << component << "_State_NUM][" << component << "_Event_NUM];" << endl;
out << " int m_event_counters[" << component << "_Event_NUM];" << endl;
out << " bool m_possible[" << component << "_State_NUM][" << component << "_Event_NUM];" << endl;
+ out << " int m_version;" << endl;
out << "};" << endl;
out << "#endif // " << component << "_PROFILER_H" << endl;
}
out << " }" << endl;
out << "}" << endl;
+ // setVersion
+ out << "void " << component << "_Profiler::setVersion(int version)" << endl;
+ out << "{" << endl;
+ out << " m_version = version;" << endl;
+ out << "}" << endl;
+
// Clearstats
out << "void " << component << "_Profiler::clearStats()" << endl;
out << "{" << endl;
// dumpStats
out << "void " << component << "_Profiler::dumpStats(ostream& out) const" << endl;
out << "{" << endl;
- out << " out << \" --- " << component << " ---\" << endl;" << endl;
+ out << " out << \" --- " << component << " \" << m_version << \" ---\" << endl;" << endl;
out << " out << \" - Event Counts -\" << endl;" << endl;
out << " for (int event = 0; event < " << component << "_Event_NUM; event++) {" << endl;
out << " int count = m_event_counters[event];" << endl;