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

BxUnionCase Class Reference

Class storing a single case selection option for the union data type. More...

#include <BxUnionCase.h>

Inheritance diagram for BxUnionCase:

BxObject List of all members.

Public Member Functions

 BxUnionCase ()
 BxUnionCase (BxDataObject *discriminant)
 BxUnionCase (BxDataObject *discriminant, BxDataObject *arm)
 BxUnionCase (const BxUnionCase &copy)
void setDiscriminant (BxDataObject *dis)
void setArm (BxDataObject *arm)
bool isEqual (const BxDataObject &dataObj) const

Detailed Description

A union case is a single case selection option in a BinX union type definition. A union case object stores:
The methods getDiscriminant() and getArm() should be used to access the values pertinent for the union case.
Since: BinX version 1.0.


Constructor & Destructor Documentation

BxUnionCase::BxUnionCase  ) 
 

Default constructor.

Constructs an instance of the class BxUnionCase. All attributes are initialised to NULL.

BxUnionCase::BxUnionCase BxDataObject discriminant  ) 
 

Construct a BxUnionCase object referencing a specified discriminant object.

Upon completion of this method, the input BxDataObject object containing the discriminate data type and value is tightly related to this union case object. Destruction of the BxDataObject instance will be managed by the union case object.

Parameters:
discriminant A pionter to a BxDataObject instance containing the union discriminate.

BxUnionCase::BxUnionCase BxDataObject discriminant,
BxDataObject arm
 

Construct a BxUnionCase object referencing a specified discriminant object and data object.

Upon completion of this method, dstruction of both input objects will be managed by this union case object.

Parameters:
discriminant A pointer to a BxDataObject instance containing the discriminant.
arm A pointer to a BxDataObject instance for the data object.

BxUnionCase::BxUnionCase const BxUnionCase copy  ) 
 

Construct a union case object by copying another union case object.

Attributes of the new union case instance are initialized by copying attribute values from the specified input union case. Upon completion of the construction operation, the two union case instances are independent. They must be individually destructed.

Parameters:
copy The BxUnionCase instance whose attribute values are to be copied.


Member Function Documentation

BxDataObject* BxUnionCase::getArm  )  const [inline]
 

Returns the data object selected by the discriminant value for this union case.

BxDataObject* BxUnionCase::getDiscriminant  )  const [inline]
 

Returns the discriminant value for this union case.

bool BxUnionCase::isEqual const BxDataObject dataObj  )  const
 

Compare a specified BxDataObject for equality with the discriminant value stored in this union case object.

In this method, two objects are considered to be equal if they are of the same BinX object type and if they store the same data value.
Note: that byte order differences are not compensated for in this test. Hence, two integers that are equal in value, but represented in different byte orders would be found to be unequal.

Parameters:
dataObj A reference to the data object to be compared with this object.
Returns:
true If the data type and value of the two objects are equal,
false If the objects differ in type or value.

void BxUnionCase::setArm BxDataObject arm  ) 
 

Set the data object stored by a union case object.

The input object must specify a union selected data object and its data type. If the data object has been previously set, then the old data object is destructed. The new data object is managed by this union case object.

Parameters:
arm Apointer to the BxDataObject instance containing the union selected data object.

void BxUnionCase::setDiscriminant BxDataObject dis  ) 
 

Set the discriminant value stored by a union case object.

The input object must specify a discriminant value and its data type. If the discriminant value has been previously set, then the old discriminate value object is destructed. The new discriminant value object is managed by this union case object.

Parameters:
dis A pointer to the BxDataObject instance containing the discriminant.


The documentation for this class was generated from the following files:
Generated on Fri May 6 13:36:19 2005 for edikt::BinX by doxygen 1.3.3