Saturn
class description - source file - inheritance tree
private:
static void* tl_MIR_Router(Saturn::mir_router_ti* arg)
static void* tl_MIR_Shooter(Saturn* s)
static void* tl_SaturnAcceptor(Saturn::new_connection_ti* ss)
static void* tl_SaturnFdSucker(Saturn* s)
protected:
void Accept(TSocket* newsocket)
void AcceptWrapper(TSocket* newsocket)
void arrival_of_kings(TMessage* m)
void BroadcastBeamMIR(ZMIR& mir, list<SaturnInfo*,allocator<SaturnInfo*> >& moons)
void BroadcastMIR(ZMIR& mir, list<SaturnInfo*,allocator<SaturnInfo*> >& moons)
void create_kings(const char* king, const char* whore_king)
void Endark(ZGlass* glass)
void Enlight(ZGlass* glass, ID_t)
void ExecMIR(ZMIR& mir)
void finalize_eye_connection(EyeInfo* ei)
void finalize_moon_connection(SaturnInfo* si)
SaturnInfo* FindRouteTo(SaturnInfo* target)
void fix_fire_king_id(SaturnInfo* si)
void ForwardMIR(ZMIR& mir, SaturnInfo* route)
void generick_shoot_mir_result(const Text_t* exc, TBuffer* buf)
void handle_mir_result(UInt_t req_handle, ZMIR* mirp)
Int_t Manage(TSocket* sock)
void markup_posted_mir(ZMIR& mir, ZMirEmittingEntity* caller = 0)
ZMIR_Result_Report* query_mir_result(UInt_t req_handle)
void Reflect(ZGlass* glass)
UInt_t register_mir_result_request(GCondition* cond)
void RouteMIR(ZMIR& mir)
void shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, bool use_own_thread = false)
void shoot_mir_from_queue()
void socket_closed(TSocket* sock)
Int_t SockSuck()
int start_mir_shooter()
int start_server()
int stop_mir_shooter()
int stop_server()
void UnfoldMIR(ZMIR& mir)
void wipe_eye(EyeInfo* eye, bool notify_sunqueen_p)
void wipe_moon(SaturnInfo* moon, bool notify_sunqueen_p)
public:
Saturn()
Saturn(const Saturn&)
virtual ~Saturn()
void AllowMoons()
static TClass* Class()
SaturnInfo* Connect(SaturnInfo* si)
void Create(SaturnInfo* si)
ZGlass* DemangleID(ID_t id)
Int_t Freeze()
bool GetAllowMoons() const
Mountain* GetChaItOss() const
ZKing* GetFireKing() const
ZQueen* GetFireQueen() const
ZGod* GetGod() const
ZKing* GetKing() const
Int_t GetQueenLoadNum() const
SaturnInfo* GetSaturnInfo() const
bool GetSunAbsolute() const
SaturnInfo* GetSunInfo() const
ZKing* GetSunKing() const
ZSunQueen* GetSunQueen() const
Forest* GetVer() const
ZHistoManager* GetZHistoManager()
static TMessage* HandleClientSideMeeConnection(TSocket* socket, ZMirEmittingEntity* mee)
static string HandleClientSideSaturnHandshake(TSocket*& socket)
virtual TClass* IsA() const
Bool_t IsMoon(SaturnInfo* si)
void PostMIR(ZMIR& mir)
GMutex& RefIDLock()
GCondition& RefQueenLoadCnd()
void SetQueenLoadNum(Int_t queenloadnum)
void Shine(Ray& r)
void ShootMIR(auto_ptr<ZMIR>& mir, bool use_own_thread = false)
void ShootMIRResult(TBuffer& buf)
ZMIR_Result_Report* ShootMIRWaitResult(auto_ptr<ZMIR>& mir, bool use_own_thread = false)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
void Shutdown()
void SingleRay(EyeInfo* eye, Ray& r)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Int_t UnFreeze()
protected:
GMutex mIDLock X{r} ... must allow locking to eyez
GMutex mEyeLock sending to eyes
GMutex mMoonLock sending to moons
GMutex mMasterLock sending to master
GMutex mRulingLock Exec in kings & queens
bool bAllowMoons X{G}
GSelector mSelector fd select wrapper for sockets
ZGod* mGod X{G}
ZKing* mSunKing X{G}
ZSunQueen* mSunQueen X{G}
ZKing* mKing X{G}
ZKing* mFireKing X{G}
ZQueen* mFireQueen X{G}
SaturnInfo* mSunInfo X{G}
SaturnInfo* mSaturnInfo X{G}
bool bSunAbsolute X{G}
Int_t mQueenLoadNum X{GS}
GCondition mQueenLoadCnd X{r}
Forest* mVer X{G} Will hold URL->queen/glass maps
Mountain* mChaItOss X{G}
list<SaturnInfo*,allocator<SaturnInfo*> > mMoons
list<EyeInfo*,allocator<EyeInfo*> > mEyes
TServerSocket* mServerSocket
GThread* mServerThread
ZHistoManager* pZHistoManager
GMutex mBeamReqHandleMutex
UInt_t mLastBeamReqHandle
GThread* mMIRShootingThread
GCondition mMIRShootingCnd
list<ZMIR*> mMIRShootingQueue
public:
static const Int_t s_Gled_Protocol_Version
Saturn
Server and client. In fact Sun, Moon and Fire.
Shines, reflects and glows.
void* tl_SaturnFdSucker(Saturn *s)
The thread foo for doing select on all sockets (master, moons & eyes).
Could (in principle) have several threads.
void* tl_SaturnAcceptor(new_connection_ti* ncti)
The thread foo for accepting a new connection.
Accept threads are always created in a detached state.
void* tl_MIR_Router(mir_router_ti* arg)
Thread foo for routing of a single MIR.
If the thread is detached, this method also deletes the GThread.
void* tl_MIR_Shooter(Saturn* s)
Thread foo for independent routing of MIRs.
Mostly they come from the Saturn code and eventor threads.
Continuously calls Saturn->shoot_mir_from_queue().
Could have any number of such threads.
Saturn() :
mIDLock(GMutex::recursive),
mEyeLock(GMutex::recursive),
mMoonLock(GMutex::recursive),
mMasterLock(GMutex::recursive),
mRulingLock(GMutex::recursive),
mSelector(GMutex::recursive),
mSunInfo(0), mSaturnInfo(0),
mQueenLoadNum(0), mQueenLoadCnd(GMutex::recursive),
mBeamReqHandleMutex(GMutex::recursive), mLastBeamReqHandle(0),
mMIRShootingCnd()
~Saturn()
string HandleClientSideSaturnHandshake(TSocket*& socket)
TMessage* HandleClientSideMeeConnection(TSocket* socket, ZMirEmittingEntity* mee)
void Create(SaturnInfo* si)
SaturnInfo* Connect(SaturnInfo* si)
void AllowMoons()
On start-up the moons are not allowed to connect (only Eyes).
AllowMoons() allows moons connections from now on.
void Shutdown()
first should dump moons, eyez ...
void Enlight(ZGlass* glass, ID_t id) throw(string)
Inserts glass into hash with key id.
Sets Saturn related glass members and calls ZGlass::AdEnlightenment().
void Reflect(ZGlass* glass) throw(string)
Enlights glass with a key taken from glass->mSaturnID.
Used for ZComet unpacking on Moons (hence Reflect).
void Endark(ZGlass* glass) throw(string)
Int_t Freeze()
Int_t UnFreeze()
void Shine(Ray &r)
void SingleRay(EyeInfo* eye, Ray& ray)
Bool_t IsMoon(SaturnInfo* si)
ZHistoManager* GetZHistoManager()
Int_t SockSuck()
SaturnInfo* FindRouteTo(SaturnInfo* target)
Finds SaturnInfo that is on-route to target.
Checks target's masters and if self is found, sends to
the previous master.
Otherwise it must be sent up.
void AcceptWrapper(TSocket* newsocket)
Exception catching wrapper for Accept().
void Accept(TSocket* newsocket) throw(string)
Accepts connection from an Eye/Moon or handles FirstFreeID query.
Locks/Suspends all executions upon
adding fd to Selector and sending scene to the Moon.
Runs in a detached thread (called from tl_SaturnAcceptor) ...
perhaps should timeout.
Handles one connection at a time.
void finalize_moon_connection(SaturnInfo* si)
void finalize_eye_connection(EyeInfo* ei)
Int_t Manage(TSocket* sock) throw(string)
UInt_t register_mir_result_request(GCondition* cond)
ZMIR_Result_Report* query_mir_result(UInt_t req_handle)
void handle_mir_result(UInt_t req_handle, ZMIR* mirp)
void shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller,
bool use_own_thread)
The auto_ptr<ZMIR> is released and should not be used afterwards.
void markup_posted_mir(ZMIR& mir, ZMirEmittingEntity* caller)
Writes header and caller infromation.
If caller==0 the owner of current thread is used.
void shoot_mir_from_queue()
Routes one MIR from the ShootingQueue.
The MIR is deleted afterwards.
void PostMIR(ZMIR& mir)
Routes a MIR in the current thread.
Usually called from Operators to publish some result.
If mir is to be re-used, do: mir.RewindToMIR() prior to posting it again.
void ShootMIR(auto_ptr<ZMIR>& mir, bool use_own_thread)
Accepts a MIR and shoots it into the system.
The auto_ptr<ZMIR> is released and should not be used afterwards.
ZMIR_Result_Report* ShootMIRWaitResult(auto_ptr<ZMIR>& mir, bool use_own_thread)
Accepts a MIR, shoots it into the system and waits for ResultReport.
The auto_ptr<ZMIR> is released and should not be used afterwards.
void generick_shoot_mir_result(const Text_t* exc, TBuffer* buf)
void ShootMIRResult(TBuffer& b)
Makes a result MIR and sends it to the caller Saturn.
Should be called from a method called via a beamed MIR
containing a result request.
void RouteMIR(ZMIR& mir)
Decides what to do with a MIR ... and does it.
void UnfoldMIR(ZMIR& mir)
Prepares MIR for execution, does checks, proper broadcasting
and the execution itself.
Message type should be MT_Beam or MT_Flare.
void ExecMIR(ZMIR& mir) throw(string)
void ForwardMIR(ZMIR& mir, SaturnInfo* route)
Forwards a MIR to Saturn given by route.
void BroadcastMIR(ZMIR& mir, lpSaturnInfo_t& moons)
Broadcasts MIR to reflecting Moons specified in socks.
void BroadcastBeamMIR(ZMIR& mir, lpSaturnInfo_t& moons)
Broadcasts MIR to reflecting Moons specified in socks.
Specifically sets each SaturnInfo to be the recipient.
int start_server()
int stop_server()
int start_mir_shooter()
int stop_mir_shooter()
void socket_closed(TSocket* sock)
void wipe_moon(SaturnInfo* moon, bool notify_sunqueen_p)
Removes moon from list of moons and notifies the SunQueen if
notify_sunqueen_p is true.
Also removes the moon from all queens that are reflecting to it.
void wipe_eye(EyeInfo* eye, bool notify_sunqueen_p)
void fix_fire_king_id(SaturnInfo* si)
void create_kings(const char* king, const char* whore_king)
Local King
void arrival_of_kings(TMessage* m)
Inline Functions
ZGlass* DemangleID(ID_t id)
GMutex& RefIDLock()
bool GetAllowMoons() const
ZGod* GetGod() const
ZKing* GetSunKing() const
ZSunQueen* GetSunQueen() const
ZKing* GetKing() const
ZKing* GetFireKing() const
ZQueen* GetFireQueen() const
SaturnInfo* GetSunInfo() const
SaturnInfo* GetSaturnInfo() const
bool GetSunAbsolute() const
Int_t GetQueenLoadNum() const
void SetQueenLoadNum(Int_t queenloadnum)
GCondition& RefQueenLoadCnd()
Forest* GetVer() const
Mountain* GetChaItOss() const
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Saturn Saturn(const Saturn&)
Last update: Thu Nov 20 16:09:08 2003
ROOT page - Home page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.