#pragma once ///////////////////////////////////////////////////////////////////// // IComm.h - interface for message-passing communication facility // // ver 1.1 // // Jim Fawcett, CSE687-OnLine Object Oriented Design, Fall 2017 // ///////////////////////////////////////////////////////////////////// /* * Interface for MsgPassingComm::Comm. * * Required Files: * --------------- * IComm.h * * Maintenance History: * -------------------- * ver 1.1 : 14 Oct 2018 * - changed factory function to return a std::shared_ptr * instead of a pointer to IComm. * ver 1.0 : 27 Mar 2018 * - first release */ #include #include #include "../Message/Message.h" namespace MsgPassingCommunication { class IComm; using SPtrIComm = std::shared_ptr; struct Context; class IComm { public: static SPtrIComm create(const std::string& machineAddress, size_t port); virtual Context* getContext() = 0; virtual std::string setSendFilePath(const std::string& relPath) = 0; virtual std::string setSaveFilePath(const std::string& relPath) = 0; virtual std::string getSendFilePath() = 0; virtual std::string getSaveFilePath() = 0; virtual void start() = 0; virtual void stop() = 0; virtual void postMessage(Message msg) = 0; virtual Message getMessage() = 0; virtual std::string name() = 0; virtual ~IComm() {} }; }