1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
5 >Using the reading context
</TITLE
8 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.79"><LINK
10 TITLE=
"Linux Trace Toolkit Viewer Developer Guide"
11 HREF=
"index.html"><LINK
13 TITLE=
"How to use the Linux Trace Toolkit Viewer's Reading Context"
16 TITLE=
"Why an event driven trace reader ?"
19 TITLE=
"Linux Trace Toolkit Viewer Graphical Module Tutorial"
20 HREF=
"c67.html"></HEAD
31 SUMMARY=
"Header navigation table"
40 >Linux Trace Toolkit Viewer Developer Guide
</TH
56 >Chapter
2. How to use the Linux Trace Toolkit Viewer's Reading Context
</TD
77 >2.3. Using the reading context
</A
80 > If you have read the tutorials about writing a text and a graphic module, you
81 should be fairly ready to use the information provided to your hook by the
85 > The data structures of the reading context are based on the gobject, a
86 object-oriented library from the glib. Some evolved types that are found in the
87 context also comes from the
"glib" (GArray, GHashTable and so on). For detailed
88 information about
"gobjects" and the
"glib", see the
<A
89 HREF=
"http://www.gtk.org"
92 > website. They provide a complete
93 API reference about the data types they provide.
96 > The reading context is object oriented. It is described by the lttv/tracecontext.h
97 header. Is can be illustrated with this UML class diagram :
104 SRC=
"lttv-context.png"
108 >Linux Trace Toolkit Viewer Reading Context Class Diagram
</P
115 > Though, for performance's sake, navigating through it is not as encapsulated as
116 it could. Consider the class attributes to be all public (no get/set functions).
117 Sometimes, iteration upon a specific element can be uneasy. For example, you may
118 have to get the number of tracefiles in a trace from the
"vt" field of the trace
119 context to be able to iterate over all the tracefiles contained by the trace.
122 > To facilitate the common operations on the reading context, LTTV now provides a
123 header that consists of simple macros : lttv/contextmacros.h. It gives an object
124 look-and-feel to the context classes. Simple
"GET" macros can be used to easily
125 access the different fields are iterate over the elements (and get the total
126 number of elements too).
134 SUMMARY=
"Footer navigation table"
173 >Why an event driven trace reader ?
</TD
187 >Linux Trace Toolkit Viewer Graphical Module Tutorial
</TD