OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
JobCommunic Class Reference

Multi-machine socket communicator Handles the communication between a client and the master, from the client's point of view. More...

Inheritance diagram for JobCommunic:
[legend]

Public Types

enum  State {
  Undef, Working, WrapUp, Finished,
  AllDone, Paused, JobError, HostError,
  Killed, Timeout
}
 

Public Member Functions

 JobCommunic (const char *host, int port, int jobid, StreamData &)
 
 ~JobCommunic ()
 
bool ok ()
 
uiString errMsg ()
 
State state () const
 
void setState (State s)
 
bool updateState ()
 
bool updateProgress (int p)
 
void setTimeBetweenMsgUpdates (int)
 
bool sendState (bool isexit=false)
 
bool sendProgress (int p)
 
bool sendErrMsg (const char *msg)
 hostrelated error messages are more serious. More...
 
bool sendPID (int pid)
 
bool pauseRequested () const
 
void disConnect ()
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Protected Member Functions

bool sendState_ (State, bool isexit, bool immediate)
 
bool sendProgress_ (int, bool immediate)
 
bool sendPID_ (int)
 
bool sendErrMsg_ (const char *msg)
 
void alarmHndl (CallBacker *)
 time-out More...
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

BufferString masterhost_
 
int masterport_
 
bool stillok_
 
State stat_
 
uiString errmsg_
 
int jobid_
 
bool pausereq_
 
StreamDatasdout_
 
Network::Socket * socket_
 

Private Member Functions

 mODTextTranslationClass (JobCommunic)
 
bool updateMsg (char tag, int, const char *msg=0)
 
bool sendMsg (char tag, int, const char *msg=0)
 
BufferString buildString (char tag, int, const char *msg=0)
 
void directMsg (const char *msg)
 directly to bp.stdout.ostrem or std::cerr. More...
 
void setErrMsg (const char *)
 
void checkMasterTimeout ()
 
void logMsg (bool stat, const char *msg, const char *details)
 
od_ostreamcreateLogStream ()
 
void dumpSystemInfo ()
 

Private Attributes

int timestamp_
 
int nrattempts_
 
int maxtries_
 
int socktimeout_
 
int failtimeout_
 
int min_time_between_update_
 
int lastsucces_
 
int min_time_between_msgupdates_
 
int lastupdate_
 
od_ostreamlogstream_
 

Detailed Description

Multi-machine socket communicator Handles the communication between a client and the master, from the client's point of view.

Member Enumeration Documentation

Enumerator
Undef 
Working 
WrapUp 
Finished 
AllDone 
Paused 
JobError 
HostError 
Killed 
Timeout 

Constructor & Destructor Documentation

JobCommunic::JobCommunic ( const char *  host,
int  port,
int  jobid,
StreamData  
)
JobCommunic::~JobCommunic ( )

Member Function Documentation

void JobCommunic::alarmHndl ( CallBacker )
protected

time-out

BufferString JobCommunic::buildString ( char  tag,
int  ,
const char *  msg = 0 
)
private
void JobCommunic::checkMasterTimeout ( )
private
od_ostream* JobCommunic::createLogStream ( )
private
void JobCommunic::directMsg ( const char *  msg)
private

directly to bp.stdout.ostrem or std::cerr.

void JobCommunic::disConnect ( )
void JobCommunic::dumpSystemInfo ( )
private
uiString JobCommunic::errMsg ( )
inline
void JobCommunic::logMsg ( bool  stat,
const char *  msg,
const char *  details 
)
private
JobCommunic::mODTextTranslationClass ( JobCommunic  )
private
bool JobCommunic::ok ( )
inline
bool JobCommunic::pauseRequested ( ) const
inline
bool JobCommunic::sendErrMsg ( const char *  msg)
inline

hostrelated error messages are more serious.

bool JobCommunic::sendErrMsg_ ( const char *  msg)
protected
bool JobCommunic::sendMsg ( char  tag,
int  ,
const char *  msg = 0 
)
private
bool JobCommunic::sendPID ( int  pid)
inline
bool JobCommunic::sendPID_ ( int  )
protected
bool JobCommunic::sendProgress ( int  p)
inline
bool JobCommunic::sendProgress_ ( int  ,
bool  immediate 
)
protected
bool JobCommunic::sendState ( bool  isexit = false)
inline
bool JobCommunic::sendState_ ( State  ,
bool  isexit,
bool  immediate 
)
protected
void JobCommunic::setErrMsg ( const char *  )
private
void JobCommunic::setState ( State  s)
inline
void JobCommunic::setTimeBetweenMsgUpdates ( int  )
State JobCommunic::state ( ) const
inline
bool JobCommunic::updateMsg ( char  tag,
int  ,
const char *  msg = 0 
)
private
bool JobCommunic::updateProgress ( int  p)
inline
bool JobCommunic::updateState ( )
inline

Member Data Documentation

uiString JobCommunic::errmsg_
protected
int JobCommunic::failtimeout_
private
int JobCommunic::jobid_
protected
int JobCommunic::lastsucces_
private
int JobCommunic::lastupdate_
private
od_ostream* JobCommunic::logstream_
private
BufferString JobCommunic::masterhost_
protected
int JobCommunic::masterport_
protected
int JobCommunic::maxtries_
private
int JobCommunic::min_time_between_msgupdates_
private
int JobCommunic::min_time_between_update_
private
int JobCommunic::nrattempts_
private
bool JobCommunic::pausereq_
protected
StreamData& JobCommunic::sdout_
protected
Network::Socket* JobCommunic::socket_
protected
int JobCommunic::socktimeout_
private
State JobCommunic::stat_
protected
bool JobCommunic::stillok_
protected
int JobCommunic::timestamp_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019