Index: /trunk/FACT++/src/MessageImp.cc
===================================================================
--- /trunk/FACT++/src/MessageImp.cc	(revision 10382)
+++ /trunk/FACT++/src/MessageImp.cc	(revision 10383)
@@ -37,4 +37,38 @@
 MessageImp::MessageImp(ostream &out) : fOut(out)
 {
+}
+
+// --------------------------------------------------------------------------
+//
+//! This is a special write function formatting a string when the
+//! state of a state machine has changed.
+//! 
+//! If the state is <-1 nothing is done.
+//!
+//! Calls the virtual function IndicateStateChange
+//!
+//! @param time
+//!    The time assigned to the message
+//!
+//! @param server
+//!    The server name which is emitting the state change
+//!
+//! @param msg
+//!    The message text
+//!
+//! @param state
+//!    The new state of the system
+//
+void MessageImp::StateChanged(const Time &time, const string &server, const string &msg, int state)
+{
+    if (state<-1)
+        return;
+
+    ostringstream out;
+    out << server << ": Changed state to " << state << " '" << msg << "' received.";
+
+    Write(time, out.str(), MessageImp::kInfo);
+
+    IndicateStateChange(time, server);
 }
 
Index: /trunk/FACT++/src/MessageImp.h
===================================================================
--- /trunk/FACT++/src/MessageImp.h	(revision 10382)
+++ /trunk/FACT++/src/MessageImp.h	(revision 10383)
@@ -28,4 +28,6 @@
     MessageImp(std::ostream &out=std::cout);
 
+    virtual void IndicateStateChange(const Time &time, const std::string &server) { }
+    void StateChanged(const Time &time, const std::string &server, const std::string &msg, int state);
     virtual int Write(const Time &time, const std::string &txt, int qos=kInfo);
 
