#include "Saturn.h"

Saturn


class description - source file - inheritance tree (.pdf)

class Saturn : public TObject, public An_ID_Demangler

Inheritance Chart:
TObject
An_ID_Demangler
<-
Saturn
    private:
static void* tl_Delayed_MIR_Shooter(Saturn* s) static void tl_MIR_DetachedCleanUp(Saturn::mir_router_ti* arg) static void* tl_MIR_DetachedExecutor(Saturn::mir_router_ti* arg) static void* tl_MIR_Router(Saturn::mir_router_ti* arg) static void* tl_MIR_Shooter(Saturn* s) static void* tl_Ray_Emitter(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, lpSaturnInfo_t& moons) void BroadcastMIR(ZMIR& mir, lpSaturnInfo_t& moons) void create_kings(const char* king, const char* whore_king) void delayed_mir_shooter() void delayed_shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, GTime at_time) void Endark(ZGlass* glass) void Enlight(ZGlass* glass, ID_t) void ExecDetachedMIR(auto_ptr<ZMIR>& mir) void ExecMIR(auto_ptr<ZMIR>& mir, bool lockp = true) 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 Freeze(ZGlass* glass) void generick_shoot_mir_result(ZMIR& mir, 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) void mir_shooter() void post_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller = 0) ZMIR_Result_Report* query_mir_result(UInt_t req_handle) void ray_emitter() void Reflect(ZGlass* glass) UInt_t register_mir_result_request(GCondition* cond) void report_mir_post_demangling_error(ZMIR& mir, string error) void report_mir_pre_demangling_error(ZMIR& mir, string error) void RouteMIR(auto_ptr<ZMIR>& mir) void shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, bool use_own_thread = false) void socket_closed(TSocket* sock) Int_t SockSuck() int start_server() int start_shooters() int stop_server() int stop_shooters() void UnfoldMIR(auto_ptr<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() Bool_t AcceptsRays() const void AllowMoons() static TClass* Class() SaturnInfo* Connect(SaturnInfo* si) void CopyMoons(lpSaturnInfo_t& list) void Create(SaturnInfo* si) void DelayedShootMIR(auto_ptr<ZMIR>& mir, GTime at_time) void DeliverTextMessage(EyeInfo* eye, TextMessage& tm) virtual ZGlass* DemangleID(ID_t id) Int_t Freeze() bool GetAllowMoons() Mountain* GetChaItOss() ZFireKing* GetFireKing() ZFireQueen* GetFireQueen() ZGod* GetGod() ZKing* GetKing() Int_t GetQueenLoadNum() SaturnInfo* GetSaturnInfo() bool GetSunAbsolute() SaturnInfo* GetSunInfo() ZKing* GetSunKing() ZSunQueen* GetSunQueen() Forest* GetVer() ZHistoManager* GetZHistoManager() static TMessage* HandleClientSideMeeConnection(TSocket* socket, ZMirEmittingEntity* mee) static string HandleClientSideSaturnHandshake(TSocket*& socket) virtual TClass* IsA() const Bool_t IsMoon(SaturnInfo* si) void LockMIRShooters(bool wait_until_queue_empty = false) Saturn& operator=(const Saturn&) void PostMIR(auto_ptr<ZMIR>& mir) void PostMIR(ZMIR* mir) GMutex& RefIDLock() GCondition& RefQueenLoadCnd() void SetQueenLoadNum(Int_t queenloadnum) void Shine(auto_ptr<Ray>& ray) void ShootMIR(auto_ptr<ZMIR>& mir, bool use_own_thread = false) void ShootMIR(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() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) Int_t UnFreeze() void UnlockMIRShooters()

Data Members


    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} ZFireKing* mFireKing X{g} ZFireQueen* 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} lpSaturnInfo_t mMoons list<EyeInfo*,allocator<EyeInfo*> > mEyes TServerSocket* mServerSocket GThread* mServerThread ZHistoManager* pZHistoManager GMutex mBeamReqHandleMutex UInt_t mLastBeamReqHandle GThread* mMIRShootingThread GCondition mMIRShootingCnd GMutex mMIRShooterRoutingLock list<ZMIR*> mMIRShootingQueue GThread* mDelayedMIRShootingThread GCondition mDelayedMIRShootingCnd multimap<GTime,ZMIR*,less<GTime>,allocator<pair<const GTime,ZMIR*> > > mDelayedMIRShootingQueue Bool_t bAcceptsRays GThread* mRayEmittingThread GCondition mRayEmittingCnd list<Ray*> mRayEmittingQueue public:
static const Int_t s_Gled_Protocol_Version

Class Description

 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_DetachedExecutor(mir_router_ti* arg)
 Thread foo for execution of a single *detached* MIR.

void tl_MIR_DetachedCleanUp(mir_router_ti* arg)

void* tl_MIR_Shooter(Saturn* s)
 Thread foo executing Saturn::mir_shooter().

void* tl_Delayed_MIR_Shooter(Saturn* s)
 Thread foo executing Saturn::dealyed_mir_shooter().

