Update README and add contrib dir
This commit is contained in:
65
contrib/tsn/model/transmission-gate.cc
Normal file
65
contrib/tsn/model/transmission-gate.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
#include "transmission-gate.h"
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/packet.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("TransmissionGate");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED(TransmissionGate);
|
||||
|
||||
TypeId
|
||||
TransmissionGate::GetTypeId()
|
||||
{
|
||||
static TypeId tid =
|
||||
TypeId("ns3::TransmissionGate")
|
||||
.SetParent<Object>()
|
||||
.SetGroupName("Tsn")
|
||||
.AddConstructor<TransmissionGate>();
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TransmissionGate::TransmissionGate()
|
||||
{
|
||||
NS_LOG_FUNCTION(this);
|
||||
m_state = OPEN;
|
||||
}
|
||||
|
||||
TransmissionGate::~TransmissionGate()
|
||||
{
|
||||
NS_LOG_FUNCTION(this);
|
||||
}
|
||||
|
||||
bool
|
||||
TransmissionGate::IsOpen()
|
||||
{
|
||||
NS_LOG_FUNCTION(this);
|
||||
if(m_state == OPEN)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TransmissionGate::Open()
|
||||
{
|
||||
m_state = OPEN;
|
||||
}
|
||||
|
||||
void
|
||||
TransmissionGate::Close()
|
||||
{
|
||||
m_state = CLOSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user