smsServer.h
Go to the documentation of this file.
1 
4 #pragma once
5 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwServer.h"
6 #include "include/smsSourceList.h"
7 #include "smsProto.pb.h"
8 
9 #ifdef TESTING
10 #include "gtest/gtest.h"
11 #endif
12 
18 class SmsServer: public DpyMwServer
19 {
20 private:
21  SmsSourceList mSmsSourceList;
23  std::map<dpySms::SmsNotifications, smsProto::SmsEvent_SmsEventType> mNotificationtoProtomap;
24  std::map<dpySms::SmsDirection, smsProto::InfoElement::Dir> mSmsDirectionToProtomap;
25 
26  void RegisterCallbacks();
27  void RegisterPublications();
28  int checkDeleteStoredSms(std::map<int, dpyModem::s_SMSInfo> sms_map);
29  smsProto::SmsInfo buildSmsInfoMessage(boost::system::error_code &ec, const std::string &smsid, const dpySms::SmsInformation &info);
30 public:
31  void smsNotificationsPublisher(boost::system::error_code ec, const dpySms::SmsNotifications &notification, const std::string &sms_id, const std::string &sms_source);
32  SmsServer(boost::asio::io_service &io, int rport, int pport);
33  virtual ~SmsServer();
34  void sendSourceStatusEvent(std::string sourceid, dpySms::SourceStatus new_status);
35 
36 #ifndef TESTING
37  void sendSmsSourcesResponse(const std::string &id_dealer, const std::string &msg, int id);
38  void sendSmsInfoResponse(const std::string &id_dealer, const std::string &msg, int id);
39  void sendAllSmsResponse(const std::string &id_dealer, const std::string &msg, int id);
40  void sendDeleteSmsResponse(const std::string &id_dealer, const std::string &msg, int id);
41  void sendSourceListEvent(std::string smssourceid, dpySms::ListEvent event);
42  void sendSmsSourceStatusResponse(const std::string &id_dealer, __attribute__((unused))const std::string &msg, int id);
43  void sendSmsDispatchResponse(const std::string &id_dealer, const std::string &msg, int id);
44 
45 #else
46 public:
47  virtual void sendSmsSourcesResponse(const std::string &id_dealer, const std::string &msg, int id);
48  virtual void sendSourceListEvent(std::string smssourceid, dpySms::ListEvent event);
49  virtual void sendAllSmsResponse(const std::string &id_dealer, const std::string &msg, int id);
50  virtual void sendDeleteSmsResponse(const std::string &id_dealer, const std::string &msg, int id);
51  virtual void sendSmsInfoResponse(const std::string &id_dealer, const std::string &msg, int id);
52  virtual void sendSmsSourceStatusResponse(const std::string &id_dealer, __attribute__((unused))const std::string &msg, int id);
53  virtual void sendSmsDispatchResponse(const std::string &id_dealer, const std::string &msg, int id);
54 
55  FRIEND_TEST(Test_SMSServer,Test_checkDeleteStored_empty);
56  FRIEND_TEST(Test_SMSServer,Test_checkDeleteStored_10sms);
57 #endif //TESTING
58 
59 };
SourceStatus
Source Status.
Definition: iVoiceCallSource.h:18
Manages router and publisher.
Definition: smsServer.h:18
A class that keeps track of the sms sources and makes them available through the execution of the pro...
Definition: smsSourceList.h:16
Manages router and publisher.
Definition: dpyMwServer.h:44