ROOT logo
Gled » GLEDCORE » Saturn

class Saturn: public TObject, public An_ID_Demangler

 Definitely need Queen loading implemented in Saturn
 GCondition mQueenLoadingCond
 lID_t mAwaited Queens (or hash ... or both ... or sth) (need list<GCondition*>)
 void LoadQueen(ZQueen*) or LoadQueen(ID_t) { checks deps ... }
 void SuspendUntilQueenReady(ZQueen*)
 void SuspendUntilNoQueensPending()

 where do requests come from?
 This is ... again ... the tricky part.
 Now been mis-using the fire-king

Function Members (Methods)

public:
Saturn()
Saturn(const Saturn&)
virtual~Saturn()
voidTObject::AbstractMethod(const char* method) const
Bool_tAcceptsRays() const
voidAllowMoons()
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
SaturnInfo*Connect(SaturnInfo* si)
virtual voidTObject::Copy(TObject& object) const
voidCopyMoons(lpSaturnInfo_t& list)
voidCreate(SaturnInfo* si)
voidDelayedShootMIR(auto_ptr<ZMIR>& mir, GTime at_time)
virtual voidTObject::Delete(Option_t* option = "")MENU
voidDeliverTextMessage(EyeInfo* eye, TextMessage& tm)
virtual ZGlass*DemangleID(ID_t id)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tFreeze()
Bool_tGetAllowMoons()
Mountain*GetChaItOss()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
ZFireKing*GetFireKing()
ZFireQueen*GetFireQueen()
ZGod*GetGod()
virtual const char*TObject::GetIconName() const
ZKing*GetKing()
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetQueenLoadNum()
SaturnInfo*GetSaturnInfo()
boolGetSunAbsolute()
SaturnInfo*GetSunInfo()
ZKing*GetSunKing()
ZSunQueen*GetSunQueen()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Forest*GetVer()
ZHistoManager*GetZHistoManager()
static TMessage*HandleClientSideMeeConnection(TSocket* socket, ZMirEmittingEntity* mee)
static TStringHandleClientSideSaturnHandshake(TSocket*& socket)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsMoon(SaturnInfo* si)
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
voidLockMIRShooters(bool wait_until_queue_empty = false)
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
Saturn&operator=(const Saturn&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
voidPostMIR(auto_ptr<ZMIR>& mir)
voidPostMIR(ZMIR* mir)
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
GMutex&RefIDLock()
GCondition&RefQueenLoadCnd()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetQueenLoadNum(Int_t queenloadnum)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidShine(auto_ptr<Ray>& ray)
voidShootMIR(auto_ptr<ZMIR>& mir, bool use_own_thread = false)
voidShootMIR(ZMIR* mir, bool use_own_thread = false)
voidShootMIRResult(TBuffer& buf)
ZMIR_RR*ShootMIRWaitResult(auto_ptr<ZMIR>& mir, bool use_own_thread = false)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidShutdown()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Int_tUnFreeze()
voidUnlockMIRShooters()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
voidAccept(TSocket* newsocket)
voidAcceptWrapper(TSocket* newsocket)
voidarrival_of_kings(TMessage* m)
voidBroadcastBeamMIR(ZMIR& mir, lpSaturnInfo_t& moons)
voidBroadcastMIR(ZMIR& mir, lpSaturnInfo_t& moons)
voidcreate_kings(const char* king, const char* whore_king)
voiddelayed_mir_shooter()
voiddelayed_shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, GTime at_time)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidEndark(ZGlass* glass)
voidEnlight(ZGlass* glass, ID_t)
voidExecDetachedMIR(auto_ptr<ZMIR>& mir)
voidExecMIR(ZMIR* mir, bool lockp = true)
voidExecMIR(auto_ptr<ZMIR>& mir, bool lockp = true)
voidfinalize_eye_connection(EyeInfo* ei)
voidfinalize_moon_connection(SaturnInfo* si)
SaturnInfo*FindRouteTo(SaturnInfo* target)
voidfix_fire_king_id(SaturnInfo* si)
voidForwardMIR(ZMIR& mir, SaturnInfo* route)
voidFreeze(ZGlass* glass)
voidgenerick_shoot_mir_result(ZMIR& mir, const Text_t* exc, TBuffer* buf)
voidhandle_mir_result(UInt_t req_handle, ZMIR* mirp)
voidTObject::MakeZombie()
Int_tManage(TSocket* sock)
voidmarkup_posted_mir(ZMIR& mir, ZMirEmittingEntity* caller = 0)
voidmir_shooter()
voidpost_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller = 0)
ZMIR_RR*query_mir_result(UInt_t req_handle)
voidray_emitter()
voidReflect(ZGlass* glass)
UInt_tregister_mir_result_request(GCondition* cond)
voidreport_mir_post_demangling_error(ZMIR& mir, TString error)
voidreport_mir_pre_demangling_error(ZMIR& mir, TString error)
voidRouteMIR(auto_ptr<ZMIR>& mir)
voidshoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, bool use_own_thread = false)
voidsocket_closed(TSocket* sock)
Int_tSockSuck()
intstart_server()
intstart_shooters()
intstop_detached_threads()
intstop_server()
intstop_shooters()
voidUnfoldMIR(auto_ptr<ZMIR>& mir)
voidwipe_eye(EyeInfo* eye, bool notify_sunqueen_p)
voidwipe_moon(SaturnInfo* moon, bool notify_sunqueen_p)
private:
static void*tl_Delayed_MIR_Shooter(Saturn* s)
static voidtl_MIR_DetachedCleanUp(Saturn* sat)
static void*tl_MIR_DetachedExecutor(Saturn* sat)
static void*tl_MIR_Router(Saturn* sat)
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)

