Main Page Modules Class Hierarchy Compound List File List Compound Members

# cWatch Class Reference

`#include <cwatch.h>`

Inheritance diagram for cWatch::

List of all members.

## Public Methods

Constructors, destructor, assignment
| cWatch (const cWatch &vs)
| cWatch (const char *name, char &c)
| cWatch (const char *name, signed char &c)
| cWatch (const char *name, unsigned char &c)
| cWatch (const char *name, bool &b)
| cWatch (const char *name, int &i)
| cWatch (const char *name, unsigned int &i)
| cWatch (const char *name, long &l)
| cWatch (const char *name, unsigned long &l)
| cWatch (const char *name, double &d)
| cWatch (const char *name, const char *&s)
| cWatch (const char *name, const signed char *&s)
| cWatch (const char *name, const unsigned char *&s)
| cWatch (const char *name, const cObject *&o)
cWatch& | operator= (const cWatch &vs)
Redefined cObject member functions.
virtual cObject* | dup () const
virtual void | info (char *buf)
virtual void | writeContents (ostream &os)
Accessing the stored variable reference.
virtual void | printTo (char *s)
char | typeChar () const
void* | pointer () const

## Detailed Description

Shell for an ordinary char, int, long, double, char* or cObject* variable. Its purpose is to make variables visible in Tkenv.

Users rarely need to create cWatch objects directly, they rather use the WATCH() and LWATCH() macros.

## Constructor & Destructor Documentation

cWatch::cWatch ( | const cWatch & vs )

| Copy constructor.

cWatch::cWatch ( | const char * name,
| char & c )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| signed char & c )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| unsigned char & c )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| bool & b )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| int & i )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| unsigned int & i )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| long & l )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| unsigned long & l )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| double & d )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| const char *& s )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| const signed char *& s )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| const unsigned char *& s )`[inline]`

| Initialize the shell to hold the given variable.

cWatch::cWatch ( | const char * name,
| const cObject *& o )`[inline]`

| Initialize the shell to hold the given variable.

## Member Function Documentation

cObject * cWatch::dup ( | ) const`[inline, virtual]`

| Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject.

void cWatch::info ( | char * buf )`[virtual]`

| Produces a one-line information about the object. Output is like this: "int samples = 12 (12U, 0xC)" Reimplemented from cObject.

cWatch & cWatch::operator= ( | const cWatch & vs )`[inline]`

| Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details.

void * cWatch::pointer ( | ) const`[inline]`

| Returns pointer to the referenced variable.

void cWatch::printTo ( | char * s )`[virtual]`

| Does actual work for info() and writeContents(). The output looks like this: "int samples = 12 (12U, 0xC)".

char cWatch::typeChar ( | ) const`[inline]`

| Returns the type of the referenced variable. The return value is 'c','i','l','d','s','o' for char, int, long, double, string, cObject pointer, respectively.

void cWatch::writeContents ( | ostream & os )`[virtual]`

| Writes the value of the variable to the output stream. The output looks like this: "int samples = 12 (12U, 0xC)". Reimplemented from cObject.

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

- cwatch.h