2 #if !defined(DATAELEMENT_H)
8 // A simple data element class.
11 friend class DataElementEx
;
14 DataElement () : data_ (0) { count_
++; }
16 DataElement (int data
) : data_(data
) { count_
++; }
18 DataElement (const DataElement
& e
)
24 DataElement
& operator= (const DataElement
& e
)
30 bool operator== (const DataElement
& e
)
31 { return this->data_
== e
.data_
; }
33 ~DataElement () { count_
--; }
35 int getData () const { return data_
; }
37 void setData (int val
) { data_
= val
; }
39 static int numOfActiveObjects () { return count_
; }
47 int DataElement::count_
= 0;
49 #endif /*DATAELEMENT_H*/