GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ADF::DataLink Class Reference

A DataLink links too variables in memory. More...

#include <DataHandling.h>

Inheritance diagram for ADF::DataLink:

Public Member Functions

virtual void CopyA1_to_A2 ()
 Copy a1 into a2. More...
 
virtual void CopyA2_to_A1 ()
 Copy a2 into a1. More...
 
 DataLink ()
 
virtual void Link (void *, void *)
 test if the given address is one of the Link More...
 
virtual void Reset ()
 both linked data to default More...
 
virtual void ResetA1 ()
 set A1 to default More...
 
virtual void ResetA2 ()
 set A2 to default More...
 
virtual ~DataLink ()
 

Protected Member Functions

virtual void * A1 ()
 
virtual void * A2 ()
 

Friends

class GObject
 

Detailed Description

A DataLink links too variables in memory.

Two addresses of the same type of data are linked by a DataLink. Once linked, the value of the first one (second one) is copied in the second one (first one) each time the CopyA1_to_A2 (CopyA2_to_A1) method is called.

Both values could be set to a default value by calling the Reset method. The default value are set in the constructor

Be careful, it is the charge of the user to be sure a DalaLink is correctly linked with two valid addresses.

UShort_t a1, a2; DataLinkImp<UShort_t> link;
a1 = 1; a2 = 2;
link(&a1,&a2);
link.CopyA1_to_A2(); ==> a1 = a2 = 1
a2 = 2;
link.CopyA2_to_A1(); ==> a1 = a2 = 2
link.Reset(); ==> a1 = a2 = 0

With this, user's variables could be linked on the basis of a common name.

See for instance ANamedItem, NamedItem and GObject.

Definition at line 80 of file DataHandling.h.


The documentation for this class was generated from the following file: