JACO JACO - Java Access to C++ Objects Mark Dönszelmann and Tony Johnson 25 May 2000.

Slides:



Advertisements
Similar presentations
Exceptions, Templates, And The Standard Template Library (STL) Chapter 16.
Advertisements

Copyright © 2012 Pearson Education, Inc. Chapter 16: Exceptions, Templates, and the Standard Template Library (STL)
Chapter 10 Introduction to Arrays
Lab#1 (14/3/1431h) Introduction To java programming cs425
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
C++ data types. Structs vs. Classes C++ Classes.
Analysis with Geant4 and AIDA Tony Johnson SLAC-Geant4 Workshop February 2002 Tony Johnson.
The Structure of the GNAT Compiler. A target-independent Ada95 front-end for GCC Ada components C components SyntaxSemExpandgigiGCC AST Annotated AST.
More C++ Classes Systems Programming. Systems Programming: C++ Classes 2 Systems Programming: 2 C++ Classes  Preprocessor Wrapper  Time Class Case Study.
ASP.NET Programming with C# and SQL Server First Edition
Victor Serbo, SLAC30 September 2004, Interlaken, Switzerland JASSimApp plugin for JAS3: Interactive Geant4 GUI Serbo, Victor (SLAC) - presenter Donszelmann,
Mapping Physical Formats to Logical Models to Extract Data and Metadata Tara Talbott IPAW ‘06.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
LCIO A persistency framework for LC detector simulation studies Frank Gaede, DESY, IT 4 th ECFA/DESY LC Workshop Amsterdam April 1 st -4 th 2003.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
FreeHEP Java Library Mark Dönszelmann, SLAC CHEP, La Jolla, March 2003.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
Java Analysis Studio Status Update 12 May 2000 Altas Software Week Tony Johnson
NeSC Grid Apps Workshop Exposing Legacy Applications as OGSI Components using pyGlobus Keith R. Jackson Distributed Systems Department Lawrence Berkeley.
Supporting High- Performance Data Processing on Flat-Files Xuan Zhang Gagan Agrawal Ohio State University.
Java Root IO Part of the FreeHEP Java Library Tony Johnson Mark Dönszelmann
Introduction to Java University of Sunderland CSE301 Harry R. Erwin, PhD.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
The Generic Gaming Engine Andrew Burke Advisor: Prof. Aaron Cass Abstract Games have long been a source of fascination. Their inherent complexity has challenged.
Grid Computing Research Lab SUNY Binghamton 1 Plans for Babelizing XCAT-C++ Madhu Govindaraju Kenneth Chiu.
Axel Naumann University of Nijmegen / NIKHEF, NL ROOT 2004 Users Workshop The Future of THtml Plans and Status of ROOT’s documentation facility.
Writing Extension Modules (Plugins) for JAS 3 Mark Donszelmann Tony Johnson Victor Serbo Max Turri CHEP2004, 27 september-1 october 2004, Interlaken, Switzerland.
V. Serbo, SLAC ACAT03, 1-5 December 2003 Interactive GUI for Geant4 by Victor Serbo, SLAC.
Walt Savitch University of California, San Diego
Chapter 14 Generics and the ArrayList Class Slides prepared by Rose Williams, Binghamton University Copyright © 2008 Pearson Addison-Wesley. All rights.
Data Structures Using C++ 2E1 Inheritance An “is-a” relationship –Example: “every employee is a person” Allows new class creation from existing classes.
Javadoc Comments.  Java API has a documentation tool called javadoc  The javadoc tool is used on the source code embedded with javadoc-style comments.
The FreeHEP Java Library ACAT 2000 Fermilab – October 2000 Mark Donszelmann, Julius Hrivnac – CERN Gary Bower, Tony Johnson, Joseph.
Introduction IS Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O.
WIRED 4 An extensible generic Event Display Mark Donszelmann SLAC, Stanford, U.S.A. CHEP2004, 27 september – 1 october Interlaken, Switzerland.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
STAR Event data storage and management in STAR V. Perevoztchikov Brookhaven National Laboratory,USA.
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
LC Software Workshop, May 2009, CERN P. Mato /CERN.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Visualization of Geant4 Data: Exploiting Component Architecture through AIDA, HepRep, JAS and WIRED Geant4 Workshop, CERN - 2 October 2002 Joseph Perl.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
LCIO A persistency framework and data model for the linear collider CHEP 04, Interlaken Core Software, Wednesday Frank Gaede, DESY -IT-
9/12/99R. Moore1 Level 2 Trigger Software Interface R. Moore, Michigan State University.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
JAVA INTRODUCTION. What is Java? 1. Java is a Pure Object – Oriented language 2. Java is developing by existing languages like C and C++. How Java Differs.
FreeHEP, JAS and WIRED Mark Dönszelmann, CERN/IT Charles Loomis, UC, Santa Cruz ATLAS Software Week, 30 November 2000.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
WIRED for LCD Analysis Mark Dönszelmann Linear Collider Simulation Workshop May 19-22, 2003, SLAC.
JAS and JACO – Status Report Atlas Graphics Group August 2000 Tony Johnson.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Function Templates 16.2.
Java Generics. Lecture Objectives To understand the objective of generic programming To be able to implement generic classes and methods To know the limitations.
Chapter 9 Classes: A Deeper Look, Part 1 Seventh Edition C++ How to Program © by Pearson Education, Inc. All Rights Reserved.
FASTFAST All rights reserved © MEP Make programming fun again.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
XML Schema for WIRED XML Detector Description Workshop
MPCS – Advanced java Programming
Object-Oriented Databases
Geant4 Geometry Objects Persistency using ROOT
Java Programming Language
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
C++/Java/COM Interoperability
C++ data types.
Presentation transcript:

