54 cout <<
"**** ob1 : definition " <<
endl;
56 cout <<
"**** " <<
endl;
59 cout <<
"**** ob1 : modification with local variable and links " <<
endl;
60 UShort_t Crys_link; Float_t E_link; Int_t T0_link;
68 cout <<
"**** " <<
endl;
73 cout <<
"**** ob1 : proxy, reading mode only " <<
endl;
78 cout <<
" PROXY " << Crys_prox->
GetName() <<
" " << Crys_prox->
Get() <<
endl;
79 cout <<
" PROXY " << E_prox->GetName() <<
" " << E_prox->Get() <<
endl;
80 cout <<
"**** " <<
endl;
118 UShort_t Crys_link; Float_t E_link; Int_t T0_link ; Double_t V_link;
125 cout <<
"---> Set all items to 1 " <<
endl;
136 cout <<
"**** Before calling TransferLinkAndProxy o1 -> o2 " <<
endl;
137 cout <<
"**** ob1 " <<
endl;
139 cout <<
"**** ob2 " <<
endl;
143 cout <<
"**** After calling TransferLinkAndProxy o1 -> o2 " <<
endl;
144 cout <<
"**** ob1 " <<
endl;
146 cout <<
"**** ob2 " <<
endl;
148 cout <<
"**** ob1 cannot be changed anymore " <<
endl;
149 cout <<
"---> Set Crys and E items to 2 " <<
endl;
154 cout <<
"**** ob2 link and proxy works " <<
endl;
157 cout <<
" PROXY " << Crys_prox->
GetName() <<
" " << Crys_prox->
Get() <<
endl;
158 cout <<
" PROXY " << E_prox->GetName() <<
" " << E_prox->Get() <<
endl;
161 cout <<
"**** After calling TransferLinkAndProxy o2 -> o3 " <<
endl;
163 cout <<
"---> Set Crys, T0 and E items to 3 " <<
endl;
168 cout <<
"**** ob3 " <<
endl;
170 cout <<
" PROXY " << Crys_prox->
GetName() <<
" " << Crys_prox->
Get() <<
endl;
171 cout <<
" PROXY " << E_prox->GetName() <<
" " << E_prox->Get() <<
endl;
173 cout <<
"**** " <<
endl;
185 ano_link.
Set<UShort_t>(3u,0u);
186 ano_link.
Set<Float_t> (0.1,2u);
187 ano_link.
fRealSize =
sizeof(UShort_t) +
sizeof(Float_t);
199 ano1 = (Ano_prox->
Get()).Get<UShort_t>(0u);
200 ano2 = (Ano_prox->
Get()).Get<Float_t> (2u);
202 cout <<
" PROXY " << Ano_prox->
GetName() <<
" " << ano1 <<
endl;
203 cout <<
" PROXY " << Ano_prox->
GetName() <<
" " << ano2 <<
endl;
211 KeyFactory::Register(
"Agata"); FrameFactory::Register(
"Agata");
219 FILE *fp = fopen(
"FRAME.adf",
"rb");
223 for (UInt_t i = 0u; i < number; i++ ) {
232 #if ADF_STANDALONE == 1
233 int main(
int argc,
char **argv)
235 const int nbtest = 1;
237 std::cout <<
" Usage is : \n\t"
238 << argv[0] <<
" i \n i being a integer from 1 to "<< nbtest <<
std::endl;
240 int nwhat = 0; UInt_t number = 100;
242 std::istringstream what(argv[1]); what >> nwhat;
245 std::istringstream what(argv[2]); what >> number;
262 std::cout <<
" Unknown test number " << nwhat <<
std::endl;
int test1()
To show how to add named items to a GObject and how work links and proxy.
virtual UInt_t Read()
It reads the content into dedicated structures from the Frame (data part)
header file for TrackedFrame.cpp
virtual Bool_t AddItem(ANamedItem *item)
Add a named item to this. The item belongs to GObject and will be thus deleted.
virtual void SetItems(BufferIO &) const
write the value of all items into the buffer
int main(int argc, char **argv)
The tracking algorithm produces a stack of TrackedHits.
Base class for a Global Object.
std::string GetName() const
change value of this nmaed item using the passed one. it checks if asked, it check first if of the sa...
Bool_t Link(const char *name, Data_t *external_address)
General method to Link one item with an external address.
header file for PSAFrame.cpp
void TransferLinkAndProxy(GObject &to)
transfert proxy and link for one GObject to another one
Base class for version numbers.
virtual Data_T Get() const
Get the data.
Bool_t LinkItem(const Char_t *, const Char_t *, void *)
Only for basic type ... otherwise better to use the most general Link method.
void Set(const Data_T data, UShort_t offset=0u)
ADF::LogMessage & endl(ADF::LogMessage &log)
header file for ADFObjects.cpp
int test2()
To show how to transfer links and proxy from one Object to anoter one.
virtual Frame * New(const FactoryItem &key_item, const FactoryItem &frame_item)
const NamedItem< Data_t > * Get(const char *name)
to get a given item (reading mode only !!)
virtual Bool_t Load(FILE *)=0
load a Frame from a C file (for debugging)
virtual void Print(std::ostream &out=std::cout) const
print some informations about this object
header file for FrameFactory.cpp
LogMessage & endl(LogMessage &)
Base class that described an item in a Factory.