C Introspection and Object persistency Through JIL - PowerPoint PPT Presentation

About This Presentation
Title:

C Introspection and Object persistency Through JIL

Description:

Introspection and Object Persistency ... Object Persistency: Writing the data portion of an ... Add object persistency support to existing CODA file format ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 17
Provided by: andyko
Category:

less

Transcript and Presenter's Notes

Title: C Introspection and Object persistency Through JIL


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
(No Transcript)
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
Write a Comment
User Comments (0)
About PowerShow.com