The From Clause

The from clause is a special SIDL statement that allows an implementor of multiple interfaces to add or rename the extensions of conflicting methods from interfaces. However, only method extensions can be changed, and the methods must have different signatures. For example, one can change the name of conflicting methods from two interfaces:


interface A {
  void set(in int i);
}
interface B{
  void set(in float i);
}
class C implements A, B {
  void set[Int](in int i) from A.set;
  void set[Float](in float i) from B.set;
}

Or change the name of an interface method that conflicts with your inherited class methods:


interface A {
  void set(in int i);
}
class B {
  void set(in float i);
}
class C extends B implements A  {
  void set[Int](in int i) from A.set;
  void set(in float i); //Cannot use the from clause on class methods
}

But it doesn't work for methods that have the same signature:


/* X THIS WILL NOT COMPILE X */

interface A {
  void set(in int i);
}
interface B{
  void set(in int i);
}
class C implements A, B {
  void set[A](in int i) from A.set; //ERROR
  void set[B](in int i) from B.set; //signature conflict
}

/* X THIS WILL NOT COMPILE X */





babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov