1 #ifndef __JRUNCONTROL__JCLIENT__ 
    2 #define __JRUNCONTROL__JCLIENT__ 
   66             const std::string& __hostname,
 
   67             const std::string& __start_command = 
"") :
 
  109     void stop(
const int signal = -9)
 
  114       if (start_command != 
"") {
 
  116         const string header  = 
"__header___";
 
  117         const string trailer = 
"__trailer__";
 
  121         os << 
"ssh " << hostname << 
' ' 
  123            << 
"echo" << 
' ' << header << 
";" 
  124            << 
"ps hax -o '%p %a'"     << 
";" 
  125            << 
"echo" << 
' ' << trailer
 
  130         shell << os.str() << endl;
 
  136         while (
getline(shell, buffer) && buffer.find(header)  == string::npos) {}
 
  140         while (
getline(shell, buffer) && buffer.find(trailer) == string::npos) {
 
  147           if (is >> pid && 
getline(is >> ws, buffer)) {
 
  148             if (start_command.find(buffer) != string::npos) {
 
  149               os << 
"ssh " << hostname << 
' ' 
  151                  << 
"kill " << signal << 
" " << pid << 
" </dev/null >&/dev/null" 
  159         if (os.str() != 
"") {
 
  160           shell << os.str() << endl;
 
  270         this->is_alive  = 
true;
 
  277         this->is_alive  = 
false;
 
  290         istringstream is(buffer);
 
  298           this->event_name   = 
event.getName();
 
  299           this->event_number = 
event.getNumber();
 
  300           this->state_name   = state;
 
  419       in >> client.hostname;
 
  423         getline(in >> std::ws, client.start_command);
 
  445       out << client.hostname;
 
  447       out << client.start_command;
 
  479       if (pos != string::npos) {
 
JSocketNonblockingWriter out
writer for outgoing messages 
 
The JShell clas can be used to interact with the shell via I/O streams. 
 
int getEventnumber() const 
Get number of last event. 
 
bool isIgnore() const 
Check ignore mode. 
 
static const JTag DISPTAG_Died("Died")
 
Wrapper class around STL string class. 
 
bool update(const JNET::JTag &tag, const std::string &buffer)
Update client. 
 
friend std::istream & operator>>(std::istream &in, JClient &client)
Read client from input. 
 
const std::string & getStatename() const 
Get name of current state. 
 
bool getAlive() const 
Get alive status. 
 
ControlHost client manager. 
 
static std::string LOGGER
host name of message logger 
 
int getDied() const 
Get died count. 
 
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
 
static const std::string TOKEN_DELIMETER
 
void start()
Start process. 
 
void setMode(const JMode mode)
Set mode. 
 
int getBorn() const 
Get born count. 
 
JLANG::JString start_command
 
bool isActive() const 
Check active mode. 
 
friend std::ostream & operator<<(std::ostream &out, const JClient &client)
Write client to output. 
 
static const std::string RUN_CONTROL_CLIENT
 
void setAlive(const bool alive)
Set alive status. 
 
JSocketInputChannel_t in
reader for incoming messages 
 
static const JNET::JTag RC_REPLY
 
void stop(const int signal=-9)
Stop process. 
 
JMode getMode() const 
Get mode. 
 
JString & trim()
Trim string. 
 
static const std::string CLIENTNAME_DELIMETER
 
const std::string & getFullName() const 
Get full name of run control client. 
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line. 
 
bool isSleep() const 
Check sleep mode. 
 
Auxiliary class for handling event name and optional number. 
 
JShell & flush(std::ostream &out=null)
Extracts characters from this shell and flush them to the given output stream until the prompt is rea...
 
static const JTag DISPTAG_Born("Born")
 
bool isIllegal() const 
Check illegal mode. 
 
Auxiliary class to specify white space character(s) in currect locale. 
 
const std::string & getHostname() const 
Get host name of run control client. 
 
const std::string & getName() const 
Get name of run control client. 
 
static JShell & getInstance()
Get reference to unique instance of this class object. 
 
Shell interaction via I/O streams. 
 
JString & replace(const char target, const char replacement, const std::size_t max=std::numeric_limits< std::size_t >::max())
Replace characters. 
 
static std::string SERVER
host name of message server 
 
JClient(const std::string &__name, const std::string &__hostname, const std::string &__start_command="")
Constructor. 
 
const std::string & getEventname() const 
Get name of last event. 
 
std::string getFullName(const std::string &hostname, const std::string &name)
Get full name of run control client. 
 
void configure()
Configure client parameters. 
 
JClient()
Default constructor. 
 
const std::string & getStartCommand() const 
Get start command of run control client.