23 #ifndef ADF_FrameFactory
27 #ifndef ADF_ConfigurationFrame
32 #ifndef ADF_AgataFrameFactory
40 FrameFactory::FrameFactory():
46 FrameFactory::FrameFactory(std::string name):
62 sfp =
DoNew(key,frame_item);
66 sfp->
GetFrame()->fSignature = l_item;
98 for (
size_t i = 0; i < fFactories.size(); i++) {
102 for (
size_t i = 0; i < fClonedFactories.size(); i++) {
103 delete fClonedFactories[i];
105 fClonedFactories.clear();
112 for (
size_t i = 0; i < fFactories.size(); i++) {
113 if ( fFactories[i]->
GetName() == which_factory )
115 factory = fFactories[i];
122 FrameFactory *MainFrameFactory::GetClonedFactory(std::string which_factory,
void *ptr)
const
126 for (
size_t i = 0; i < fClonedFactories.size(); i++) {
127 if ( fClonedFactories[i]->
GetName() == which_factory && fClonedFactories[i] == ptr )
129 factory = fClonedFactories[i];
147 fFactories.push_back(anewfactory);
164 if ( factory_name ==
"Default" ) {
168 if ( factory_name ==
"Agata" ) {
177 return gTheMainFactory;
180 FrameFactory *MainFrameFactory::Clone(std::string which_factory,
const std::string &opt)
183 if ( factory == 0x0 )
188 fClonedFactories.push_back(cloned);
194 Int_t MainFrameFactory::Clone(std::list<FrameFactory *> &cloned_list,
const std::string &opt)
196 Int_t nb_cloned = 0; std::vector< FrameFactory * >
tmp(fFactories);
198 for (
size_t i = 0; i < tmp.size(); i++) {
204 cloned_list.push_back(newfact);
264 delete csfp; csfp = 0x0;
285 delete cframe; cframe = 0x0;
Bool_t IsKnown(std::string which_factory) const
check a factory has been registered
virtual Key * GetKey()=0
To get the Key associated to this frame.
virtual Frame * GetFrame() const
static MainFrameFactory & theMainFactory()
the main (global) keyfactory
Base class for a FrameFactory.
header file for AgataFrameFactory.cpp
MainFrameFactory(std::string factory_name)
DotConf : Utility for class configuration from ascii file or Configuration frames.
virtual Frame * New(const FactoryItem &key_item, const FactoryItem &frame_item)
just a frame
const FactoryItem & GetSignature() const
header file for DefaultFrameFactory.cpp
virtual void SetFrameChangeFunction(PF_FactoryItemChange pf)
static Factory_T * theFactory()
to create the main (singleton) factory of that type
virtual SharedFP * DoNew(Key *, const FactoryItem &)
Do really the job of allocating the frame.
const PF_FactoryItemChange & GetKeyChangeFunction() const
virtual SharedFP * NewSharedFrame(const FactoryItem &, const FactoryItem &)
Ask the main for a new Frame.
const std::string & GetFactoryName() const
virtual Frame * SetFrame(Frame *)
change the frame, returns the current one
virtual Bool_t Copy(const Char_t *, UInt_t, const char= 'b')=0
copy a buffer to this Frame
FrameFactory * GetFactory(std::string which_factory) const
Ask for a particular factory from is name.
virtual void SetKeyChangeFunction(PF_FactoryItemChange pf)
void SetFactoryPtr(void *ptr)
change
Bool_t Register(FrameFactory *)
Add one factory to this collection of keyfactories: name has to be unique so return false if a factor...
virtual Frame * New(const FactoryItem &key_item, const FactoryItem &frame_item)
virtual FrameFactory * Clone(const std::string &="full")=0
realised clone of this factory
virtual void AddConf(DotConf *)
add a conf object to this. The added objects are not owned by this so not deleted.
static MainKeyFactory & theMainFactory()
the main (global) keyfactory
header file for FrameFactory.cpp
virtual const std::string & GetName() const
name of the factory
virtual SharedFP * NewSharedFrame(const FactoryItem &, const FactoryItem &)
Ask this factory for a new Frame.
virtual ~MainFrameFactory()
void * GetFactoryPtr() const
virtual Key * New(const FactoryItem &)
build a key using item.
const PF_FactoryItemChange & GetFrameChangeFunction() const
Base class that described an item in a Factory.
const FactoryItem & GetSignature() const
Signature of that frame.
Base class for a MainFactory i.e. a factory composed of factories.