BACI Properties Mount2 example

Slides:



Advertisements
Similar presentations
Engineering Problem Solving With C++ An Object Based Approach Additional Topics Chapter 10 Programming with Classes.
Advertisements

CLASS INHERITANCE Class inheritance is about inheriting/deriving properties from another class. When inheriting a class you are inheriting the attributes.
ESO - Tokyo July, 2005 ALMA Common Software Training- Course Session 1b Distributed Systems G.Chiozzi.
Chapter 12 Separate Compilation and Namespaces. Abstract Data Type (ADT) ADT: A data type consisting of data and their behavior. The abstraction is that.
Chapter 14 Inheritance Pages ( ) 1. Inheritance: ☼ Inheritance and composition are meaningful ways to relate two or more classes. ☼ Inheritance.
Factorial Preparatory Exercise #include using namespace std; double fact(double); int fact(int); int main(void) { const int n=20; ofstream my_file("results.txt");
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 5 Functions for All Subtasks.
INHERITANCE BASICS Reusability is achieved by INHERITANCE
Derived Classes. C++ 2 Outline  Definition  Virtual functions  Virtual base classes  Abstract classes. Pure virtual functions.
Tokyo July, 2005 Deployment of ACS components Bogdan Jeram European Southern Observatory.
Esempio Polimorfismo1 // Definition of abstract base class Shape #ifndef SHAPE_H #define SHAPE_H class Shape { public: virtual double area() const { return.
Rossella Lau Lecture 6, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 6: More on class construction UML and an.
C++ data types. Structs vs. Classes C++ Classes.
Templates CS-341 Dick Steflik. Reuse Templates allow us to get more mileage out of the classes we create by allowing the user to supply certain attributes.
ACS Workshop UCN BACI properties Atacama Large Millimeter Array Alessandro Caproni European Southern Observatory BACI properties.
Lecture 9 Concepts of Programming Languages
CSE 332: C++ Classes From Procedural to Object-oriented Programming Procedural programming –Functions have been the main focus so far Function parameters.
Classes in C++ Bryce Boe 2012/08/15 CS32, Summer 2012 B.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
The ALMA Common Software: a developer friendly CORBA-based framework G.Chiozzi d, B.Jeram a, H.Sommer a, A.Caproni e, M.Pesko bc, M.Sekoranja b, K.Zagar.
ALMA Control SW & ACS Ralph Marson (NRAO). ALMA Project ACS Course, June 22 – July , Garching, Germany Physical Layout of the M&C network.
Object-Oriented Programming in C++
Tokyo July, 2005 ACS Characteristic Components B. Jeram, …..
ALMA Common Software Basic Track Component implementation guidelines.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 24P. 1Winter Quarter C++ Lecture 24.
Garching January, 2007 Configuration Database and Deployment of ACS components Bogdan Jeram, changes by Heiko Sommer European Southern.
ACS Logging System APIs: C++ Bogdan Jeram European Southern Observatory July 2004NRAO.
ACS Error System APIs: C++ Bogdan Jeram European Southern Observatory July 2005ESO.
AtacamaLargeMillimeterArray ACS Training Developing Python Components.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures C++ Review Part-I.
ACS Component Simulator J. Ibsen European Southern Observatory Garching – January 2007ESO.
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
Running ACS Bogdan Jeram European Southern Observatory July 2005NAOJ.
11 Introduction to Object Oriented Programming (Continued) Cats.
Creational Pattern: Factory Method At times, a framework is needed to standardize the behavior of objects that are used in a range of applications, while.
Tokyo July, 2005 Introduction to ACE Bogdan Jeram European Southern Observatory.
1 More Operator Overloading Chapter Objectives You will be able to: Define and use an overloaded operator to output objects of your own classes.
NAOJ, Tokyo – July 04-08, 2005 ACS Configuration Database Bogdan Jeram European Southern Observatory.
ICALEPCS Archamp 08 – 09 October, 2005 ACS Configuration Database G.Chiozzi, B.Jeram European Southern Observatory.
AtacamaLargeMillimeterArray ACS Training Using the Python Error System.
C++ Classes C++ Interlude 1 Data Structures and Problem Solving with C++: Walls and Mirrors, Carrano and Henry, © 2013.
1 COMS 261 Computer Science I Title: Classes Date: November 4, 2005 Lecture Number: 27.
1 Data Structures CSCI 132, Spring 2014 Lecture 2 Classes and Abstract Data Types Read Ch Read Style Guide (see course webpage)
Interlude 1 C++ Classes CS Data Structures Mehmet H Gunes Modified from authors’ slides.
Intro. to Computer Programming Eng. Nehal A. Mohamed Spring Semester-2016.
Introduction to Object-oriented Programming
C++ Lesson 1.
Written by: Dr. JJ Shepherd
Chapter - 4 OOP with C# S. Nandagopalan.
Friday, January 26, 2018 Announcements… For Today… For Next Time…
C++ Classes C++ Interlude 1
Polymorphism Lec
Classes In C#.
Lecture 9 Concepts of Programming Languages
Chapter 5 Function Basics
Name: Rubaisha Rajpoot
CORBA Object-by-Value
Anatomy of a Function Part 1
COMS 261 Computer Science I
C++ Compilation Model C++ is a compiled language
Multiple Base Classes Inheritance
CMSC 341 C++ and OOP.
Overview Before You Start Structure of a Module Ports and Datatypes
Class rational part2.
CMSC 341 C++ and OOP.
C++ data types.
Copyright 1999 B.Ramamurthy
Classes and Objects Systems Programming.
Lecture 9 Concepts of Programming Languages
Presentation transcript:

