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: |
/** |