2 #ifndef GRAPHABLE_ELEMENT_H
3 #define GRAPHABLE_ELEMENT_H
5 #include "Name_Binding.h"
8 // A helper class that knows how to sort two ACE_Name_Binding objects
9 // which contain temperature metrics. The value stored in the binding
10 // is expected to be of the format "time|temp".
12 // Listing 1 code/ch21
13 class Graphable_Element
: public Name_Binding
16 Graphable_Element (ACE_Name_Binding
*entry
)
19 sscanf (this->value (), "%d|%f", &this->when_
, &this->temp_
);
23 // Listing 2 code/ch21
24 inline int when () const
35 // Listing 3 code/ch21
36 inline bool operator< (const Graphable_Element
&other
) const
38 return this->when () < other
.when ();
42 // Listing 4 code/ch21
48 typedef std::list
<Graphable_Element
> Graphable_Element_List
;
51 #endif /* GRAPHABLE_ELEMENT_H */