GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
TGo4ExampleServer Class Reference

#include <TGo4ExampleServer.h>

+ Inheritance diagram for TGo4ExampleServer:

Public Member Functions

 TGo4ExampleServer (const char *name, UInt_t negotiationport=0, Bool_t blockingmode=kFALSE)
 
virtual ~TGo4ExampleServer ()
 
TGo4ExampleControllerGetController ()
 
TGo4TaskHandlerCommandListCreateCommandList ()
 
virtual Int_t StartWorkThreads ()
 
virtual Int_t StopWorkThreads ()
 
- Public Member Functions inherited from TGo4ServerTask
 TGo4ServerTask (const char *name, UInt_t negotiationport=0, Bool_t blockingmode=kFALSE, Bool_t standalone=kFALSE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE, Bool_t ismaster=kTRUE)
 
virtual ~TGo4ServerTask ()
 
virtual void Quit ()
 
void Shutdown ()
 
TGo4TaskManagerGetTaskManager ()
 
TGo4TaskHandlerGetCurrentTaskHandler ()
 
TGo4TaskHandlerGetTaskHandler ()
 
TGo4TaskHandlerGetTaskHandler (const char *name)
 
TGo4BufferQueueGetCommandQueue (const char *task=0)
 
TGo4BufferQueueGetStatusQueue (const char *task=0)
 
TGo4BufferQueueGetDataQueue (const char *task=0)
 
virtual TGo4CommandNextCommand ()
 
virtual void SendStatus (TGo4Status *stat, const char *receiver=0)
 
virtual void SendStatusBuffer ()
 
virtual Bool_t StartConnectorThread ()
 
virtual Bool_t StopConnectorThread ()
 
Bool_t ConnectorThreadIsStopped ()
 
void SetCurrentTask (const char *name)
 
void SetConnect (TGo4Socket *trans, const char *host, UInt_t port, Bool_t keepserv=kFALSE)
 
void SetDisConnect (TGo4Socket *trans)
 
TGo4SocketGetConnectTransport ()
 
const char * GetConnectorName () const
 
const char * GetConnectHost () const
 
virtual Int_t TimerConnect ()
 
virtual Int_t RemoveAllClients (Bool_t force=false)
 
virtual Bool_t RemoveClient (const char *name, Bool_t clientwait=kTRUE, Bool_t isterminating=kFALSE)
 
Bool_t RemoveCurrentClient ()
 
Int_t WaitForOpen ()
 
Int_t WaitForClose ()
 
Int_t WaitForConnection ()
 
