OpendTect  7.0
Classes | 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]

Classes

struct  sendData
 

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 *)
 hostrelated error messages are more serious. More...
 
bool sendPID (PID_Type)
 
bool sendProgress (int)
 
bool sendState (bool isexit=false)
 
void setState (State s)
 
void setStream (od_ostream &strm)
 
void setTimeBetweenMsgUpdates (int)
 
State state () const
 
bool updateProgress (int)
 
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
 
virtual CallBackertrueCaller ()
 

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

BufferString buildString (char tag, int, const char *msg=nullptr)
 
void checkPrimaryHostTimeout ()
 
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=nullptr)
 
void sendMsgCB (CallBacker *cb=nullptr)
 
void setErrMsg (const char *)
 
bool updateMsg (char tag, int, const char *msg=nullptr)
 

Private Attributes

int failtimeout_
 
int lastsucces_
 
int lastupdate_
 
Threads::Lock lock_
 
od_ostreamlogstream_
 
int maxtries_
 
int min_time_between_msgupdates_
 
int min_time_between_update_
 
int nrattempts_ = 0
 
Threads::Lock sendmsglock_
 
bool sendret_ = false
 
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 = nullptr 
)
private

◆ checkPrimaryHostTimeout()

void JobCommunic::checkPrimaryHostTimeout ( )
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 *  )

hostrelated error messages are more serious.

◆ sendErrMsg_()

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

◆ sendMsg()

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

◆ sendMsgCB()

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

◆ sendPID()

bool JobCommunic::sendPID ( PID_Type  )

◆ sendPID_()

bool JobCommunic::sendPID_ ( PID_Type  )
protected

◆ sendProgress()

bool JobCommunic::sendProgress ( int  )

◆ sendProgress_()

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

◆ sendState()

bool JobCommunic::sendState ( bool  isexit = false)

◆ 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 = nullptr 
)
private

◆ updateProgress()

bool JobCommunic::updateProgress ( int  )

◆ updateState()

bool JobCommunic::updateState ( )

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

◆ lock_

Threads::Lock JobCommunic::lock_
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_ = 0
private

◆ pausereq_

bool JobCommunic::pausereq_ = false
protected

◆ sendmsglock_

Threads::Lock JobCommunic::sendmsglock_
private

◆ sendret_

bool JobCommunic::sendret_ = false
private

◆ socket_

Network::Socket* JobCommunic::socket_
protected

◆ socktimeout_

int JobCommunic::socktimeout_
private

◆ stat_

State JobCommunic::stat_
protected

◆ stillok_

bool JobCommunic::stillok_ = true
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-2024