c_cpp AMS_API.cpp

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp AMS_API.cpp相关的知识,希望对你有一定的参考价值。

namespace AMS {
    class IService {
    public:
    
        // Create or just return a singleton instance
        static IService& instance();
        // Destroy the singleton instance
        static void destroy();

        // Create a messaging domain restricted for communication
        void create_domain(std::string domainName, std::string selfDesc);

        // Create a subscriber for T-typed messages
        template<typename T>
        void create_subscriber();

        // Create a publisher for T-typed messages
        template<typename T>
        void create_publisher();

        // Subscribe a handler to T-typed messages dispatched automatically
        template<typename T>
        void subscribe(IHandler& handler);

        // Unsubscribe from receiving T-typed messages
        template<typename T>
        void unsubscribe();

        // Send a message to all subscribers
        void send_message(IMsgObj& obj);

        // Start/stop the reactor for the communication
        void reactor_start();
        void reactor_stop();

        // Register a notifier for peer status updates within the domain
        void register_discovery(IPeerNotification* notifier);

        // Return the host ip address
        std::string get_host_ip() const;

        // Return the service logger
        Poco::Logger& logger() { return *m_consoleLogger; }        

        // Run service in debug mode
        void debug_mode() { m_consoleLogger->setLevel("debug"); }
    };    
} //namespace AMS

以上是关于c_cpp AMS_API.cpp的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 200.岛屿数量

c_cpp 127.单词阶梯

c_cpp MOFSET

c_cpp MOFSET

c_cpp 31.下一个排列

c_cpp string→char *