macros to ensure proper initialization
This commit is contained in:
@@ -24,6 +24,16 @@
|
||||
|
||||
#include "chunk.h"
|
||||
|
||||
#define NS_HEADER_ENSURE_REGISTERED(x) \
|
||||
namespace { \
|
||||
static class thisisaveryverylongclassname \
|
||||
{ \
|
||||
public: \
|
||||
thisisaveryverylongclassname () \
|
||||
{ uint32_t uid; uid = x::GetUid ();} \
|
||||
} g_thisisanotherveryveryverylongname; \
|
||||
}
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,6 +24,16 @@
|
||||
|
||||
#include "chunk.h"
|
||||
|
||||
#define NS_TRAILER_ENSURE_REGISTERED(x) \
|
||||
namespace { \
|
||||
static class thisisaveryverylongclassname \
|
||||
{ \
|
||||
public: \
|
||||
thisisaveryverylongclassname () \
|
||||
{ uint32_t uid; uid = x::GetUid ();} \
|
||||
} g_thisisanotherveryveryverylongname; \
|
||||
}
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "ns3/address-utils.h"
|
||||
#include "arp-header.h"
|
||||
|
||||
NS_HEADER_ENSURE_REGISTERED (ns3::ArpHeader);
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
uint32_t
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("Ipv4Header");
|
||||
|
||||
NS_HEADER_ENSURE_REGISTERED (ns3::Ipv4Header);
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
bool Ipv4Header::m_calcChecksum = false;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "udp-header.h"
|
||||
#include "ipv4-checksum.h"
|
||||
|
||||
NS_HEADER_ENSURE_REGISTERED (ns3::UdpHeader);
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
bool UdpHeader::m_calcChecksum = false;
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("EthernetHeader");
|
||||
|
||||
NS_HEADER_ENSURE_REGISTERED (ns3::EthernetHeader);
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
uint32_t
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("EthernetTrailer");
|
||||
|
||||
NS_TRAILER_ENSURE_REGISTERED (ns3::EthernetTrailer);
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
bool EthernetTrailer::m_calcFcs = false;
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "ns3/assert.h"
|
||||
#include <string>
|
||||
|
||||
NS_HEADER_ENSURE_REGISTERED (ns3::LlcSnapHeader);
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user