JACO JACO - Java Access to C++ Objects Mark Dönszelmann and Tony Johnson 25 May 2000

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Goals and limitations Provide automatic Java proxies and JNI code to talk to C++ objects Provide a one to one mapping between Java and C++ objects Use C++ Header files as input Support multiple inheritance Support primitives, simple object references and pointers No access to private C++ member variables

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC What is out there ? SWIG Simple Wrapper and Interface Generator University of Utah, OpenSource Provides access from PERL, Tcl, Java and others to C/C++ TypeMaps to “convert” parameters and return values Not a full C/C++ parser Written in C++, being moved to C (?) No object to object mapping Project seems relatively abandoned... J2CPP Proxy class and JNI generator IBM, part of VAJ Enterprise Edition Standard mappings to “convert” parameters and return values Object to object mapping Good Example for JACO Relatively expensive No way to extend Not a full C/C++ parser No Multiple Inheritance

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC JACO Written in Java, with a full C++ parser (templates, namespaces,...) Part of FreeHep, OpenSource, as a separate jar file Input: C++ header files Output for every C++ class: Java Interfaces, allowing multiple inheritance Java Proxy implementing the corresponding Java Interface, inheriting from a standard CPPProxy and for all C++ classes: JNI Code to glue the Java Proxies to the C++ classes A two-way lookup table to provide Object to Object mapping

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC JACO Architecture Java Program JNI Wrapper Code JACO Java Proxies C++ Program C++ Interface Definitions (Header Files) Lookup Table Java Interfaces

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC C++ Parser and RTTI system Parser for C++ Header Files JavaCC - Parser Generator, free tool from Sun and Metamata Input:  a C++ Grammar file (CPPParser.jj)  some Java classes (ClassScope, SymTab,...) Output:  CPPParser.java and CPPParserTokenManager.java RTTI System Some classes to keep:  Class, Method and Parameter definitions make: System to parse C++ header files and provide enough information to generate Java Interfaces, Java Proxies and JNI code

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Java Interface, Proxy and JNI Generation A Java Interface B Java Interface C Java Interface AProxy Java Class BProxy Java Class CProxy Java Class JNI C/C++ Code A C++ Class B C++ Class C C++ Class CPPProxy Java Class Lookup Table C/C++ Code Generated Code Hand-written Code

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Object to Object mapping using Lookup Table Calls from Java to C++ Lookup Java object -> handle -> pointer -> C++ object C++ method returns New Object Lookup C++ pointer, not found, create Java object, add to table C++ method returns Existing Object Lookup C++ pointer -> handle -> jref -> Java object AProxy Java Class A C++ Class CPPProxy Java Class Lookup Table C/C++ Code pointerhandle pointerhandle pointerhandle B C++ Class jref

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Tests See if we can generate the AIDA Java and JNI code, and compare this with the hand-written code. Generate the other AIDA parts Generate the C++ HepRep interfaces of which the Java version is currently being integrated into WIRED Access to GEANT4 for visualization ? Access to Objectivity ? Access to ROOT I/O?

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Problems Mapping of some standard classes to some Java standard classes (e.g. String) Mapping of C++ collection classes to Java collection classes Complex pointers and references Instantiations of Templates Definitions of Templates Operator overloading Object creation and lifetime

1 December 2015Mark Dönszelmann, CERN and Tony Johnson, SLAC Conclusions The C++ parser and RTTI are ready, though they may have to be extended extract and keep more information, to use for the generators The Java Interface and Proxy generators are ready, but may need some tweaking once the JNI generator is in place Practical hand-coded JNI examples (AIDA, CHORUS, ATLAS and GEANT4) are available The tables for Object to Object mapping are ready The JNI generator has to be written (Tony with help from me and some C++ experts)