RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: Local and protected declaration
Prev Next
You are not authorized to post a reply.

Author Messages
PoojaUser is Offline

Posts:4

11/06/2009 5:18 AM  

A variable defined local in a class cannot be seen/accessed by sub-classes ,while the variable declared as 'protected' can be
inherited by the sub-classes.

We use protected keyword for declaring the main_t method of the driver ,as the sub-classes may modify it but this
method encapsulates the main functionality of the driver an hence must not be tampered with from other classes.

Similarly a variable such as parity or a switch which determines the data length or interpacket size,must not be tampered and yet can be modified by sub-classes.

On a similar note what properties/methods must be declared local.Can i get some examples?

Regards,
Pooja Vaishnav


If attitude could kill ,i can be a weapon of mass destruction :)
You are not authorized to post a reply.
Forums > General Discussion > Main Discussion Area > Local and protected declaration



ActiveForums 3.7
  

 Copyright 2008 by SystemVerilog User Group Contact Us    Privacy Statement