// $Id$ // // File: jc_cmsg.h // Created: Sun Dec 27 23:31:21 EST 2009 // Creator: davidl (on Darwin harriet.jlab.org 9.8.0 i386) // #ifndef _jc_cmsg_ #define _jc_cmsg_ #include #include #include #include #include #include using namespace std; #if HAVE_CMSG #include using namespace cmsg; #ifndef _DBG_ #define _DBG_ cerr<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ cerr<<__FILE__<<":"<<__LINE__<timeout = timeout;} void SendCommand(string cmd, string subject="janactl"); void PingServers(void); void ListRemoteProcesses(void); void GetRemoteProcesses(double max_time, NodeInfo_t *nodes, unsigned int &Nnodes); void GetThreadInfo(string subject); void ListConfigurationParameters(string subject); void ListSources(string subject); void GetSource(const char *subject, char *src, unsigned int len); void ListSourceTypes(string subject); void ListFactories(string subject); void ListPlugins(string subject); void ListCommandLines(string subject); void GetCommandLine(const char *name, char *cmd, unsigned int len); void GetHostInfo(string subject); void AttachPlugin(string subject, string plugin); void QuitNode(const char *node); void KillNode(const char *node); bool done; pthread_mutex_t mutex; double start_time; double last_ping_time; double last_threadinfo_time; map last_msg_received_time; map hosts; map > thrinfos; map config_params; string config_params_responder; // only print results from first to respond map > > sources; map > > hostInfos; map > > hostStatus; map hostNrespawns; vector > commandLines; map last_nevents; map levels; protected: void callback(cMsgMessage *msg, void *userObject); private: jc_cmsg(void); int verbose; cMsg *cMsgSys; string myname; bool is_connected; std::vector subscription_handles; double timeout; pthread_t ping_servers_thread; }; extern jc_cmsg *JC_CMSG; #endif // HAVE_CMSG #endif // _jc_cmsg_