OpendTect  6.6
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 primary host, 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, PortNr_Type, int jobid)
 
mDeprecatedDef JobCommunic (const char *host, PortNr_Type, int jobid, StreamData &)
 
 ~JobCommunic ()
 
void disConnect ()
 
uiString errMsg ()
 
bool ok ()
 
bool pauseRequested () const
 
bool sendErrMsg (const char *msg)
 hostrelated error messages are more serious. More...
 
bool sendPID (int pid)
 
bool sendProgress (int p)
 
bool sendState (bool isexit=false)
 
void setState (State s)
 
void setStream (od_ostream &strm)
 
void setTimeBetweenMsgUpdates (int)
 
State state () const
 
bool updateProgress (int p)
 
bool updateState ()
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 

Protected Member Functions

void alarmHndl (CallBacker *)
 time-out More...
 
bool sendErrMsg_ (const char *msg)
 
bool sendPID_ (int)
 
bool sendProgress_ (int, bool immediate)
 
bool sendState_ (State, bool isexit, bool immediate)
 

Protected Attributes

uiString errmsg_
 
int jobid_
 
Network::Authority masterauth_
 
bool pausereq_
 
Network::Socketsocket_
 
State stat_
 
bool stillok_
 
od_ostreamstrm_ = nullptr
 

Private Member Functions

BufferString buildString (char tag, int, const char *msg=0)
 
void checkMasterTimeout ()
 
void checkPrimaryHostTimeout ()
 
void clearHiddenParams ()
 
od_ostreamcreateLogStream ()
 
void directMsg (const char *msg)
 directly to bp.stdout.ostrem or std::cerr. More...
 
void dumpSystemInfo ()
 
void logMsg (bool stat, const char *msg, const char *details)
 
Network::AuthorityprimaryAuthority ()
 
bool sendMsg (char tag, int, const char *msg=0)
 
void sendMsgCB (CallBacker *cb=nullptr)
 
void setErrMsg (const char *)
 
bool updateMsg (char tag, int, const char *msg=0)
 

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Detailed Description

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

<>

Member Enumeration Documentation

◆ State

Enumerator
Undef 
Working 
WrapUp 
Finished 
AllDone 
Paused 
JobError 
HostError 
Killed 
Timeout 

Constructor & Destructor Documentation

◆ JobCommunic() [1/2]

JobCommunic::JobCommunic ( const char *  host,
PortNr_Type  ,
int  jobid 
)

◆ JobCommunic() [2/2]

mDeprecatedDef JobCommunic::JobCommunic ( const char *  host,
PortNr_Type  ,
int  jobid,
StreamData  
)

◆ ~JobCommunic()

JobCommunic::~JobCommunic ( )

Member Function Documentation

◆ alarmHndl()

void JobCommunic::alarmHndl ( CallBacker )
protected

time-out

◆ buildString()

BufferString JobCommunic::buildString ( char  tag,
int  ,
const char *  msg = 0 
)
private

◆ checkMasterTimeout()

void JobCommunic::checkMasterTimeout ( )
private

◆ checkPrimaryHostTimeout()

void JobCommunic::checkPrimaryHostTimeout ( )
private

◆ clearHiddenParams()

void JobCommunic::clearHiddenParams ( )
private

◆ createLogStream()

od_ostream* JobCommunic::createLogStream ( )
private

◆ directMsg()

void JobCommunic::directMsg ( const char *  msg)
private

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

◆ disConnect()

void JobCommunic::disConnect ( )

◆ dumpSystemInfo()

void JobCommunic::dumpSystemInfo ( )
private

◆ errMsg()

uiString JobCommunic::errMsg ( )
inline

◆ logMsg()

void JobCommunic::logMsg ( bool  stat,
const char *  msg,
const char *  details 
)
private

◆ ok()

bool JobCommunic::ok ( )
inline

◆ pauseRequested()

bool JobCommunic::pauseRequested ( ) const
inline

◆ primaryAuthority()

Network::Authority& JobCommunic::primaryAuthority ( )
private

◆ sendErrMsg()

bool JobCommunic::sendErrMsg ( const char *  msg)
inline

hostrelated error messages are more serious.

◆ sendErrMsg_()

bool JobCommunic::sendErrMsg_ ( const char *  msg)
protected

◆ sendMsg()

bool JobCommunic::sendMsg ( char  tag,
int  ,
const char *  msg = 0 
)
private

◆ sendMsgCB()

void JobCommunic::sendMsgCB ( CallBacker cb = nullptr)
private

◆ sendPID()

bool JobCommunic::sendPID ( int  pid)
inline

◆ sendPID_()

bool JobCommunic::sendPID_ ( int  )
protected

◆ sendProgress()

bool JobCommunic::sendProgress ( int  p)
inline

◆ sendProgress_()

bool JobCommunic::sendProgress_ ( int  ,
bool  immediate 
)
protected

◆ sendState()

bool JobCommunic::sendState ( bool  isexit = false)
inline

◆ sendState_()

bool JobCommunic::sendState_ ( State  ,
bool  isexit,
bool  immediate 
)
protected

◆ setErrMsg()

void JobCommunic::setErrMsg ( const char *  )
private

◆ setState()

void JobCommunic::setState ( State  s)
inline

◆ setStream()

void JobCommunic::setStream ( od_ostream strm)
inline

◆ setTimeBetweenMsgUpdates()

void JobCommunic::setTimeBetweenMsgUpdates ( int  )

◆ state()

State JobCommunic::state ( ) const
inline

◆ updateMsg()

bool JobCommunic::updateMsg ( char  tag,
int  ,
const char *  msg = 0 
)
private

◆ updateProgress()

bool JobCommunic::updateProgress ( int  p)
inline

◆ updateState()

bool JobCommunic::updateState ( )
inline

Member Data Documentation

◆ errmsg_

uiString JobCommunic::errmsg_
protected

◆ failtimeout_

int JobCommunic::failtimeout_
private

◆ jobid_

int JobCommunic::jobid_
protected

◆ lastsucces_

int JobCommunic::lastsucces_
private

◆ lastupdate_

int JobCommunic::lastupdate_
private

◆ logstream_

od_ostream* JobCommunic::logstream_
private

◆ masterauth_

Network::Authority JobCommunic::masterauth_
protected

◆ maxtries_

int JobCommunic::maxtries_
private

◆ min_time_between_msgupdates_

int JobCommunic::min_time_between_msgupdates_
private

◆ min_time_between_update_

int JobCommunic::min_time_between_update_
private

◆ nrattempts_

int JobCommunic::nrattempts_
private

◆ pausereq_

bool JobCommunic::pausereq_
protected

◆ socket_

Network::Socket* JobCommunic::socket_
protected

◆ socktimeout_

int JobCommunic::socktimeout_
private

◆ stat_

State JobCommunic::stat_
protected

◆ stillok_

bool JobCommunic::stillok_
protected

◆ strm_

od_ostream* JobCommunic::strm_ = nullptr
protected

◆ timestamp_

int JobCommunic::timestamp_
private

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