Reference Counted Touchables Design

Slides:



Advertisements
Similar presentations
Investigating Learner Autonomy in a Virtual EFL Classroom Jo Mynard Research in ELT Conference Bangkok, April 2003 This presentation will probably involve.
Advertisements

Process for changing “C-based” design to SHARC assembler ADDITIONAL EXAMPLE M. R. Smith, Electrical and Computer Engineering University of Calgary, Canada.
Generation of highly parallel code for TigerSHARC processors An introduction This presentation will probably involve audience discussion, which will create.
Project Status Group B-4 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these.
Combining Informal and Tangible Interfaces for Early Stages of Web Site Design Raecine Sapien Mentor: Mark Newman Professor: Dr. James Landay This presentation.
Template class Wrapper { public: T* operator->() { return &myT; } private: T myT; }; int main() { Wrapper wThing; wThing- >Foo(); // calls Thing::Foo()...
1 Verifying Architecture Jaein Jeong Johnathon Jamison This presentation will probably involve audience discussion, which will create action items. Use.
More C++ Classes Systems Programming. Systems Programming: C++ Classes 2 Systems Programming: 2 C++ Classes  Preprocessor Wrapper  Time Class Case Study.
Hospital Management System A complete solution for Hospital Services and Activity This presentation will probably involve audience discussion, which will.
Object Based Programming. Summary Slide  Instantiating An Object  Encapsulation  Inheritance  Polymorphism –Overriding Methods –Overloading vs. Overriding.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
More C++ Classes Systems Programming. C++ Classes  Preprocessor Wrapper  Time Class Case Study –Two versions (old and new)  Class Scope and Assessing.
Mid Term Report Integrated Framework, Visualization and Analysis of Platforms This presentation will probably involve audience discussion, which will create.
Object Oriented Software Development
Evening High School Ms. Baisden Intro to Computers Intro to Word Processing Typing This presentation will probably involve audience discussion, which will.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
CSC 532 Term Paper Topic decision: 10/10/02 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
Orchard-Maler Assertion Proposal SAML F2F #3 David Orchard, Eve Maler This presentation will probably involve audience discussion, which will create action.
CMSC 202, Version 3/02 1 Copy Constructors and Overloaded Assignment.
Chapter 5 Introduction to Defining Classes
THE BOOK BANK MAKERERE UNIVERSITY LIBRARY This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to.
How abstract components are returned when schema.getElementDeclarations() is called – an animation in 3 slides -- schemas that use and July 26, :00pm.
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.
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
Project Status [Project Name] [Presenter Name] This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
IRRI - Genetic Resources Information Management System (GRIMS) This presentation will probably involve audience discussion, which will create action items.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
1 LoTAG conference – 11 th May 2015 LoHEG - London Highway Engineering Group Update Co-chair – Dale Foden/Ian Hawthorn This presentation.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
A Kalman Filter for HADES
Bond-Jini Interoperability Mathew Lowery
Week 2, Day 1: The Factory Method Pattern
Continuous Random Variables
Introduction to Triggers
C++ Memory Management Idioms
Microsoft Access Illustrated
Einstein’s Special and General Theories of Relativity.
Pretest Chapter 17 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these.
Intent (Thanks to Jim Fawcett for the slides)
Tuesday, February 20, 2018 Announcements… For Today… 4+ For Next Time…
Final Project Presentation
Martha Grabowski LeMoyne College
واشوقاه إلى رمضان مرحباً رمضان
by Manish Shah & Eugene Park CSPP 523 Jan.21, 2002
Evaluation of Data Fusion Methods Using Kalman Filtering and TBM
Continuous Random Variables
Dartmouth College Status Report
AN INTRODUCTION TO: POWERPOINT.
Lesson 7 Plan a Presentation
Patterns.
IEEE Rail Transit Vehicle Interface Standards Committee
Interactive Visual System
Fiber Based Synchronous Timing System
Test Flow: Acceptance & defect criteria The First half RUP summary
PH Chapter 3 Thanks for the Memory Leaks Pushme-Pullyu (pp
Final Presentation Wireless mouse over BLUETOOTH By: David Gabay
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Operator overloading Dr. Bhargavi Goswami
Lesson 7 Plan a Presentation
* From AMD 1996 Publication #18522 Revision E
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
* L. E. Turner and M. R. Smith, University of Calgary, Alberta, Canada
Tonga Institute of Higher Education
Minnesota Counties Computer Consortium(MCCC) Community Registry
G4 Workshop 2002 Detector Description Parallel Session
Jim Fawcett CSE687 – Object Oriented Design Spring 2014
Presenting Project Status
More C++ Classes Systems Programming.
四時讀書樂 (春) ~ 翁森 山光照檻水繞廊,舞雩歸詠春風香。 好鳥枝頭亦朋友,落花水面皆文章。 蹉跎莫遣韶光老,人生唯有讀書好。
Introduction to Classes and Objects
Presentation transcript:

Reference Counted Touchables Design This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during your presentation In Slide Show, click on the right mouse button Select “Meeting Minder” Select the “Action Items” tab Type in action items as they come up Click OK to dismiss this box This will automatically create an Action Item slide at the end of your presentation with your points entered. Reference Counted Touchables Design Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Motivation Use case Transportation creates touchables as a track propagates across volumes User actions get pointers to the touchables allowing to access their data Problem Transportation uses two touchables in the flip-flop way for pre-step and post-step points. Pointers passed to user actions become invalid after each step so the touchables must be copied Using touchable pointers implies explicit memory management in a user code and is error prone 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Requirements Touchables must become “persistent” remain valid after each step (during one run) Simpler (automatic) memory management no user action is required to create or delete them The existing interface should be preserved if possible 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Affected classes and categories G4VTouchable and its derivates G4GRSSolid, G4GRSVolume, G4TouchableHistory G4Navigator G4TransportationManager G4SteppingManager, G4Track, G4Step User actions Parametrization and ReadOut Geometry May be others... 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Possibilities Handle-Body design pattern G4NavigationLevel already implemented this way Smart-pointer idiom In both cases the use of pointers must go away Passing by pointer to an object provides no way to trigger proper reference counting unless the users are forced to follow the rule of adding and removing object reference counts by hand Microsoft (COM), Gaudi (Interfaces and Services) Both ways imply the clients keep or manipulate the counted objects only using their handles 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Prototype implementation The hybrid of auto_ptr (STL) with reference counting ability A templated class G4ReferenceCountedHandle is introduced Essentially a wrapping class emulating dumb pointers basically any object can be made reference countable Automagically deletes the object when object’s count is zero Implements copy constructor, assignment, dereferencing Supports conversions to the type of the counted object Can’t be created by new or deleted by calling delete Must be passed always by reference(&) or copy Multiple handles share one instance of counted object Does not support exclusive ownership an object behind the pointer can be modified 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Design - Class Diagram 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Design - Class Diagram 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Radovan Chytracek CERN IT/API Geant4 Possible extensions Hide the operators new() and delete() an attempt to dynamically create or delete is detected at compile time Implementation using G4Allocator and related classes, if needed, to make it faster Alternative implementation of client classes smart-pointers not used directly as a reference counting handle client wrapper classes(handle) hold the smart-pointer to their implementation classes(body) 25 February 2019 Radovan Chytracek CERN IT/API Geant4

Alternative Implementation class Handle { private: SmartPointer<Body> fCountableBody; }; 25 February 2019 Radovan Chytracek CERN IT/API Geant4