cContextSwitcher Class Reference

API: cContextSwitcher Class Reference
API
cContextSwitcher Class Reference
Inheritance diagram for cContextSwitcher:
[legend]

Public Member Functions

 cContextSwitcher (const cComponent *newContext)
 ~cContextSwitcher ()
cComponentgetCallerContext () const

Description

The constructor switches the context to the given component, and the destructor restores the original context.

See also
cSimulation::getContextModule(), cSimulation::setContextModule()

Constructor & Destructor Documentation

◆ cContextSwitcher()

cContextSwitcher ( const cComponent * newContext)

Switches context to the given module

◆ ~cContextSwitcher()

Restores the original context

Member Function Documentation

◆ getCallerContext()

cComponent * getCallerContext ( ) const
inline

Returns the original context