class SocketAcceptor
{
class ISocketAcceptor;
ISocketAcceptor* impl;
};
class Session
{
friend SocketAcceptor;
class ISession;
ISession* impl;
}
/* I want to...
ISocketAcceptor::start(void)
{
Session* session = new Session();
session->impl->doSomething();
// but ISession is not defined here
*/
Is there a way that I could access ISession from SocketAcceptor? The reason for this is to hide the last remaining implementation detail from the public interface of Session - the socket service that the sessions are attached to. What I want to avoid is having a Session constructor that takes the socket service as an argument.
Oh...and on a side note:
Is there a programmer's version of writer's block? Every time I set up a different API like this, do all of the testing, etc...I think of a new "better?" way of doing it and start over. Crumple up the old design and throw it in the trash...then get a blank sheet out and repeat the process. Right now my VS2010 directory has 5 different networking models in it :\