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.

Slides:



Advertisements
Similar presentations
User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Advertisements

C++ Language Fundamentals. 2 Contents 1. Introduction to C++ 2. Basic syntax rules 3. Declaring and using variables.
C/c++ 4 Yeting Ge.
Reflex Dictionary Generator Antti Hahto
Exceptions, Templates, And The Standard Template Library (STL) Chapter 16.
Copyright © 2012 Pearson Education, Inc. Chapter 16: Exceptions, Templates, and the Standard Template Library (STL)
Status and Future of CINT Reflex as Reflection Database Object-Oriented CINT Multi-Threading Masaharu Goto, Agilent Philippe Canal, Fermilab Stefan Roiser,
LLVM-based C++ Interpreter For ROOT Axel Naumann, CERN Lukasz Janyst, CERN Philippe Canal, Fermilab.
OBJECT-ORIENTED PROGRAMMING. What is an “object”? Abstract entity that contains data and actions Attributes (characteristics) and methods (functions)
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
Chapter 11-12, Appendix D C Programs Higher Level languages Compilers C programming Converting C to Machine Code C Compiler for LC-3.
Guide To UNIX Using Linux Third Edition
Building An Interpreter After having done all of the analysis, it’s possible to run the program directly rather than compile it … and it may be worth it.
C++ Functions. 2 Agenda What is a function? What is a function? Types of C++ functions: Types of C++ functions: Standard functions Standard functions.
Review of C++ Programming Part II Sheng-Fang Huang.
Language Systems Chapter FourModern Programming Languages 1.
CSE 332: C++ templates This Week C++ Templates –Another form of polymorphism (interface based) –Let you plug different types into reusable code Assigned.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Classes: A Deeper Look Part.
CINT & Reflex: New Reflection Data Structures Masa(haru) Goto Agilent Philippe Canal Fermilab/CD Stefan Roiser, Axel Naumann PH/SFT.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
CS212: Object Oriented Analysis and Design Lecture 6: Friends, Constructor and destructors.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
1 ENERGY 211 / CME 211 Lecture 26 November 19, 2008.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Procedural and Object-Oriented Programming 13.1.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Chapter 13. Procedural programming vs OOP  Procedural programming focuses on accomplishing tasks (“verbs” are important).  Object-oriented programming.
Copyright © Curt Hill Generic Classes Template Classes or Container Classes.
Copyright 2004 Scott/Jones Publishing Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 7 Structured Data and Classes.
ADTs and C++ Classes Classes and Members Constructors The header file and the implementation file Classes and Parameters Operator Overloading.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Classes Representing Non-Trivial Objects. Problem Write a program that reads a temperature (either Fahrenheit or Celsius), and displays that same temperature.
LANGUAGE SYSTEMS Chapter Four Modern Programming Languages 1.
C Functions Three major differences between C and Java functions: –Functions are stand-alone entities, not part of objects they can be defined in a file.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Design Patterns David Talby. This Lecture Re-routing method calls Chain of Responsibility Coding partial algorithms Template Method The Singleton Pattern.
CSci 162 Lecture 10 Martin van Bommel. Procedures vs Objects Procedural Programming –Centered on the procedures or actions that take place in a program.
1 FESA architecture v.1.0 Framework Configuration & Data-entry Tool 5 th December 2003.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
CSCI-383 Object-Oriented Programming & Design Lecture 25.
ROOT Team Meeting Axel Naumann CERN PH/SFT Crienftlex Extended Version. And also Director’s Cut. Crienftlex.
D. Duellmann - IT/DB LCG - POOL Project1 The LCG Dictionary and POOL Dirk Duellmann.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Chapter 17 – Templates. Function Templates u Express general form for a function u Example: template for adding two numbers Lesson 17.1 template Type.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Programming Fundamentals1 Chapter 7 INTRODUCTION TO CLASSES.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Function Templates 16.2.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Templates 3 Templates and type parameters The basic idea templates is simple: we can make code depend on parameters, so that it can be used in different.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Defining Data Types in C++ Part 2: classes. Quick review of OOP Object: combination of: –data structures (describe object attributes) –functions (describe.
Pyragen A PYTHON WRAPPER GENERATOR TO APPLICATION CORE LIBRARIES Fernando PEREIRA, Christian THEIS - HSE/RP EDMS tech note:
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
CS212: Object Oriented Analysis and Design
Procedural and Object-Oriented Programming
Test 2 Review Outline.
CSE687 – Object Oriented Design
Semantic Analysis with Emphasis on Name Analysis
Review: Two Programming Paradigms
Geant4 Geometry Objects Persistency using ROOT
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
ENERGY 211 / CME 211 Lecture 8 October 8, 2008.
ROOT Support and Developments at FNAL
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
SPL – PS1 Introduction to C++.
Presentation transcript:

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 modularized code Remove function wrappers in CINT dictionaries for inherited virtual functions Saves 30% of e.g. G__Cont.o Can be implemented on all platforms Call through base class's wrapper Replace function wrappers by direct library calls on selected systems Saves 55% of e.g. G__Cont.o Highly platform dependent, will only work for selected architectures (GCC, ICC, MSVC) Shuffle CINT's functionality into an object-oriented layout See above Prerequisite for thread-safety Make CINT thread-safe On-the-fly dictionary generation Useful for e.g. templated classes Powerful once direct library calls work New implementation of the byte-code compiler Major source of ISO C++ incompatibilities Byte-Code Compiler Analyze and optimize expressions, store them in a compact format for fast execution 1 per process, Byte-code stored by repository Parser reads files, stores them either as byte-code or verbally, to be interpreted or re- parsed for template instantiation Interpreter accesses code repository when calling functions, #including code, etc. Interpreter evaluates expressions based on dictionary information: translates string " ((TObject*)o)->GetName() " to a function call. If interpreter and dictionary don’t know a type: generate dictionary on the fly (e.g. for template instantiations) Store byte-code in repository Interpreter decides what to generate byte-code for, runs byte-code Generator fills dictionary data into Reflex objects, stores them as.root file Code Repository Store sources: macros, byte-code (pre-compiled macros), template definitions, loaded libraries 1 per interpreter: loaded macros 1 per process: loaded libraries Parser Read and analyze sources, send input to dictionary and code repository 1 per process Interpreter Evaluate expressions given a piece of code ≥1 per thread Dictionary Representation of C++ types / members of libraries and macros, includes Reflex 1 per interpreter: loaded macros 1 per process: loaded libraries Dictionary Generator Generate persistent dictionary for parsed headers 1 per process Restructure CINT to be object-oriented, with focus on thread-safety, ease of maintenance, speed; consider requirements of dependent projects (ROOT I/O, GUI, PyROOT, CINT users) Reflex::Type Generic type description: enclosing scope; can be built as sequence of pointer, const, reference,…; can have bases if it’s a class, can convert to a Reflex::Scope if it’s a class, struct, or union; functions also have a type, e.g. parameters, return type, constness Reflex::Scope Generic scope description: enclosing scope; can convert to a Reflex::Type if it’s a class, struct, or union; allows access to enclosed scopes, types, members Reflex::Member Describe data and function members; iterate through them, get their types, for functions: access list of parameters, get the return type Simple interface: everything is types, scopes, and/or member Consistent navigation: by name, iteration, direct access Very small API objects: just a pointer (scope: +int), no virtual funcs Hide complex back-end implementation that will allow unloading, persistency, dynamic updates, forward declarations, etc. Type tC("char"); Type tCC = ConstBuilder(tC); Type tPCC = PointerBuilder(tCC); tCC == tPCC.ToType(); // true tC.TypeType(); // FUNDAMENTAL Get Reflex::Type representing a char, build const char*. ToType() returns the underlying type, TypeType() the kind of type – char is a fundamental type. Type tI("ROOT::Math::Integrator"); Scope sRM = tI.DeclaringScope(); tI.IsClass(); tI.IsPointer(); tI.IsConst(); // true,false,false tI.Name(SCOPED); // "ROOT::Math::Integrator" A class is a type, too: look it up by name, get its enclosing scope "ROOT::Math", test its properties, get its name including scopes. Scope sRMI("ROOT::Math::Integrator"); Type tRMI = sRMI; Type_Iterator iSubType = sRMI.DeclaringScope().SubType_Begin(); Type tSubType = sRMI.SubTypeByName("Integrator"); tSubType == tRMI; // true Scope sR = Scope::ByName("ROOT"); Scope::GlobalScope().ByName("ROOT") == sR // true Find a scope by name, as it's a class we can convert it to a type. Access types defined within a scope by iterator or name. Compare two representations of the same type, access a type from the global scope. Scope sNamed("TNamed"); Member mName = sNamed.DataMemberByName("fName"); Member_Iterator iMember = sNamed.Member_Begin(); Type tName = sNamed.GetType(); tName == Type::ByName("TString"); // true Retrieve a scope's data member by name and iterator, get a member's type. Member mSetTitle = sNamed.FunctionMemberByName("SetTitle"); Member iMember = sNamed.FunctionMemberAt(0); Type t = mSetTitle.GetType(); // (void TNamed::*)(const char*) int numparams = mSetTitle.FunctionParameterSize(); // 1 mSetTitle.FunctionParameterDefaultAt(0); // "" Get member function SetTitle(const char* t="") by name, get a function member by direct access. Member functions have a type, too. Query parameters and their default values.