v2.10-0 (21000JUN2005)

Go4Fit
Class TGo4FitSlot


class TGo4FitSlot
derived from TGo4FitNamed

Object for managing pointers on specific objects.
General purpose of this object - store pointer on any kind of object (derived from TObject) with/without ownership and provide a general interface to set/get and store/restore this object. Slot always belong to another object (has owner). Slot always knows, what kind of object should be assigned to it (via Class property).
Slots may be distributed in different places of fitter: in data object (typically for assigning data like TH1, TGraph or other), sometimes in model object (like in TGo4FitModelFromData in slot TGo4FitData object should be placed to provide bins for model component) or complex hierarchy of these objects possible. Fitter has a method to collect a list of all slots from all possible places. Once all slots are collected, fitter know, how many and what kind of objects should be (or can be) assigned to fitter before start fitting. Fitter (see TGo4FitterAbstract description) has a set of function for manipulating with objects in slots.


Field Summary
 protected Bool_tfbNeeded
          Flag, is this object should always be set.
 protected Bool_tfbOwned
          Ownership flag of object.
 protected Int_tfiSaveFlag
          Describe saving of object in slot.
 protected Int_tfiSaveOwnership
           
 protected Int_tfiSaveSlot
           
 protected TClass*fxClass
          Class of object, which should be assigned to slot.
 protected TObject*fxObject
          Pointer on assigned object.

Fields inherited from class TNamed
fName, fTitle

Constructor Summary
TGo4FitSlot()
          Default constructor.
TGo4FitSlot(TNamed* iOwner, TClass* iClass)
          Creates TGo4FitSlot object.
TGo4FitSlot(const char * iName, const char * iTitle, TNamed* iOwner, TClass* iClass, Bool_t iNeeded, TObject* iObject, Bool_t iOwned)
          Creates TGo4FitSlot object.

Destructor Summary
 virtual synchronized ~TGo4FitSlot()
          Destroys TFo4FitSlot object.

Method Summary
 Bool_tCanConnectToSlot(TGo4FitSlot* slot)
          Checks, if slot can be connected to other
 protected voidCheckOwnership()
          Sets up ownership relation between object and owner of slot.
 voidClear()
          Clear pointer on object in slot.
 voidClearConnectionToSlot()
          Clear connection to other slot
 TObject*CloneObject(const char * newname)
          Clone object in slot and returns pointer on new object.
 Bool_tConnectToSlot(TGo4FitSlot* slot)
          Connect this slot to provided slot.
 TClass*GetClass()
          Return pointer on class for desired object.
 const TGo4FitSlot*GetConnectedSlot()
          Returns pointer to connected slot or 0, if not connected
 Bool_tGetNeeded()
          Return requirement status for slot.
 const TObject*GetObject()
          Return pointer on assigned object.
 const const char *GetObjectName()
          Return name of assigned object.
 Bool_tGetOwned()
          Return ownership flag.
 Int_tGetSaveFlag()
          Returns save flag.
 protected Bool_tHasSaveSettings()
           
 const Bool_tIsConnectedToSlot()
          Returns kTRUE, if slot connected to another slot
 const Bool_tIsEmpty()
          Return kTRUE, if no object in slot.
 const Bool_tIsObject()
          Return kTRUE, if object assigned to slot.
 const Bool_tIsRequired()
          Returns kTRUE, if object required, but not yet set.
 Bool_tIsSuitable(TObject* obj)
          Checks, if object class corresponds to class, specified for slot
 virtual const voidPrint(Option_t* option)
          Print information on standard output.
 voidSetDefaults(TNamed* iOwner, TClass* iClass)
          Set basic fields of slot.
 voidSetNeeded(Bool_t iNeeded)
          Set requirement flag for object.
 Bool_tSetObject(TObject* iObject, Bool_t iOwned, Bool_t CheckClass)
          Sets object to slot.
 voidSetOwned(Bool_t iOwned)
          Explicity sets ownership flag.
 voidSetSaveFlag(Int_t iSaveFlag)
          Set save flag for saving of object in slot, when slot stored to streamer:
0 - object will be saved if it owned,
1 - object always will be saved
2 - object never will be saved.
 protected voidSetSaveSettings(Int_t save, Int_t own)
           
 protected Bool_tWillBeSaved()
           

Methods inherited from class Go4Fit.TGo4FitNamed
GetFullName, GetOwner, GetOwnerFullName, SetOwner

Methods inherited from class TNamed
operator=, Clear, Clone, Compare, Copy, FillBuffer, GetName, GetTitle, Hash, IsSortable, SetName, SetNameTitle, SetTitle, ls, Sizeof, Class, Class_Name, Class_Version, Dictionary, IsA, ShowMembers, Streamer, StreamerNVirtual, DeclFileName, ImplFileLine, ImplFileName, DeclFileLine

Field Detail

fbNeeded

protected Bool_t fbNeeded
Flag, is this object should always be set.

fbOwned

protected Bool_t fbOwned
Ownership flag of object.

fiSaveFlag

