Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Design Issue

19 views
Skip to first unread message

AY

unread,
Mar 20, 2012, 11:20:21 PM3/20/12
to
Hi,

I am required to create a class ( / library .. not decided yet ) which basically sits at a large client process ( lets call it - Client_Proc ) and receives command from the server ( a master process ).

What the receiver class has to do is this:

class MyReceiver
{
public:
MyReceiver ()
{
// Establish connection with server ( Master process )
}

virtual ~MyReceiver()

virtual int call_A() const = 0;
virtual int call_B() const = 0;
};

class CLIENT_PROC : public MyReceiver
{
public:
CLIENT_PROC ()
{
// Do something ..
}

int call_A() const
{
// do something here.
}

int call_B() const
{
// do something here.
}
};

The catch here is : 'MyReceiver class' has to get the commands ( Requests ) from the Master process ( Server ) and parse the message to call either 'call_A' fn or 'call_B' fn. This depends on the message received from Master process.And MyReciever has to respond back the status from CLIENT_PROC.

In short MyReceiver acts as a proxy for CLIENT_PROC to get commands from the server.

I am not sure what is the best way to do this.

Your inputs / reading reference are greatly appreciated.

Thanks in advance,
AY.

PS : I have posted this query in comp.lang.c++.moderated as well.
0 new messages