FREEDM DGI
Messages.hpp
Go to the documentation of this file.
1 
23 #ifndef MESSAGES_HPP
24 #define MESSAGES_HPP
25 
26 #include "messages/ModuleMessage.pb.h"
27 
28 #include <memory>
29 
30 #include <boost/date_time/posix_time/posix_time_types.hpp>
31 #include <google/protobuf/message.h>
32 
33 namespace freedm {
34 namespace broker {
35 
36 class ProtocolMessage;
37 class ProtocolMessageWindow;
38 
40 google::protobuf::uint64 ComputeMessageHash(const ModuleMessage& msg);
41 
43 bool MessageIsExpired(const ProtocolMessage& msg);
44 
46 void SetExpirationTimeFromNow(ProtocolMessage& msg, const boost::posix_time::time_duration& expires_in);
47 
49 void StampMessageSendtime(ProtocolMessageWindow& msg);
50 
51 } // namespace broker
52 } // namespace freedm
53 
54 #endif // MESSAGES_HPP
void StampMessageSendtime(ProtocolMessageWindow &msg)
Sets the message&#39;s timestamp to the current time.
Definition: Messages.cpp:101
bool MessageIsExpired(const ProtocolMessage &msg)
Determines whether the message has expired.
Definition: Messages.cpp:66
google::protobuf::uint64 ComputeMessageHash(const ModuleMessage &msg)
Hash a message.
Definition: Messages.cpp:51
General FREEDM Namespace.
Definition: CBroker.cpp:53
void SetExpirationTimeFromNow(ProtocolMessage &msg, const boost::posix_time::time_duration &expires_in)
Set the expiration time for this message.
Definition: Messages.cpp:85