---
name: "corelinux_Context"
section: "3"
platform: "linux"
package: "libcorelinux-dev"
version: "0.4.32-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/corelinux_Context"
---

# corelinux\_Context(3)

Context defines the interface to clients and maintains an instance of a State subclass.

## NAME

corelinux::Context - **Context** defines the interface to clients and maintains an instance of a **State** subclass.

## SYNOPSIS

`#include <Context.hpp>`

### Public Member Functions

**Context** (void)\
 *Default Constructor.*  **Context** (**ContextCref**)\
 *Copy Constructor.*  virtual **~Context** (void)\
 *Virtual Destructor.*  **ContextRef** **operator=** (**ContextCref**)\
 *Assignment operator overload.*  bool **operator==** (**ContextCref**) const \
 *Equality operator overload.*  virtual void **request** (void)  throw ( NullPointerException )\
 *Invoke a context request which is delegated to* **State***.*  virtual void **changeState** (**StatePtr**)\
 *Change the state of the context.*

### Protected Member Functions

**StatePtr** **getState** (void) const \
 *Retrieve the state instance.*  void **setState** (**StatePtr**)\
 *Set the state instance.*

## Detailed Description

**Context** defines the interface to clients and maintains an instance of a **State** subclass.

## Constructor & Destructor Documentation

### corelinux::Context::Context (ContextCref)

Copy Constructor. **Parameters:**

*Context* const reference

## Member Function Documentation

### ContextRef corelinux::Context::operator= (ContextCref)

Assignment operator overload. **Parameters:**

*Context* const reference

**Returns:**

**Context** reference to self

### bool corelinux::Context::operator== (ContextCref) const

Equality operator overload. **Parameters:**

*Context* const reference

**Returns:**

true if equal, false otherwise

## Author

Generated automatically by Doxygen for CoreLinux++ from the source code.