BACI Properties Mount2 example Bogdan Jeram (bjeram@eso.org) European Southern Observatory July 2005 ESO

Properties in IDL properties are defined in baci.idl (we have to include it!) introduced in component interface as IDL readonly attributes component interface has to derive from: ACS::CharacteristicComponent ACS Course Tokyo, July 2005 Running ACS

Mount2 IDL http://websqa.hq.eso.org/bin/viewcvs.cgi/ACS/LGPL/CommonSoftware/acscourse/ws/idl/acscourseMount.idl?rev=HEAD&content-type=text/vnd.viewcvs-markup interface Mount2 : ACS::CharacteristicComponent { void objfix (in double az, in double elev); readonly attribute ACS::RWdouble cmdAz; readonly attribute ACS::RWdouble cmdEl; readonly attribute ACS::ROdouble actAz; readonly attribute ACS::ROdouble actEl; }; ACS Course Tokyo, July 2005 Running ACS

Properties in C++ Implemented in baci library header file per property type. Example: baciROdouble.h baciRWdouble.h baciROpattern.h ACS Course Tokyo, July 2005 Running ACS

Component header file http://websqa.hq.eso.org/bin/viewcvs.cgi/ACS/LGPL/CommonSoftware/acscourse/ws/include/acscourseMount2Impl.h?rev=HEAD&content-type=text/vnd.viewcvs-markup includes: #include <baciCharacteristicComponentImpl.h> header file for each property type Examples: #include <baciROdouble.h> #include <baciRWdouble.h> Namespace: baci (using namespace baci) ACS Course Tokyo, July 2005 Running ACS

Component header file Class implementation has to inherit: CharacteriticComponentImpl (common functionality) from idl generated skeleton: POA_ACSCOURSE_MOUNT::Mount1 constructor: with 2 parameters: Mount2Impl( const ACE_CString &name, maci::ContainerServices *containerServices); Member for each property. Examples: SmartPropertyPointer<RWdouble> m_cmdAz_sp; SmartPropertyPointer<ROdouble> m_actAz_sp; Accessor methods. Examples: ACS::RWdouble_ptr cmdEl () throw (CORBA::SystemException); ACS::ROdouble_ptr actAz () throw (CORBA::SystemException); ACS Course Tokyo, July 2005 Running ACS

Component Implementation http://websqa.hq.eso.org/bin/viewcvs.cgi/ACS/LGPL/CommonSoftware/acscourse/ws/src/acscourseMount2Impl.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup #include <acscourseMount2Impl.h> #include <iostream> using namespace std; Mount2Impl::Mount2Impl( const ACE_CString &_name, maci::ContainerServices *containerServices) : CharacteristicComponentImpl(_name, containerServices), m_cmdAz_sp(new RWdouble(_name+":cmdAz", getComponent()),this), m_cmdEl_sp(new RWdouble(_name+":cmdEl", getComponent()),this), m_actAz_sp(new ROdouble(_name+":actAz", getComponent()),this), m_actEl_sp(new ROdouble(_name+":actEl", getComponent()),this) { ACS_TRACE("::Mount2Impl::Mount2Impl"); } Mount2Impl::~Mount2Impl() { purposes ACS_TRACE("::Mount2Impl::~Mount2Impl"); ACS Course Tokyo, July 2005 Running ACS

Accessor methods implementation returns “property” ACS::RWdouble_ptr Mount2Impl::cmdAz () throw (CORBA::SystemException) { if (m_cmdAz_sp == 0) return ACS::RWdouble::_nil(); } ACS::RWdouble_var prop = ACS::RWdouble::_narrow(m_cmdAz_sp->getCORBAReference()); return prop._retn(); ACS Course Tokyo, July 2005 Running ACS

Functional methods implementation void Mount2Impl::objfix (CORBA::Double az, CORBA::Double elev) throw (CORBA::SystemException) { ACS_TRACE("::Mount2Impl::objfix"); unsigned long long timestamp; m_cmdAz_sp->getDevIO()->write(az, timestamp); m_cmdEl_sp->getDevIO()->write(elev, timestamp); ACS_SHORT_LOG((LM_INFO,"Received objfix command. Az: %f El: %f", az, elev)); } ACS Course Tokyo, July 2005 Running ACS