Proposed Changes of the DDS Dynamic Data interface based on the consideration of EPICS PVData and Google’s Protocol Buffers Nikolay Malitsky 1.

Slides:



Advertisements
Similar presentations
Chapter 21 Implementing lists: array implementation.
Advertisements

Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
Chapter 8: Arrays.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
C Language.
Primitives, References and Wrappers Java has the following types defined as part of the java language; int float double byte char boolean long short These.
Pointers Prasun Dewan Comp 114.
Copyright 2010 by Pearson Education Building Java Programs Chapter 7 Lecture 7-2: Arrays as Parameters reading: , 3.3 self-checks: Ch. 7 #5, 8,
Arrays and ArrayLists Ananda Gunawardena. Introduction Array is a useful and powerful aggregate data structure presence in modern programming languages.
6/10/2015C++ for Java Programmers1 Pointers and References Timothy Budd.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Programming Languages and Paradigms Object-Oriented Programming (Part II)
6. More on Pointers 14 th September IIT Kanpur C Course, Programming club, Fall
5-Aug-2002cse Arrays © 2002 University of Washington1 Arrays CSE 142, Summer 2002 Computer Programming 1
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
Lecturer : Sakuni Sellapperuma. Introduction An array is a container object that holds a fixed number of values of a single type. The length of an array.
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
Integrating netCDF and OPeNDAP (The DrNO Project) Dr. Dennis Heimbigner Unidata Go-ESSP Workshop Seattle, WA, Sept
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
Types in Java 8 Primitive Types –byte, short, int, long –float, double –boolean –Char Also some Object types: e.g. “String” But only single items. What.
Chapter overview This chapter focuses on Array declaration and use Bounds checking and capacity Arrays storing object references Variable length parameter.
Computer Organization and Design Pointers, Arrays and Strings in C Montek Singh Sep 18, 2015 Lab 5 supplement.
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
1 11/30/05CS150 Introduction to Computer Science 1 Structs.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Java Programming Language Lecture27- An Introduction.
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
The C++ Data Types Fundamental Data Types
Computer Organization and Design Pointers, Arrays and Strings in C
Chapter 6 – Data Types CSCE 343.
Arrays Low level collections.
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Lecture 5 D&D Chapter 6 Arrays and ArrayLists Date.
Array, Strings and Vectors
Chapter 6: Data Types Lectures # 10.
Instructor : Ahmed Alalawi Slides from Chung –Ta King
Introduction to Computing Using Java
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
CS150 Introduction to Computer Science 1
C Basics.
C# Programming Arrays in C# Declaring Arrays of Different Types Initializing Array Accessing Array Elements Creating User Interfaces Using Windows Standards.
Java Arrays. Array Object An array :a container object holds a fixed number of values of a single type. The length of an array is established when the.
Register Use Policy Conventions
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Advanced Programming Behnam Hatami Fall 2017.
14th September IIT Kanpur
Data.
Unit-2 Objects and Classes
Programming in Java Lecture 11: ArrayList
نوع داده هاي انتزاعي Abstract Data Types
An Introduction to Java – Part I, language basics
Comp 401 Metamorphosis: Casting vs. Conversion
Arrays of Objects Fall 2012 CS2302: Programming Principles.
EKT150 : Computer Programming
Arrays and Pointers Reference: Chapter , 4.11 CMSC 202.
Arrays of Objects Fall 2012 CS2302: Programming Principles.
Can store many of the same kind of data together
Sridhar Narayan Java Basics Sridhar Narayan
Arrays .
Multidimensional Arrays
Arrays.
ArrayLists 22-Feb-19.
Intro to Data Structures and ADTs
Arrays in Java.
Chapter 6 Part 1.
Java: Variables, Input and Arrays
Subtype Substitution Principle
Arrays.
Lecture 7: Types (Revised based on the Tucker’s slides) 10/4/2019
Presentation transcript:

Proposed Changes of the DDS Dynamic Data interface based on the consideration of EPICS PVData and Google’s Protocol Buffers Nikolay Malitsky 1

