1 / 12

Seal Dictionary

Seal Dictionary. Applications Area Internal Review 20 October 2003 Stefan Roiser / CERN. Motivation. The Architecture Blueprint RTAG proposes the use of object dictionaries for object streamers, object browsers, debuggers rapid prototyping applications (e.g. Python)

devin-orr
Télécharger la présentation

Seal Dictionary

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Seal Dictionary Applications Area Internal Review 20 October 2003 Stefan Roiser / CERN

  2. Motivation • The Architecture Blueprint RTAG proposes the use of object dictionaries for • object streamers, object browsers, debuggers • rapid prototyping applications (e.g. Python) • runtime discovery of interfaces • Modern languages provide reflection inherently • In C++ reflection is very limited (RTTI) • The basic C++ concepts shall be supported • e.g. inheritance, methods, data members, accessibility, templates Seal Dictionary

  3. Packages in Seal Dictionary • Reflection packages • DictionaryGenerator for producing sources • ReflectionBuilder, the loading interface • Reflection, the user API • Dictionary examples • CMS • ATLAS (not yet in cvs) • Standard Dictionaries • CLHEP: Random, Vector • STL: Vector, List, String • Dictionary: Reflection Seal Dictionary

  4. Overall View C++ Object • Build dictionary for C++ object Dictionary for C++ Object • Load information about the object into the reflection model Reflection System • Provide meta information about • the object to the user Client Seal Dictionary

  5. Reflection Model Class Diagram NamespaceBuilder ItemBuilder ClassBuilder FieldBuilder MethodBuilder ReflectionBuilder Item PropertyList Namespace Class Field Method Reflection Seal Dictionary

  6. Usage Example Class mc* = Class::forName(“Foo”); void* fooInst = mc->instantiate(); std::vector<Field*> fields = mc->fields(); std::string f0name = fields[0]->name(); std::string f0type = fields[0]->type()->name(); fields[0].set(fooInst, 4711); Method* m0meth = mc->method(“getBar”); int m0val = m0meth->invoke(fooInst); Seal Dictionary

  7. .xml GOD desc Parse C++ Header Files .xml selection file filter + extend .h gccxml .xml parser gendict header file lcgdict _dict.cpp make dict.so dictionary source dictionary library Example: lcgdict Foo.h –-select=FooSel.xml --deep –I/home/lcg/include Seal Dictionary

  8. How to build Dictionaries #include “Foo.h” class Foo_dict { public: Foo_dict(); }; Foo_dict::Foo_dict() { ClassBuilder(“Foo”,”desc of Foo”, typeid(Foo),sizeof(Foo)). addField(“bar”,”int”,”desc of bar”, OffsetOf(Foo,bar)). addMethod(“getBar”,“desc of getBar”, “int”, Foo_getBar). build(); } static Foo_dict inst; • Parse C++ header files • lcgdict • i.e. gccxml + python script • Other means • Derive from XML descriptions • LHCb approach • Write by hand • design was made with simple syntax in mind Seal Dictionary

  9. Who is using Dictionaries • POOL • DataService • Casting, type-checking and deleting of objects • StorageService • Provide meta-information of objects when writing • Instantiating objects when reading, type-checking • SEAL • PyLCGDict • Python gateway to dictionaries • PluginManager (work in progress) • Loading dictionaries into the application Seal Dictionary

  10. New Reflection Model Scope Namespace PropertyList Type Fundamental Function Array Reference Pointer TypeDef Class Enum Member Inheritance Reflection Seal Dictionary

  11. Outlook • Implementation of new model • Extending and creating new dictionaries on demand • eXtended Type Information (XTI) • Stroustrup approach • Still very preliminary, solution for far future • New language gateways • Java gateway under investigation Seal Dictionary

  12. Summary • Seal • Provides standard dictionaries (STL, CLHEP, …) • Provides python gateway (PyLCGDict) • Feasibility studies for ATLAS and CMS • PluginManager will load dictionaries • New model will be implemented soon • Pool • Has been using dictionary system from the beginning • LHCb • Will use dictionaries as well Seal Dictionary

More Related