protected Int_t fiSaveFlag
Describe saving of object in slot.

fiSaveOwnership

protected Int_t fiSaveOwnership

fiSaveSlot

protected Int_t fiSaveSlot

fxClass

protected TClass* fxClass
Class of object, which should be assigned to slot.

fxObject

protected TObject* fxObject
Pointer on assigned object.
Constructor Detail

TGo4FitSlot

public TGo4FitSlot()
Default constructor.

TGo4FitSlot

public TGo4FitSlot(TNamed* iOwner, TClass* iClass)
Creates TGo4FitSlot object.
This constructor should be called in default constrcutor of object, where slot situated.
Constructor only sets owner of slot, desired class of object and if this object should be always owned.
The rest values (name, title, object and so on) should be restored by streamer, which typically calls default constructor.

TGo4FitSlot

public TGo4FitSlot(const char * iName, const char * iTitle, TNamed* iOwner, TClass* iClass, Bool_t iNeeded, TObject* iObject, Bool_t iOwned)
Creates TGo4FitSlot object.
This constrcutor should be placed in normal constructor of object, where slot is situated.
Constructor sets name and title of slot, owner of slot, desired class of object and if this object always should be owned.
Optionally, requirements of object (is it always needed or not, default - not), pointer on object and ownership flag can be specified.
Method Detail

~TGo4FitSlot

public virtual synchronized ~TGo4FitSlot()
Destroys TFo4FitSlot object.
Method Detail

CanConnectToSlot

public Bool_t CanConnectToSlot(TGo4FitSlot* slot)
Checks, if slot can be connected to other

CheckOwnership

protected void CheckOwnership()
Sets up ownership relation between object and owner of slot.
If object owned by slot and object drived from TGo4FitNamed class, the owner of slot becames the owned of object.
This gives an ability to combine FullName of TGo4FitNamed object according ownership relation.

Clear

public void Clear()
Clear pointer on object in slot.
If object owned, it will be destroyed.

ClearConnectionToSlot

public void ClearConnectionToSlot()
Clear connection to other slot

CloneObject

public TObject* CloneObject(const char * newname)
Clone object in slot and returns pointer on new object.
Name of new object can be optionally specified.

ConnectToSlot

public Bool_t ConnectToSlot(TGo4FitSlot* slot)
Connect this slot to provided slot.
This means, that objects, containing in slot will be also return by GetObject() of current slot.
Class of slots should be compatible
Returns kTRUE, if operation successfull

GetClass

public TClass* GetClass()
Return pointer on class for desired object.

GetConnectedSlot

public const TGo4FitSlot* GetConnectedSlot()
Returns pointer to connected slot or 0, if not connected

GetNeeded

public Bool_t GetNeeded()
Return requirement status for slot.
If kTRUE, object should always be sets before any fitting become possible.

GetObject

public const TObject* GetObject()
Return pointer on assigned object.

GetObjectName

public const const char * GetObjectName()
Return name of assigned object.

GetOwned

public Bool_t GetOwned()
Return ownership flag.

GetSaveFlag

public Int_t GetSaveFlag()
Returns save flag.

HasSaveSettings

protected Bool_t HasSaveSettings()

IsConnectedToSlot

public const Bool_t IsConnectedToSlot()
Returns kTRUE, if slot connected to another slot

IsEmpty

public const Bool_t IsEmpty()
Return kTRUE, if no object in slot.

IsObject

public const Bool_t IsObject()
Return kTRUE, if object assigned to slot.

IsRequired

public const Bool_t IsRequired()
Returns kTRUE, if object required, but not yet set.

IsSuitable

public Bool_t IsSuitable(TObject* obj)
Checks, if object class corresponds to class, specified for slot

Print

public virtual const void Print(Option_t* option)
Print information on standard output.

SetDefaults

public void SetDefaults(TNamed* iOwner, TClass* iClass)
Set basic fields of slot.
See proper constructor for description. Normally should not be called by user.

SetNeeded

public void SetNeeded(Bool_t iNeeded)
Set requirement flag for object.

SetObject

public Bool_t SetObject(TObject* iObject, Bool_t iOwned, Bool_t CheckClass)
Sets object to slot.
First, if before another object was set to slot with ownership flag, it will be destroyd.
Then, if object should always be owned by slot, but object is assigning without ownersip, it will be cloned and clone will be assigned with ownership flag.
if CheckClass==kTRUE (default), slot will refuse unsuitable object class.
If object owned by slot, it always be destroyed by slot.

SetOwned

public void SetOwned(Bool_t iOwned)
Explicity sets ownership flag.
Normally should not be called by user.

SetSaveFlag

public void SetSaveFlag(Int_t iSaveFlag)
Set save flag for saving of object in slot, when slot stored to streamer:
0 - object will be saved if it owned,
1 - object always will be saved
2 - object never will be saved.

SetSaveSettings

protected void SetSaveSettings(Int_t save, Int_t own)

WillBeSaved

protected Bool_t WillBeSaved()

Association Links

to Class TClass

Class of object, which should be assigned to slot.

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005