General type input of function

I have the following code in my test_base:

class test_base extends uvm_test;
   //factory registration
   `uvm_component_utils(test_base)
     
   //internal decleration
   girobo2_env grb_env_i;

   //configuration objects:
   grb2_env_config    m_env_cfg;
   axi_agent_config   m_axi_agent_cfg;

   .........

   //build_phase
    // Create tx_agent agent configuration object
    m_tx_agent_cfg = tx_agent_config::type_id::create("m_tx_agent_cfg");
    if(!uvm_config_db #(virtual tx_interface)::get(this, "", "tx_vif", m_tx_agent_cfg.tx_vif)) 
	 `uvm_error("RESOURCE_ERROR", "tx_interface virtual interface not found")
      m_env_cfg.m_tx_agent_cfg = m_tx_agent_cfg; 
      // Call function to configure the tx agent
      configure_tx_agent(m_tx_agent_cfg);
   //Create axi_agent agent configuration object
   m_axi_agent_cfg = axi_agent_config::type_id::create("m_axi_agent_cfg");
   if(!uvm_config_db #(virtual axi_interface)::get(this, "", "axi_vif", m_axi_agent_cfg.axi_vif) 
	`uvm_error("RESOURCE_ERROR", "axi_interface virtual interface not found")
   m_env_cfg.m_axi_agent_cfg = m_axi_agent_cfg; 
   // Call function to configure the axi  agent
   configure_axi_agent(m_axi_agent_cfg);


   //--------------------------------------------------------------------
	 // configure_tx_agent
   //--------------------------------------------------------------------
   // Convenience function to configure the agent
   // This can be overloaded by extensions to this base class
   virtual function void configure_tx_agent (tx_agent_config cfg);
      cfg.is_active = UVM_PASSIVE;	  
   endfunction: configure_tx_agent
    //--------------------------------------------------------------------
   // configure_my_agent
   //--------------------------------------------------------------------
   // Convenience function to configure the agent
   // This can be overloaded by extensions to this base class
   virtual function void configure_axi_agent (axi_agent_config cfg);
      cfg.is_active = UVM_PASSIVE;	  
   endfunction: configure_my_agent
	 

endclass: test_base

Instead of creating 2 function which do the same Is there an option to use general function named configure_my_agent and define the type of the input of the configure_my_agent function general (like template in c++ for example.

In reply to saritr:
The UVM factory provides a mechanism used for specifying type overrides that can also be used to check the type.

The static method
axi_agent_config::type_id::get_type()
returns a handle to a proxy singleton object that represents the type of
axi_agent_config
. You can call the virtual
uvm_object
method
get_cobject_type()
that returns a handle to a proxy singleton object that represents the type of the actual object passed to cfg. So you can write

if (axi_agent_config::type_id::get_type() == cfg.get_object_type() )
   // then you have a matching base class object
else if (axi_extended_agent_cdg::type_id::get_type() == cfg.get_object_type() )
   // then you have a matching extended object

In reply to dave_59:

I edited the question (not suer that your answer answers whst I wantes).
Please take a look.