Protocol Communication in C++

Ownership Diagram

Dialog has a Callback
Callback is instantiated with a weak reference to a CallbackCompletionDelegate

Communication Diagram

class RoutesDialogueResponseDelegate {
    virtual void received(std::string response) = 0;
};

class RoutesDialogueResponse:: RoutesDialogueResponseDelegate {

    Callback::Callback(boost::weak_ptr< RoutesDialogueResponseDelegate >) {};
    boost::weak_ptr< RoutesDialogueResponseDelegate > m_delegate;

    //DialogResponse delegate responsibilities
    void received(std::string response {
       std::string responseString << "Dialogue Response:" << response;
       m_routesDialogResponseDelegate.received(responseString);
    }
};



class RoutesDialog: public RoutesDialogueResponseDelegate {
 
    RoutesDialog:: RoutesDialog(boost::weak_ptr< RoutesDialogDelegate >) {};
    boost::weak_ptr<RoutesDialogueDelegate> delegate;

    void RoutesDialog::start() {
        RoutesDialogReponse routesDialogueResponse(weak_ptr<shared_from_this()>;
        //Send the Dialogue Response out with npProtocol
    }
};


class RoutesDialogDelegate {
    virtual bool () = 0;
};

Class Gateway:: RoutesDialogDelegate {
   Gateway::Gateway(argc, argv[]) {};

   void receive(SoapRequest soapRequest) {
       RoutesDialog routesDialog( weak_ptr<shared_from_this()> );
       routesDialog.start();
   };

   //RoutesDialogDelegate Responsibilities
   
};

int main() {
    
    Gateway gateway();  //is a DialogDelegate via protocol
    
    SoapRequest soapRequest(command); //Add, Delete, Fetch

    gateway.receive(soapRequest); //Consider it handled
};