All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
command-interest-preparer.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_COMMAND_INTEREST_PREPARER_HPP
24 #define NDN_COMMAND_INTEREST_PREPARER_HPP
25 
26 #include "../interest.hpp"
27 
28 namespace ndn {
29 
40 public:
45 
54  void
56  (Interest& interest,
58 
64  void
65  setNowOffsetMilliseconds_(Milliseconds nowOffsetMilliseconds)
66  {
67  nowOffsetMilliseconds_ = nowOffsetMilliseconds;
68  }
69 
70 private:
71  MillisecondsSince1970 lastUsedTimestamp_;
72  Milliseconds nowOffsetMilliseconds_;
73 };
74 
75 }
76 
77 #endif
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
A CommandInterestPreparer keeps track of a timestamp and prepares a command interest by adding a time...
Definition: command-interest-preparer.hpp:39
void setNowOffsetMilliseconds_(Milliseconds nowOffsetMilliseconds)
Set the offset for when prepareCommandInterestName() gets the current time, which should only be used...
Definition: command-interest-preparer.hpp:65
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
CommandInterestPreparer()
Create a CommandInterestPreparer and initialize the timestamp to now.
Definition: command-interest-preparer.cpp:33
static WireFormat * getDefaultWireFormat()
Return the default WireFormat used by default encoding and decoding methods which was set with setDef...
Definition: wire-format.cpp:34
Definition: wire-format.hpp:39
void prepareCommandInterestName(Interest &interest, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Append a timestamp component and a random nonce component to interest's name.
Definition: command-interest-preparer.cpp:40