Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5066

Skill++ - create another class that is composed of two instances from another class

$
0
0

I've created a class that is supposed to represent a two-dimensional point. It is defined here:

 defclass( gf_2dPoint

   () ;superclass

   (

      (x

         @initarg x

         @reader getX

         @writer setX

      )

      (y

         @initarg y

         @reader getY

         @writer setY

      )

   )

) ; defclass

Then in my main procedure I instantiate two points like so:
   gf_Pt1 = makeInstance('gf_2dPoint ?x 0 ?y 3)
   gf_Pt2 = makeInstance('gf_2dPoint ?x 2 ?y 5)
 
I wanted to create another class, maybe called gf_line, whereby a gf_line instance could be created with the makeInstance and passing to gf_2dPoint objects.
 
Thanks for any insights.
By the way, I may just use a simpler procedure solution, but was a bit curious.
-Gary 

Viewing all articles
Browse latest Browse all 5066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>