Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TCommandSet Class Reference

Implements a non-view class for handling command sets. More...

#include <views.h>

List of all members.

Public Methods

 TCommandSet ()
 TCommandSet (const TCommandSet &tc)
Boolean has (int cmd)
void disableCmd (int cmd)
void enableCmd (int cmd)
void operator+= (int cmd)
void operator-= (int cmd)
void disableCmd (const TCommandSet &tc)
void enableCmd (const TCommandSet &tc)
void operator+= (const TCommandSet &tc)
void operator-= (const TCommandSet &tc)
Boolean isEmpty ()
TCommandSet& operator &= (const TCommandSet &tc)
TCommandSet& operator|= (const TCommandSet &tc)

Friends

TCommandSet operator & (const TCommandSet &, const TCommandSet &)
TCommandSet operator| (const TCommandSet &, const TCommandSet &)
int operator== (const TCommandSet &tc1, const TCommandSet &tc2)
int operator!= (const TCommandSet &tc1, const TCommandSet &tc2)


Detailed Description

TCommandSet is a non-view class for handling command sets.

Member functions are provided for enabling and disabling commands and for testing for the presence of a given command. Several operators are overloaded to allow natural testing for equality and so on.

Note: this object can only handle commands whose code is within 0 and 255. Only commands in this range may be disabled.

Definition at line 584 of file views.h.


Constructor & Destructor Documentation

TCommandSet::TCommandSet ( )
 

Constructor.

Creates and clears a command set.

TCommandSet::TCommandSet ( const TCommandSet & tc )
 

Constructor.

This form creates a command set and initializes it from the `tc' argument.


Member Function Documentation

void TCommandSet::disableCmd ( const TCommandSet & tc )
 

Removes all commands in set `tc' from this command set.

void TCommandSet::disableCmd ( int cmd )
 

Removes command `cmd' from the set.

Referenced by operator-=().

void TCommandSet::enableCmd ( const TCommandSet & tc )
 

Adds all commands in set `tc' to this command set.

void TCommandSet::enableCmd ( int cmd )
 

Adds command `cmd' to the set.

Referenced by operator+=().

Boolean TCommandSet::has ( int cmd )
 

Returns True if command `cmd' is in the set.

Boolean TCommandSet::isEmpty ( )
 

Returns True if the command set is empty.

TCommandSet & TCommandSet::operator &= ( const TCommandSet & tc )
 

Calculates the intersection of this set and the `tc' set.

The resulting set is the largest set which contains commands present in both sets. Returns a reference to this object.

void TCommandSet::operator+= ( const TCommandSet & tc ) [inline]
 

Adds all commands in set `tc' to this command set.

Definition at line 709 of file views.h.

void TCommandSet::operator+= ( int cmd ) [inline]
 

Adds command `cmd' to the set.

Definition at line 699 of file views.h.

void TCommandSet::operator-= ( const TCommandSet & tc ) [inline]
 

Removes all commands in set `tc' from this command set.

Definition at line 714 of file views.h.

void TCommandSet::operator-= ( int cmd ) [inline]
 

Removes command `cmd' from the set.

Definition at line 704 of file views.h.

TCommandSet & TCommandSet::operator|= ( const TCommandSet & tc )
 

Calculates the union of this set and the `tc' set.

The resulting set is the smallest set which contains commands present in either sets. Returns a reference to this object.


Friends And Related Function Documentation

TCommandSet operator & ( const TCommandSet &,
const TCommandSet & ) [friend]
 

Calculates the intersection of this set and the `tc' set.

The resulting set is the largest set which contains commands present in both sets. Returns the resulting set.

int operator!= ( const TCommandSet & tc1,
const TCommandSet & tc2 ) [friend]
 

Returns 1 if the sets `tc1' and `tc2' are not equal.

Otherwise returns 0.

Definition at line 719 of file views.h.

int operator== ( const TCommandSet & tc1,
const TCommandSet & tc2 ) [friend]
 

Returns 1 if the sets `tc1' and `tc2' are equal.

Otherwise returns 0.

TCommandSet operator| ( const TCommandSet &,
const TCommandSet & ) [friend]
 

Calculates the union of this set and the `tc' set.

The resulting set is the smallest set which contains commands present in either sets. Returns the resulting set.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:22 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001