Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(197)

Unified Diff: src/core/model/object-base.h

Issue 342870043: Visual Studio conditional code for core module (Closed)
Patch Set: Updates to resolve review comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/model/object.h ('k') | src/core/model/object-factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/model/object-base.h
===================================================================
--- a/src/core/model/object-base.h
+++ b/src/core/model/object-base.h
@@ -25,6 +25,11 @@
#include <string>
#include <list>
+#include "ns3/ns3-module.h"
+#define NS3_MODULE NS3_CORE_MODULE
+#include "ns3/ns3-export.h"
+
+
/**
* \file
* \ingroup object
@@ -64,6 +69,26 @@
* If the template class is in a namespace, then the macro call should also be
* in the namespace.
*/
+#ifdef _WIN32
+#define NS_OBJECT_TEMPLATE_CLASS_DEFINE_LIB(type,param,lib) \
+ template class lib type<param>; \
+ template <> lib std::string DoGetTypeParamName<type<param> > () \
+ { \
+ return #param; \
+ } \
+ static struct Object ## type ## param ## Registrationclass \
+ { \
+ Object ## type ## param ## Registrationclass () { \
+ ns3::TypeId tid = type<param>::GetTypeId (); \
+ tid.SetSize (sizeof (type<param>)); \
+ tid.GetParent (); \
+ } \
+ } Object ## type ## param ## RegistrationVariable
+#else
+#define NS_OBJECT_TEMPLATE_CLASS_DEFINE_LIB(type,param,lib) \
+ NS_OBJECT_TEMPLATE_CLASS_DEFINE(type,param)
+#endif
+
#define NS_OBJECT_TEMPLATE_CLASS_DEFINE(type,param) \
template class type<param>; \
template <> std::string DoGetTypeParamName<type<param> > () \
@@ -116,7 +141,7 @@
* - A way to associate an ns3::TypeId to each object instance.
* - A way to set and get the attributes registered in the ns3::TypeId.
*/
-class ObjectBase
+class NS3_EXPORT ObjectBase
{
public:
/**
« no previous file with comments | « src/core/model/object.h ('k') | src/core/model/object-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b