Data Members

public:
static const Int_ts_Gled_Protocol_Version
protected:
Bool_tbAcceptsRays
Bool_tbAllowMoonsX{g}
boolbSunAbsoluteX{g}
GMutexmBeamReqHandleMutex
Mountain*mChaItOssX{g}
GConditionmDelayedMIRShootingCnd
multimap<GTime,ZMIR*>mDelayedMIRShootingQueue
GThread*mDelayedMIRShootingThread
GMutexmEyeLocksending to eyes
list<EyeInfo*>mEyes
ZFireKing*mFireKingX{g}
ZFireQueen*mFireQueenX{g}
ZGod*mGodX{g}
GMutexmIDLockX{r} ... must allow locking to eyez
ZKing*mKingX{g}
UInt_tmLastBeamReqHandle
GMutexmMIRShooterRoutingLock
GConditionmMIRShootingCnd
list<ZMIR*>mMIRShootingQueue
GThread*mMIRShootingThread
GMutexmMasterLocksending to master
GMutexmMoonLocksending to moons
lpSaturnInfo_tmMoons
GConditionmQueenLoadCndX{r}
Int_tmQueenLoadNumX{gS}
GConditionmRayEmittingCnd
list<Ray*>mRayEmittingQueue
GThread*mRayEmittingThread
GMutexmRulingLockExec in kings & queens
SaturnInfo*mSaturnInfoX{g}
GSelectormSelectorfd select wrapper for sockets
TServerSocket*mServerSocket
GThread*mServerThread
GThread*mShutdownThread
SaturnInfo*mSunInfoX{g}
ZKing*mSunKingX{g}
ZSunQueen*mSunQueenX{g}
Forest*mVerX{g} Will hold URL->queen/glass maps
ZHistoManager*pZHistoManager

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

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(Saturn::new_connection_ti* ss)
 Thread foo for acception of a new connection.
 Accept threads are always created in a detached state.
void* tl_MIR_Router(Saturn* sat)
 Thread foo for routing of a single MIR.
void* tl_MIR_DetachedExecutor(Saturn* sat)
 Thread foo for execution of a single *detached* MIR.
 MIR is set in the GThread structure.
void tl_MIR_DetachedCleanUp(Saturn* sat)
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()
 GOD
~Saturn()
TString HandleClientSideSaturnHandshake(TSocket*& socket)
 Handles handshake with a Saturn on a newly opened socket.
 Returns greeting TString.
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.

 The calling thread is given the identity of the argument SaturnInfo,
 which is also assigned to mSunInfo and mSaturnInfo members.
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 = false)
void UnlockMIRShooters()
void Enlight(ZGlass* glass, ID_t )
 Inserts glass into hash with key id.
 Sets Saturn related glass members and calls ZGlass::AdEnlightenment().
void Reflect(ZGlass* glass)
 Enlights glass with a key taken from glass->mSaturnID.
 Used for ZComet unpacking on Moons (hence Reflect).
void Freeze(ZGlass* glass)
 Stops all detached MIR threads for lens.
void Endark(ZGlass* glass)
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)
 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)
UInt_t register_mir_result_request(GCondition* cond)
ZMIR_RR* 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 = 0)
 Writes header and caller infromation.
 If caller==0 the owner of current thread is used.
void post_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller = 0)
void shoot_mir(auto_ptr<ZMIR>& mir, ZMirEmittingEntity* caller, bool use_own_thread = false)
 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 the variant with auto_ptr argument.
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 the variant with auto_ptr argument.
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_RR* ShootMIRWaitResult(auto_ptr<ZMIR>& mir, bool use_own_thread = false)
 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& buf)
 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, TString error)
void report_mir_post_demangling_error(ZMIR& mir, TString error)
void RouteMIR(auto_ptr<ZMIR>& mir)
 Decides what to do with a MIR ... and does it.
void UnfoldMIR(auto_ptr<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, bool lockp)
void ExecMIR(auto_ptr<ZMIR>& mir, bool lockp)
 Wrapper with auto_ptr argument.

 This is the preferred entry point but the variant taking plain
 ZMIR* is also needed for execution of MIRs in detached threads
 that can be potentially cancelled.
void ExecDetachedMIR(auto_ptr<ZMIR>& mir)
 This function spawns a thread that calls ExecMIR().
 mir is released and deleted at thread completition.
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()
int stop_detached_threads()
 Stop all detached threads.
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)
ZGlass* DemangleID(ID_t id)
Saturn()
Bool_t AcceptsRays() const
{ return bAcceptsRays; }