/* * ===================================================================================== * * Filename: defs.h * * Description: * * Version: 1.0 * Created: 2021年03月26日 19时26分17秒 * Revision: none * Compiler: gcc * * Author: Li Chao (), * Organization: * * ===================================================================================== */ #ifndef DEFS_KP8LKGD0 #define DEFS_KP8LKGD0 #include typedef uint64_t MQId; const MQId kBHDefaultSender = 99; const MQId kBHTopicCenter = 100; const MQId kBHTopicBus = 101; inline const MQId BHGlobalSenderAddress() { return kBHDefaultSender; } inline const MQId BHTopicCenterAddress() { return kBHTopicCenter; } inline const MQId BHTopicBusAddress() { return kBHTopicBus; } int64_t CalcAllocIndex(int64_t size); int64_t GetAllocSize(int index); const int kBHCenterPort = 24287; const char kTopicSep = '.'; namespace bhome_shm { class SharedMemory; } // namespace bhome_shm std::string BHomeShmName(); bhome_shm::SharedMemory &BHomeShm(); bool GlobalInit(bhome_shm::SharedMemory &shm); typedef std::string Topic; void SetLastError(const int ec, const std::string &msg); void GetLastError(int &ec, std::string &msg); //TODO center can check shm for previous crash. #endif // end of include guard: DEFS_KP8LKGD0