Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > function pointe...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 43282 of 48020
Post > Topic >>

function pointer problem

by alessio211734 <alessio211734@[EMAIL PROTECTED] > Feb 13, 2008 at 04:11 AM

I have a singleton class Modem

namespace Proxy
{

Modem
{
....
static Modem* Instance();

Intf::ModemAlarmStatusRespMsg *GetAlarmStatusRespMsg(){return
&m_alarmStatusResp;}

....

}

};

class BaseModemAlarm:public 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-
>GetAlarmStatusRespMsg();
   Alarm_OlBitePll.funcField=&(msg->GetOlBitePllAlarm);

};

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.
 




 1 Posts in Topic:
function pointer problem
alessio211734 <alessio  2008-02-13 04:11:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 8:43:07 CDT 2008.