core: Explicitly instantiate some Callback class and function templates
This commit is contained in:
committed by
Stefano Avallone
parent
25377f43ae
commit
67c81c737e
@@ -35,6 +35,10 @@
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
// Explicit instantiation declaration
|
||||
template Callback<ObjectBase*> MakeCallback<ObjectBase*>(ObjectBase* (*)());
|
||||
template Callback<ObjectBase*>::Callback();
|
||||
template class CallbackImpl<ObjectBase*>;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("ObjectBase");
|
||||
|
||||
|
||||
@@ -335,6 +335,15 @@ class ObjectBase
|
||||
const AttributeValue& value);
|
||||
};
|
||||
|
||||
// The following explicit template instantiation declarations prevent all the translation
|
||||
// units including this header file to implicitly instantiate the callbacks class and
|
||||
// function templates having ObjectBase as template type parameter that are required to be
|
||||
// instantiated more often (accorging to the ClangBuildAnalyzer tool).
|
||||
// These classes and functions are explicitly instantiated in object-base.cc
|
||||
extern template Callback<ObjectBase*> MakeCallback<ObjectBase*>(ObjectBase* (*)());
|
||||
extern template Callback<ObjectBase*>::Callback();
|
||||
extern template class CallbackImpl<ObjectBase*>;
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* OBJECT_BASE_H */
|
||||
|
||||
Reference in New Issue
Block a user