msg.inline.h 905 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef AFUN_MSG_INLINE_H
  2. #define AFUN_MSG_INLINE_H
  3. #include "msg.h"
  4. namespace aFuncore {
  5. inline Message::Message(const std::string &type_) : type {type_}, next {nullptr} {
  6. }
  7. inline TopMessage::TopMessage(const std::string &type_) : Message(type_) {
  8. }
  9. inline NormalMessage::NormalMessage(Object *obj_) : TopMessage("NORMAL"), obj {obj_} {
  10. }
  11. inline Object *NormalMessage::getObject() {
  12. return obj;
  13. }
  14. inline std::string ErrorMessage::getErrorType() {
  15. return error_type;
  16. }
  17. inline std::string ErrorMessage::getErrorInfo() {
  18. return error_info;
  19. }
  20. inline InterMessage::InterMessage() : MessageStream() { // NOLINT mutex通过pthread_mutex_init初始化
  21. pthread_mutex_init(&mutex, nullptr);
  22. }
  23. inline InterMessage::~InterMessage(){
  24. pthread_mutex_destroy(&mutex);
  25. }
  26. }
  27. #endif //AFUN_MSG_INLINE_H