Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/network/model/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ Node::GetId (void) const
return m_id;
}

Time
Node::GetLocalTime(void) const
{
NS_LOG_FUNCTION (this);
return Simulator::Now();
}

uint32_t
Node::GetSystemId (void) const
{
Expand Down
11 changes: 11 additions & 0 deletions src/network/model/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace ns3 {
class Application;
class Packet;
class Address;
class Time;


/**
Expand Down Expand Up @@ -77,6 +78,16 @@ class Node : public Object
*/
uint32_t GetId (void) const;

/**
* In the future, ns3 nodes may have clock that returned a local time
* different from the virtual time Simulator::Now().
* This function is currently a placeholder to ease the development of this feature.
* For now, it is only an alias to Simulator::Now()
*
* \return The time as seen by this node
*/
Time GetLocalTime(void) const;

/**
* \returns the system id for parallel simulations associated
* to this node.
Expand Down