#include "../../shared/SimpleLogFile.h" #include "../../shared/ReplyToClient.h" #include "GenericTosData.h" //////////////////////////////////////////////////////////////////// // GenericTosDataNode //////////////////////////////////////////////////////////////////// const std::string debugPrefix = "GenericTosDataNode.debug."; GenericTosDataNode::GenericTosDataNode(DataNodeArgument const &args) : _symbol(args.getStringValue()), _valid(false) { _last.clear(); registerForBroadcast(debugPrefix + _symbol, bmDebug); } DataNodeLink *GenericTosDataNode::find(DataNodeListener *listener, int msgId, GenericTosDataNode *&node, std::string const &symbol) { if (implementation) { // Captured by a real data feed. return implementation(listener, msgId, node, symbol); } // Use the default, which only presents debug messages. return findHelper(listener, msgId, node, symbol); } Debugger *GenericTosDataNode::debugger = NULL; void GenericTosDataNode::registerDebugger(DataNodeManager *manager) { // This class doesn't make any real attempt to deal with multiple calls to // this function. Presumably if you try to start this twice, the command // handler will complain about a duplicate command name being registered. // If it was important, we could get around that limitation by taking the // command name as an imput to this function. debugger = new Debugger("debug_tos", bmDebug, debugPrefix, manager); } void GenericTosDataNode::onBroadcast(BroadcastMessage &message, int msgId) { switch (msgId) { case bmDebug: { DebugMessage const &m = dynamic_cast< DebugMessage const & >(message); PropertyList const &p = m.getProperties(); sendToLogFile(TclList()<