- Public Member Functions inherited from TGo4Task
 TGo4Task (const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
 
virtual ~TGo4Task ()
 
virtual void Start ()
 
virtual void Stop ()
 
virtual void KillMain ()
 
virtual void RestartMain ()
 
virtual void Terminate (Bool_t termapp=kTRUE)
 
virtual void TerminateFast ()
 
virtual void ExecuteString (const char *command)
 
Bool_t IsMaster ()
 
void SetOwner (TGo4TaskOwner *owner)
 
void AddUserCommand (TGo4Command *com)
 
void AddUserCommandList (TGo4CommandProtoList *comlist)
 
TGo4StatusNextStatus (Bool_t wait=kTRUE)
 
TObject * NextObject (Bool_t wait=kTRUE)
 
void SendObject (TObject *obj, const char *receiver=0)
 
TMutex * GetStatusBufferMutex ()
 
void SendStatusMessage (Int_t level, Bool_t printout, const char *text,...)
 
void UpdateStatusBuffer ()
 
virtual Int_t Initialization ()
 
virtual TGo4TaskStatusCreateStatus ()
 
Bool_t SubmitCommand (const char *name)
 
Bool_t SubmitEmergencyCommand (Go4EmergencyCommand_t val)
 
Bool_t SubmitEmergencyData (Go4EmergencyCommand_t val, const char *receiver=0)
 
Bool_t SubmitLocalCommand (TGo4Command *com)
 
Bool_t SubmitCommand (TGo4Command *com)
 
TGo4CommandMakeCommand (const char *name)
 
void WakeCommandQueue (Int_t id=0)
 
Bool_t IsWorkStopped ()
 
virtual void GetStatus ()
 
const char * GetCommanderName () const
 
TGo4MasterGetMaster ()
 
TGo4SlaveGetSlave ()
 
void SendStopBuffers (const char *taskname=0)
 
TBuffer * GetAbortBuffer ()
 
- Public Member Functions inherited from TGo4ThreadManager
 TGo4ThreadManager (const TGo4ThreadManager &right)
 
 TGo4ThreadManager (const char *name, Bool_t blockingmode=kTRUE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE)
 
virtual ~TGo4ThreadManager ()
 
void SetTimer (TGo4AppControlTimer *ctrltimer)
 
TGo4ThreadHandlerGetWorkHandler () const
 
Bool_t BlockApp ()
 
Bool_t UnBlockApp (Int_t mode=0)
 
Bool_t IsInitDone () const
 
Bool_t IsTerminating () const
 
Bool_t IsTerminateApp () const
 
Bool_t IsAppBlocking () const
 
Bool_t IsBeingQuit () const
 
void SetBeingQuit (Bool_t on)
 
void Launch ()
 
- Public Member Functions inherited from TGo4CommandReceiver
virtual ~TGo4CommandReceiver ()
 
 TGo4CommandReceiver ()
 

Static Public Attributes

static const char * fgcCONTROLTHREAD ="CONTROL-"
 
static const char * fgcLOGGINGTHREAD ="LOGGER-"
 
- Static Public Attributes inherited from TGo4ThreadManager
static const Long_t fglTIMERPERIOD = 200
 

Private Member Functions

 TGo4ExampleServer ()
 

Private Attributes

TGo4ExampleControllerfxController
 
TString fcControlName
 
TString fcLoggingName
 

Additional Inherited Members

- Public Types inherited from TGo4ServerTask
enum  ELaunchmodes { kSecureShell = BIT(0), kGuiEmbed = BIT(1) }
 
- Public Types inherited from TGo4ThreadManager
enum  { fguTEXTLENGTH = 256 }
 
- Static Public Member Functions inherited from TGo4ServerTask
static const char * Get_fgcLAUNCHPREFSFILE ()
 
- Static Public Member Functions inherited from TGo4Task
static Int_t Get_fgiTERMID ()
 
- Protected Member Functions inherited from TGo4Task
TGo4TaskHandlerCommandListGetPrototype ()
 
virtual void UpdateStatus (TGo4TaskStatus *state)
 
TGo4ObjectQueueGetLocalCommandQueue ()
 
void SetMaster (Bool_t on=kTRUE)
 
void SetWorkIsStopped (Bool_t on)
 
- Protected Attributes inherited from TGo4Task
TMutex * fxStatusMutex
 
TBuffer * fxStatusBuffer
 
- Protected Attributes inherited from TGo4ThreadManager
Bool_t fbInitDone
 
Bool_t fbTerminating
 
Bool_t fbTerminateApplication
 
Bool_t fbAppBlocking
 
Bool_t fbAutoCreate
 
Bool_t fbAutoStart
 
Int_t fbBeingQuit
 
TGo4AppControlTimerfxBlocker
 
TGo4ThreadHandlerfxWorkHandler
 
- Static Protected Attributes inherited from TGo4ServerTask
static const Int_t fgiOPENWAITCYCLES =100
 
static const UInt_t fguOPENWAITCYCLETIME =100
 
static const Int_t fgiCLOSEWAITCYCLES =100
 
static const UInt_t fguCLOSEWAITCYCLETIME =100
 
static const Int_t fgiCONNECTWAITCYCLES =20
 
static const UInt_t fguCONNECTWAITCYCLETIME =200
 
static const UInt_t fguCONNECTTIMERPERIOD =100
 
static const char * fgcLAUNCHPREFSFILE = "etc/Go4LaunchPrefs.txt"
 

Detailed Description

example class for a server task that fits to the example application

Definition at line 25 of file TGo4ExampleServer.h.

Constructor & Destructor Documentation

TGo4ExampleServer::TGo4ExampleServer ( const char *  name,
UInt_t  negotiationport = 0,
Bool_t  blockingmode = kFALSE 
)
TGo4ExampleServer::~TGo4ExampleServer ( )
virtual
TGo4ExampleServer::TGo4ExampleServer ( )
private

Member Function Documentation

TGo4TaskHandlerCommandList * TGo4ExampleServer::CreateCommandList ( )
virtual

factory method for command list; overridden by implementation

Reimplemented from TGo4Task.

Definition at line 68 of file TGo4ExampleServer.cxx.

TGo4ExampleController * TGo4ExampleServer::GetController ( )
Int_t TGo4ExampleServer::StartWorkThreads ( )
virtual

start the working threads of the task implementation; this method is used after the current connection has changed, to continue reading/writing the queues. To be overridden by the derived task.

Reimplemented from TGo4Task.

Definition at line 107 of file TGo4ExampleServer.cxx.

References TGo4Log::Debug(), fcControlName, fcLoggingName, TGo4ThreadManager::GetWorkHandler(), TGo4ThreadHandler::Start(), and TGo4Task::StartWorkThreads().

Int_t TGo4ExampleServer::StopWorkThreads ( )
virtual

stop the working threads of the task implementation; this method is used before the current connection is changed to prevent reading/writing and waiting for the wrong queues. To be overridden by the derived task.

Reimplemented from TGo4Task.

Definition at line 73 of file TGo4ExampleServer.cxx.

References TGo4BufferQueue::AddBufferFromObject(), TGo4Log::Debug(), fcControlName, fcLoggingName, TGo4ServerTask::GetDataQueue(), TGo4ServerTask::GetStatusQueue(), TGo4ThreadManager::GetWorkHandler(), TGo4ThreadHandler::Stop(), and TGo4Task::StopWorkThreads().

Member Data Documentation

TString TGo4ExampleServer::fcControlName
private

remember name of controller thread

Definition at line 59 of file TGo4ExampleServer.h.

Referenced by StartWorkThreads(), StopWorkThreads(), and TGo4ExampleServer().

TString TGo4ExampleServer::fcLoggingName
private

remember name of logging thread

Definition at line 62 of file TGo4ExampleServer.h.

Referenced by StartWorkThreads(), StopWorkThreads(), and TGo4ExampleServer().

const char * TGo4ExampleServer::fgcCONTROLTHREAD ="CONTROL-"
static

suffix for controller thread name

Definition at line 44 of file TGo4ExampleServer.h.

Referenced by TGo4ExampleServer().

const char * TGo4ExampleServer::fgcLOGGINGTHREAD ="LOGGER-"
static

suffix for logging thread name

Definition at line 47 of file TGo4ExampleServer.h.

Referenced by TGo4ExampleServer().

TGo4ExampleController* TGo4ExampleServer::fxController
private

1 0..1

Definition at line 56 of file TGo4ExampleServer.h.

Referenced by GetController(), TGo4ExampleServer(), and ~TGo4ExampleServer().


The documentation for this class was generated from the following files: