INET Framework for OMNeT++/OMNEST
inet::AccessModuleWrap< T > Class Template Reference

Finds and returns the pointer to a module of type T. More...

#include <FindModule.h>

Public Types

typedef T wrapType
 

Public Member Functions

 AccessModuleWrap ()
 
virtual ~AccessModuleWrap ()
 
Tget (cModule *const from=nullptr)
 

Private Member Functions

 AccessModuleWrap (const AccessModuleWrap< T > &)
 Copy constructor is not allowed. More...
 
AccessModuleWrap< T > & operator= (const AccessModuleWrap< T > &)
 Assignment operator is not allowed. More...
 

Private Attributes

TpModule
 

Detailed Description

template<typename T = cModule>
class inet::AccessModuleWrap< T >

Finds and returns the pointer to a module of type T.

Uses FindModule<>::findSubModule(), FindModule<>::findHost(). See usage e.g. at ConnectionManagerAccess.

Member Typedef Documentation

template<typename T = cModule>
typedef T inet::AccessModuleWrap< T >::wrapType

Constructor & Destructor Documentation

template<typename T = cModule>
inet::AccessModuleWrap< T >::AccessModuleWrap ( const AccessModuleWrap< T > &  )
private

Copy constructor is not allowed.

template<typename T = cModule>
inet::AccessModuleWrap< T >::AccessModuleWrap ( )
inline
103  :
104  pModule(nullptr)
105  {
106  }
T * pModule
Definition: FindModule.h:94
template<typename T = cModule>
virtual inet::AccessModuleWrap< T >::~AccessModuleWrap ( )
inlinevirtual
109  {
110  }

Member Function Documentation

template<typename T = cModule>
T* inet::AccessModuleWrap< T >::get ( cModule *const  from = nullptr)
inline
115  {
116  if (!pModule) {
118  FindModule<>::findHost(from != nullptr ? from : getSimulation()->getContextModule()));
119  }
120  return pModule;
121  }
static cModule * findHost(cModule *m)
Returns a pointer to the host module of the passed module.
Definition: FindModule.h:57
static T findSubModule(const cModule *const top)
Returns a pointer to a sub module of the passed module with the type of this template.
Definition: FindModule.h:24
T * pModule
Definition: FindModule.h:94
template<typename T = cModule>
AccessModuleWrap<T>& inet::AccessModuleWrap< T >::operator= ( const AccessModuleWrap< T > &  )
private

Assignment operator is not allowed.

Member Data Documentation

template<typename T = cModule>
T* inet::AccessModuleWrap< T >::pModule
private

The documentation for this class was generated from the following file: