Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++ Introspection and Object persistency Through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA.

Similar presentations


Presentation on theme: "C++ Introspection and Object persistency Through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA."— Presentation transcript:

1 C++ Introspection and Object persistency Through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA

2 Introspection and Object Persistency Introspection: Ability for a program to query the structure of its classes from within the program. Object Persistency: Writing the data portion of an object to a file so that it can be re-created later by another program.

3 Motivation for JIL Add object persistency support to existing CODA file format Implement C++ object persistence in DANA framework Make general use tool for object persistence without requiring access to C++ source (only headers)

4 Serializers Files are 1-dimensional things. In order to write a multi-dimensional “object” into a file, it must be serialized. A corresponding deserializer must also be written to reconstitute the object later. In addition, a file format specification is needed to keep track of what objects are in the file along with locations and sizes.

5 Multiple Approaches To Creating Serializers Write generic serializer based on introspective information C++ parser/interpreter (ROOT) Write class definitions in XML format and generate C++ headers Hand coded serializers

6 A Simple Example

7 Use Gnu Debugger (gdb) to mine class/struct structure

8 XML representation of “myClass”

9 (De)Serializer Routines change complex structures into “simple” type problem

10

11 Writing objects to a file

12 Reading objects from a file

13 Serialization time vs. # events

14 Multi-Threading

15 Summary JIL provides a mechanism to add object persistency through files to C++ projects JIL can use either C++ code or XML as the source from which to generate serializer methods JIL can be used to make 3rd party objects persistent without modifying the 3rd party source code

16 Summary JIL optionally uses bzip2 compression JIL is multi-thread enabled (not just thread- safe) JIL allows customized backends to support legacy file formats


Download ppt "C++ Introspection and Object persistency Through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA."

Similar presentations


Ads by Google