A
alessio211734
I have a singleton class Modem
namespace Proxy
{
Modem
{
....
static Modem* Instance();
Intf::ModemAlarmStatusRespMsg *GetAlarmStatusRespMsg(){return
&m_alarmStatusResp;}
....
}
};
class BaseModemAlarmublic BaseAlarm
{
public:
BaseModemAlarm(){};
BaseModemAlarm(const ut_int32 AlarmId){};
Intf::ModemOffOnEnum (*funcField)();
private:
//MemFunc funcField;
ut_int32 AlarmId;
// method
int GetRefValue(){return static_cast<int> (Intf::MOD_ON);};
int GetStatusValue(){ return static_cast<int> ( (*funcField)
() ); };
};
// in constructor of another class I would like build a instance of
BaseModemAlarm passing
a member function.
ModemAlarmHandler::ModemAlarmHandler()
{
BaseModemAlarm Alarm_OlBitePll(Intf::MODEM_OL_BITE_PLL_ALARM);
Intf::ModemAlarmStatusRespMsg * msg=Proxy::Modem::Instance-
};
I would like access to msg->GetOlBitePllAlarm() at runtime from
Alarm_OlBitePll instance.
I get a compiler error. I can't access directly to
ModemAlarmStatusRespMsg fields beacuse they are declare as private and
I can't modify the class definition.
I need to declare several different instance of BaseModemAlarm and for
every instance I should call a different method for msg object.
Please help me.
Ale.
namespace Proxy
{
Modem
{
....
static Modem* Instance();
Intf::ModemAlarmStatusRespMsg *GetAlarmStatusRespMsg(){return
&m_alarmStatusResp;}
....
}
};
class BaseModemAlarmublic BaseAlarm
{
public:
BaseModemAlarm(){};
BaseModemAlarm(const ut_int32 AlarmId){};
Intf::ModemOffOnEnum (*funcField)();
private:
//MemFunc funcField;
ut_int32 AlarmId;
// method
int GetRefValue(){return static_cast<int> (Intf::MOD_ON);};
int GetStatusValue(){ return static_cast<int> ( (*funcField)
() ); };
};
// in constructor of another class I would like build a instance of
BaseModemAlarm passing
a member function.
ModemAlarmHandler::ModemAlarmHandler()
{
BaseModemAlarm Alarm_OlBitePll(Intf::MODEM_OL_BITE_PLL_ALARM);
Intf::ModemAlarmStatusRespMsg * msg=Proxy::Modem::Instance-
Alarm_OlBitePll.funcField=&(msg->GetOlBitePllAlarm);GetAlarmStatusRespMsg();
};
I would like access to msg->GetOlBitePllAlarm() at runtime from
Alarm_OlBitePll instance.
I get a compiler error. I can't access directly to
ModemAlarmStatusRespMsg fields beacuse they are declare as private and
I can't modify the class definition.
I need to declare several different instance of BaseModemAlarm and for
every instance I should call a different method for msg object.
Please help me.
Ale.