#include <TGo4FitSlot.h>
Inheritance diagram for TGo4FitSlot:
Public Member Functions | |
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=kFALSE, TObject *iObject=0, Bool_t iOwned=kFALSE) | |
Creates TGo4FitSlot object. | |
virtual | ~TGo4FitSlot () |
Destroys TFo4FitSlot object. | |
TClass * | GetClass () |
Return pointer on class for desired object. | |
void | SetDefaults (TNamed *iOwner, TClass *iClass) |
Set basic fields of slot. | |
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. | |
Int_t | GetSaveFlag () |
Returns save flag. | |
Bool_t | IsSuitable (TObject *obj) |
Checks, if object class corresponds to class, specified for slot. | |
Bool_t | IsSuitableClass (TClass *cl) |
Checks, if class corresponds to specified for slot. | |
Bool_t | SetObject (TObject *iObject, Bool_t iOwned=kFALSE, Bool_t CheckClass=kTRUE) |
Sets object to slot. | |
Bool_t | ConnectToSlot (TGo4FitSlot *slot) |
Connect this slot to provided slot. | |
Bool_t | CanConnectToSlot (TGo4FitSlot *slot) |
Checks, if slot can be connected to other. | |
TGo4FitSlot * | GetConnectedSlot () const |
Returns pointer to connected slot or 0, if not connected. | |
Bool_t | IsConnectedToSlot () const |
Returns kTRUE, if slot connected to another slot. | |
void | ClearConnectionToSlot () |
Clear connection to other slot. | |
TObject * | GetObject () const |
Return pointer on assigned object. | |
const char * | GetObjectName () const |
Return name of assigned object. | |
TObject * | CloneObject (const char *newname=0) |
Clone object in slot and returns pointer on new object. | |
virtual void | Clear (Option_t *="") |
Clear pointer on object in slot. | |
Bool_t | GetOwned () |
Return ownership flag. | |
void | SetOwned (Bool_t iOwned=kTRUE) |
Explicitly sets ownership flag. | |
Bool_t | GetNeeded () |
Return requirement status for slot. | |
void | SetNeeded (Bool_t iNeeded) |
Set requirement flag for object. | |
Bool_t | IsEmpty () const |
Return kTRUE, if no object in slot. | |
Bool_t | IsObject () const |
Return kTRUE, if object assigned to slot. | |
Bool_t | IsRequired () const |
Returns kTRUE, if object required, but not yet set. | |
virtual void | Print (Option_t *option) const |
Print information on standard output. | |
Protected Member Functions | |
void | SetSaveSettings (Int_t save=-1, Int_t own=-1) |
Bool_t | HasSaveSettings () |
Bool_t | WillBeSaved () |
void | CheckOwnership () |
Sets up ownership relation between object and owner of slot. | |
Protected Attributes | |
TClass * | fxClass |
Class of object, which should be assigned to slot. | |
Int_t | fiSaveFlag |
Describe saving of object in slot. | |
Bool_t | fbOwned |
Ownership flag of object. | |
Bool_t | fbNeeded |
Flag, is this object should always be set. | |
TObject * | fxObject |
Pointer on assigned object. | |
Int_t | fiSaveSlot |
Int_t | fiSaveOwnership |
Friends | |
class | TGo4FitSlotList |
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.
Definition at line 27 of file TGo4FitSlot.h.
TGo4FitSlot::TGo4FitSlot | ( | ) |
TGo4FitSlot::TGo4FitSlot | ( | TNamed * | iOwner, | |
TClass * | iClass | |||
) |
Creates TGo4FitSlot object.
This constructor should be called in default constructor 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.
Definition at line 34 of file TGo4FitSlot.cxx.
References TGo4FitNamed::SetOwner().
TGo4FitSlot::TGo4FitSlot | ( | const char * | iName, | |
const char * | iTitle, | |||
TNamed * | iOwner, | |||
TClass * | iClass, | |||
Bool_t | iNeeded = kFALSE , |
|||
TObject * | iObject = 0 , |
|||
Bool_t | iOwned = kFALSE | |||
) |
Creates TGo4FitSlot object.
This constructor 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.
Definition at line 47 of file TGo4FitSlot.cxx.
TGo4FitSlot::~TGo4FitSlot | ( | ) | [virtual] |
TClass* TGo4FitSlot::GetClass | ( | ) | [inline] |
Return pointer on class for desired object.
Definition at line 61 of file TGo4FitSlot.h.
References fxClass.
Referenced by CanConnectToSlot(), IsSuitable(), IsSuitableClass(), TGo4FitterAbstract::ProcessObjects(), and SetObject().
void TGo4FitSlot::SetDefaults | ( | TNamed * | iOwner, | |
TClass * | iClass | |||
) |
Set basic fields of slot.
See proper constructor for description. Normally should not be called by user.
Definition at line 67 of file TGo4FitSlot.cxx.
References fxClass, and TGo4FitNamed::SetOwner().
void TGo4FitSlot::SetSaveFlag | ( | Int_t | iSaveFlag | ) | [inline] |
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.
Definition at line 75 of file TGo4FitSlot.h.
References fiSaveFlag.
Int_t TGo4FitSlot::GetSaveFlag | ( | ) | [inline] |
Bool_t TGo4FitSlot::IsSuitable | ( | TObject * | obj | ) |
Checks, if object class corresponds to class, specified for slot.
Definition at line 100 of file TGo4FitSlot.cxx.
References GetClass(), GetConnectedSlot(), IsConnectedToSlot(), and IsSuitable().
Referenced by IsSuitable(), and TGo4FitterAbstract::ProcessObjects().
Bool_t TGo4FitSlot::IsSuitableClass | ( | TClass * | cl | ) |
Checks, if class corresponds to specified for slot.
Definition at line 107 of file TGo4FitSlot.cxx.
References GetClass(), GetConnectedSlot(), IsConnectedToSlot(), and IsSuitableClass().
Referenced by IsSuitableClass().
Bool_t TGo4FitSlot::SetObject | ( | TObject * | iObject, | |
Bool_t | iOwned = kFALSE , |
|||
Bool_t | CheckClass = kTRUE | |||
) |
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.
Definition at line 114 of file TGo4FitSlot.cxx.
References CheckOwnership(), fbOwned, fxObject, GetClass(), GetConnectedSlot(), IsConnectedToSlot(), and SetObject().
Referenced by Clear(), TGo4FitterAbstract::ProcessObjects(), TGo4FitDataRidge::SetData(), TGo4FitModelFromData::SetDataAsModel(), TGo4FitDataGraph::SetGraph(), TGo4FitDataHistogram::SetHistogram(), TGo4FitSlotList::SetObject(), SetObject(), and TGo4FitDataProfile::SetProfile().
Bool_t TGo4FitSlot::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
Definition at line 73 of file TGo4FitSlot.cxx.
References CanConnectToSlot(), fbOwned, and fxObject.
Referenced by TGo4FitSlotList::ConnectSlots().
Bool_t TGo4FitSlot::CanConnectToSlot | ( | TGo4FitSlot * | slot | ) |
Checks, if slot can be connected to other.
Definition at line 82 of file TGo4FitSlot.cxx.
References GetClass(), and GetConnectedSlot().
Referenced by ConnectToSlot().
TGo4FitSlot* TGo4FitSlot::GetConnectedSlot | ( | ) | const [inline] |
Returns pointer to connected slot or 0, if not connected.
Definition at line 118 of file TGo4FitSlot.h.
References fxObject.
Referenced by CanConnectToSlot(), TGo4FitSlotList::ClearSlot(), GetObject(), IsConnectedToSlot(), IsSuitable(), IsSuitableClass(), Print(), and SetObject().
Bool_t TGo4FitSlot::IsConnectedToSlot | ( | ) | const [inline] |
Returns kTRUE, if slot connected to another slot.
Definition at line 123 of file TGo4FitSlot.h.
References GetConnectedSlot().
Referenced by CheckOwnership(), ClearConnectionToSlot(), GetObject(), IsSuitable(), IsSuitableClass(), Print(), and SetObject().
void TGo4FitSlot::ClearConnectionToSlot | ( | ) |
Clear connection to other slot.
Definition at line 92 of file TGo4FitSlot.cxx.
References fbOwned, fxObject, and IsConnectedToSlot().
Referenced by TGo4Fitter::CheckSlotsBeforeDelete().
TObject * TGo4FitSlot::GetObject | ( | ) | const |
Return pointer on assigned object.
Definition at line 130 of file TGo4FitSlot.cxx.
References fxObject, GetConnectedSlot(), GetObject(), and IsConnectedToSlot().
Referenced by TGo4FitSlotList::ClearSlot(), CloneObject(), TGo4FitData::GetAxisTrans(), TGo4FitDataRidge::GetData(), TGo4FitModelFromData::GetDataAsModel(), TGo4FitDataGraph::GetGraph(), TGo4FitDataHistogram::GetHistogram(), GetObject(), GetObjectName(), TGo4FitDataProfile::GetProfile(), IsEmpty(), and IsObject().
const char * TGo4FitSlot::GetObjectName | ( | ) | const |
Return name of assigned object.
Definition at line 135 of file TGo4FitSlot.cxx.
References GetObject().
Referenced by Print().
TObject * TGo4FitSlot::CloneObject | ( | const char * | newname = 0 |
) |
Clone object in slot and returns pointer on new object.
Name of new object can be optionally specified.
Definition at line 142 of file TGo4FitSlot.cxx.
References GetObject().
virtual void TGo4FitSlot::Clear | ( | Option_t * | = "" |
) | [inline, virtual] |
Clear pointer on object in slot.
If object owned, it will be destroyed.
Definition at line 150 of file TGo4FitSlot.h.
References SetObject().
Referenced by TGo4FitSlotList::ClearSlot().
Bool_t TGo4FitSlot::GetOwned | ( | ) | [inline] |
Return ownership flag.
Definition at line 155 of file TGo4FitSlot.h.
References fbOwned.
Referenced by TGo4FitSlotList::ClearSlot().
void TGo4FitSlot::SetOwned | ( | Bool_t | iOwned = kTRUE |
) | [inline] |
Explicitly sets ownership flag.
Normally should not be called by user.
Definition at line 161 of file TGo4FitSlot.h.
References fbOwned.
Referenced by TGo4FitSlotList::ClearSlot().
Bool_t TGo4FitSlot::GetNeeded | ( | ) | [inline] |
Return requirement status for slot.
If kTRUE, object should always be sets before any fitting become possible.
Definition at line 167 of file TGo4FitSlot.h.
References fbNeeded.
void TGo4FitSlot::SetNeeded | ( | Bool_t | iNeeded | ) | [inline] |
Bool_t TGo4FitSlot::IsEmpty | ( | ) | const [inline] |
Return kTRUE, if no object in slot.
Definition at line 177 of file TGo4FitSlot.h.
References GetObject().
Referenced by IsRequired().
Bool_t TGo4FitSlot::IsObject | ( | ) | const [inline] |
Return kTRUE, if object assigned to slot.
Definition at line 182 of file TGo4FitSlot.h.
References GetObject().
Bool_t TGo4FitSlot::IsRequired | ( | ) | const [inline] |
void TGo4FitSlot::Print | ( | Option_t * | option | ) | const [virtual] |
Print information on standard output.
Reimplemented from TGo4FitNamed.
Definition at line 149 of file TGo4FitSlot.cxx.
References fbNeeded, fbOwned, fxClass, fxObject, GetConnectedSlot(), GetObjectName(), IsConnectedToSlot(), and Print().
Referenced by Print(), TGo4FitDataProfile::Print(), TGo4FitDataHistogram::Print(), and TGo4FitDataGraph::Print().
void TGo4FitSlot::SetSaveSettings | ( | Int_t | save = -1 , |
|
Int_t | own = -1 | |||
) | [protected] |
Bool_t TGo4FitSlot::HasSaveSettings | ( | ) | [protected] |
Bool_t TGo4FitSlot::WillBeSaved | ( | ) | [protected] |
void TGo4FitSlot::CheckOwnership | ( | ) | [protected] |
Sets up ownership relation between object and owner of slot.
If object owned by slot and object derived from TGo4FitNamed class, the owner of slot becomes the owned of object. This gives an ability to combine FullName of TGo4FitNamed object according ownership relation.
Definition at line 164 of file TGo4FitSlot.cxx.
References fbOwned, fxObject, TGo4FitNamed::GetOwner(), and IsConnectedToSlot().
Referenced by SetObject().
friend class TGo4FitSlotList [friend] |
Definition at line 197 of file TGo4FitSlot.h.
TClass* TGo4FitSlot::fxClass [protected] |
Class of object, which should be assigned to slot.
Definition at line 215 of file TGo4FitSlot.h.
Referenced by GetClass(), Print(), and SetDefaults().
Int_t TGo4FitSlot::fiSaveFlag [protected] |
Describe saving of object in slot.
Definition at line 220 of file TGo4FitSlot.h.
Referenced by GetSaveFlag(), SetSaveFlag(), and WillBeSaved().
Bool_t TGo4FitSlot::fbOwned [protected] |
Ownership flag of object.
Definition at line 226 of file TGo4FitSlot.h.
Referenced by CheckOwnership(), ClearConnectionToSlot(), ConnectToSlot(), GetOwned(), Print(), SetObject(), SetOwned(), WillBeSaved(), and ~TGo4FitSlot().
Bool_t TGo4FitSlot::fbNeeded [protected] |
Flag, is this object should always be set.
Definition at line 231 of file TGo4FitSlot.h.
Referenced by GetNeeded(), IsRequired(), Print(), and SetNeeded().
TObject* TGo4FitSlot::fxObject [protected] |
Pointer on assigned object.
Definition at line 236 of file TGo4FitSlot.h.
Referenced by CheckOwnership(), ClearConnectionToSlot(), ConnectToSlot(), GetConnectedSlot(), GetObject(), Print(), SetObject(), and ~TGo4FitSlot().
Int_t TGo4FitSlot::fiSaveSlot [protected] |
Definition at line 238 of file TGo4FitSlot.h.
Referenced by HasSaveSettings(), and SetSaveSettings().
Int_t TGo4FitSlot::fiSaveOwnership [protected] |
Definition at line 239 of file TGo4FitSlot.h.
Referenced by HasSaveSettings(), and SetSaveSettings().