4S Device Communication Module Collection  Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
msgsenderbase.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 The 4S Foundation (www.4s-online.dk)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
31 #ifndef MSGSENDERBASE_H
32 #define MSGSENDERBASE_H
33 
34 #include "handle.h"
35 #include "msgaddr.h"
36 
37 #include <memory>
38 
39 namespace FSYS
40 {
41 
42  class BaseMsg;
43 
51  class MsgSenderBase : virtual Handle
52  {
53  private:
67  std::shared_ptr<BaseMsg> &fillOutSenderInfo(std::shared_ptr<BaseMsg> &msg,
68  MsgAddr sender);
69 
70  public:
84  void broadcast(std::shared_ptr<BaseMsg> &msg,
85  const std::type_info &typeOfMsg,
86  const MsgAddr &sender);
87 
102  void send(std::shared_ptr<BaseMsg> &msg,
103  const std::type_info &typeOfMsg,
104  const FSYS::MsgAddr &sender,
105  const MsgAddr &destination);
106  };
107 }
108 
109 #endif // MSGSENDERBASE_H
Contains interface for a message address.
Class that holds and assigns handles.
Definition: handle.h:55
Type neutral message sender class.
Definition: msgsenderbase.h:51
Contains interface declaration for the FSYS::Handle class.
Definition: basemsg.h:38
void send(std::shared_ptr< BaseMsg > &msg, const std::type_info &typeOfMsg, const FSYS::MsgAddr &sender, const MsgAddr &destination)
Type independent respond function.
Definition: msgsenderbase.cpp:61
std::shared_ptr< BaseMsg > & fillOutSenderInfo(std::shared_ptr< BaseMsg > &msg, MsgAddr sender)
Function that fills out info about the sender of the message.
Definition: msgsenderbase.cpp:41
void broadcast(std::shared_ptr< BaseMsg > &msg, const std::type_info &typeOfMsg, const MsgAddr &sender)
Broadcast function, to broadcast messages.
Definition: msgsenderbase.cpp:53
The MsgAddr class contains a unique address in the message system.
Definition: msgaddr.h:52