void* tl_Ray_Emitter(Saturn* s)
 Thread foo executing Saturn::ray_emitter().

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(GMutex::recursive), mDelayedMIRShootingCnd(GMutex::recursive), bAcceptsRays(false), mRayEmittingCnd()

~Saturn()

string HandleClientSideSaturnHandshake(TSocket*& socket)
 Handles handshake with a Saturn on a newly opened socket.
 Returns greeting string.

TMessage* HandleClientSideMeeConnection(TSocket* socket, ZMirEmittingEntity* mee)
 Sends request for instantiation of mee via socket.
 If authentication is required it is handled via
 ZSunQueen::HandleClientSideAuthentication(). The required identity
 is deduced from the TString ZMirEmittingEntity::mLogin.

void Create(SaturnInfo* si)
 Spawns SunAbsolute and starts internal Saturn threads.

SaturnInfo* Connect(SaturnInfo* si)
 Connects to a higher Saturn, as specified by si->MasterName and
 si->MasterPort. Does the following:
 1) handles handshake & protocol info exchange
 2) queries first free id to establish beginning of local sun-space
 3) authenticates to sun.absolute and receives higher kings, sun.queen
    and the authorized SaturnInfo structure
 4) starts MirShooting thread and server thread
 5) issues requests for mirroring of mandatory queens
 The calling thread is given the identity of the return SaturnInfo, which
 is also assigned to mSaturnInfo member.

void AllowMoons()
 On start-up the moons are not allowed to connect (only Eyes).
 AllowMoons() allows moons connections from now on.

void Shutdown()
 Performs shutdown of connected objects and threads.

void LockMIRShooters(bool wait_until_queue_empty)

void UnlockMIRShooters()

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 Freeze(ZGlass* glass) throw(string)
 Stops all detached MIR threads for glass.

void Endark(ZGlass* glass) throw(string)

Int_t Freeze()

Int_t UnFreeze()

Bool_t IsMoon(SaturnInfo* si)

void CopyMoons(lpSaturnInfo_t& list)

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 markup_posted_mir(ZMIR& mir, ZMirEmittingEntity* caller)
 Writes header and caller infromation.
 If caller==0 the owner of current thread is used.

void post_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller)

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 delayed_shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, GTime at_time)
 The auto_ptr<ZMIR> is released and should not be used afterwards.

void mir_shooter()
 Routes MIRs from the ShootingQueue.
 Every MIR is deleted after routing.

void delayed_mir_shooter()
 Routes MIRs from the ShootingQueue.
 Every MIR is deleted after routing.

void PostMIR(auto_ptr<ZMIR>& mir)
 Routes MIR 'mir' in the current thread.
 Usually called from Operators to publish some result.
 'mir' will NOT be harmed; if it is to be re-used, do:
  mir.RewindToMIR() prior to posting it again.

void PostMIR(ZMIR* mir)
 Routes a MIR in the current thread.
 Wrapper for auto_ptr function.

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.

void ShootMIR(ZMIR* mir, bool use_own_thread)
 Accepts a MIR and shoots it into the system.
 Wrapper for auto_ptr function.

void DelayedShootMIR(auto_ptr<ZMIR>& mir, GTime at_time)
 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(ZMIR& mir, 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 MIR (flare OR beam)
 containing a result request.

void report_mir_pre_demangling_error(ZMIR& mir, string error)

void report_mir_post_demangling_error(ZMIR& mir, string error)

void RouteMIR(auto_ptr<ZMIR>& mir) throw()
 Decides what to do with a MIR ... and does it.

void UnfoldMIR(auto_ptr<ZMIR>& mir) throw()
 Prepares MIR for execution, does checks, proper broadcasting
 and the execution itself.
 Message type should be MT_Beam or MT_Flare.

void ExecMIR(auto_ptr<ZMIR>& mir, bool lockp)

void ExecDetachedMIR(auto_ptr<ZMIR>& mir)
 This function spawns a thread that calls ExecMIR().

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.

void ray_emitter()
 Emits Rays from the EmittingQueue.
 Every MIR is deleted after routing.

void Shine(auto_ptr<Ray>& ray)

void DeliverTextMessage(EyeInfo* eye, TextMessage& tm)

int start_server()

int stop_server()

int start_shooters()

int stop_shooters()

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)
             Bool_t AcceptsRays() const
            GMutex& RefIDLock()
               bool GetAllowMoons()
              ZGod* GetGod()
             ZKing* GetSunKing()
         ZSunQueen* GetSunQueen()
             ZKing* GetKing()
         ZFireKing* GetFireKing()
        ZFireQueen* GetFireQueen()
        SaturnInfo* GetSunInfo()
        SaturnInfo* GetSaturnInfo()
               bool GetSunAbsolute()
              Int_t GetQueenLoadNum()
               void SetQueenLoadNum(Int_t queenloadnum)
        GCondition& RefQueenLoadCnd()
            Forest* GetVer()
          Mountain* GetChaItOss()
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
             Saturn Saturn(const Saturn&)
            Saturn& operator=(const Saturn&)


Last update: Thu Jun 9 15:56:45 2005


ROOT page - Home page - Class index - Class Hierarchy - 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.