Rationale Interface Example with a primitive variable Example with a variable-size sequence Example with a structure

Rationale Two issues and their solutions: 1. In-out arguments for accessing the primitive values This issue is addressed by the recent revised submission of Java 5 Language PSM for DDS, August 2010. It replaced the in-out arguments with the return values. 2. 250+ methods Replace three alternative sets of methods (value-by-name, value-by-id, and value-at-index) with a single set value-by-id and one method get-id-by-name. Reuse methods and consider arguments in the context of the particular type, for example, ‘int getUint32ValueAtIndexOverflow ‘ in Java 5 Language PSM for DDS can be represented by ‘int getInt32ValueAtIndex’. Replace the different set-sequence and set-array methods with two generic methods: copySubCollection(in unsigned int id, in unsigned int offset, in DynamicData src, in unsigned int srcOffset, in unsigned int length) implementing the value semantics and setComplexValue(in unsigned int id, in DynamicData src) implementing the reference semantics.

Dynamic Data Interface (in Java) – 1 of 3 DynamicType getType(); // ------------------------------------------------------------------------------------------------------------- // methods used in the context of aggregation data types and associative collection int getId(String name); boolean hasValue(String name); void clearValue(String name); // ----------------------------------------------------------------------------------------------------------- // method used in the context of collections and aggregation data types // Returns a number of collection elements, members, dimensions of multi-dimensional arrays, etc. int getLength(); // methods used in the context of variable-size sequences void setBound(int bound); void setLength(int length);

Dynamic Data Interface (in Java) – 2 of 3 // ------------------------------------------------------------------------------------------------------------- // setters and getters of primitive values: Boolean, Byte, Char8, Char32, // Int16, UInt16, Int32, UInt32, Int64, UInt64, Float32, Float64, Float128 … int getInt32Value(int id); float getFloat32Value(int id); double getFloat64Value(int id); void setInt32Value(int id, int value); void setFloat32Value(int id, float value); void setFloat64Value(int id, double value); // setters and getters of string and wstring String getString(int id); void setString(int id, String value);

Dynamic Data Interface (in Java) – 3 of 3 // ------------------------------------------------------------------------------------------------------------- // setters and getters of other types: fixed-size multi-dimensional arrays, // variable-size single-dimensional sequences, structures, etc. DynamicData getComplexValue(int id); void setComplexValue(int id, DynamicData value); // methods implementing the value semantics void copySubCollection(int id, int offset, DynamicData src, int srcOffset, int length); DynamicData cloneSubCollection(int id, int offset, int length); void copyComplexValue(int id, DynamicData value); DynamicData cloneComplexValue(int id); void copy(DynamicData value); DynamicData clone();

Example with a primitive variable DynamicData doubleData = factory.createData(doubleType); int id = 0; // or any integer // setting a value doubleData.setFloat64Value(id, 1.0); // getting a value double doubleValue = doubleData.getFloat64Value(id);

Example with a variable-size sequence DynamicData doubleSeq = factory.createData(doubleSeqType); doubleSeq.setBound(10); // accessing elements (without boundary checking)‏ double doubleValue = 0; for(int i = 0; i < 5; i++){ doubleSeq.setFloat64Value(i, 1.0*i); doubleValue = doubleSeq.getFloat64Value(i); } doubleSeq.setLength(5); // copying (or merging ) a sequence DynamicData anotherSeq = factory.createData(doubleSeqType); int id = 0; // or any integer anotherSeq.copySubCollection(id, 0, doubleSeq, 0, doubleSeq.getLength());

Example with a structure DynamicData sample = factory.createData(NameDoublesType); int nameId = sample.getId(“name”); int doublesId = sample.getId(“doubles”); // accessing members String name = sample.getStringValue(nameId); DynamicData doubles = sample.getComplexValue(doublesId); // setting values … // copying a structure DynamicData anotherSample= factory.createData(NameDoublesType); anotherSample.copy(sample); struct NameDoubles { string name; sequence<double> doubles; }