Interface registering by itself?

Usually a testbench top, which instantiates actual interface also do uvm config db set interface too.
By any means is it possible, interface by itself set it’s object in uvm config db i.e.

interface intf;
typedef virtual intf vIf;

uvm_config_db#(vIf)::set(uvm_top, “*”, “intf”, this); // does this works?

endinterface

In reply to bhupesh.paliwal:

No, ‘this’ is reserved word representing an implicit argument to a class method.

There is no standard way of doing what you want, but some tools have implemented an upwards hierarchical reference, as in

  uvm_config_db#(vIf)::set(uvm_top, "*", "intf", intf);

See 0004300: Upward or 'this' reference to initialize a virtual interface - Accellera Mantis