2
0

msg.inline.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 NormalMessage::NormalMessage(Object *obj_) : Message("NORMAL"), obj {obj_} {
  8. }
  9. inline NormalMessage::NormalMessage(NormalMessage &&msg) noexcept : Message("NORMAL"), obj {msg.obj}{
  10. msg.obj = nullptr;
  11. }
  12. inline Object *NormalMessage::getObject() {
  13. return obj;
  14. }
  15. inline ErrorMessage::ErrorMessage(ErrorMessage &&msg) noexcept
  16. : Message("ERROR"), error_type{std::move(msg.error_type)}, error_info{std::move(msg.error_info)},
  17. trackback{std::move(msg.trackback)}, inter{msg.inter}{
  18. }
  19. inline std::string ErrorMessage::getErrorType() const {
  20. return error_type;
  21. }
  22. inline std::string ErrorMessage::getErrorInfo() const {
  23. return error_info;
  24. }
  25. inline const std::list<ErrorMessage::TrackBack> &ErrorMessage::getTrackBack() const {
  26. return trackback;
  27. }
  28. }
  29. #endif //AFUN_MSG_INLINE_H