Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
None.
Purpose:
This is a point class represented by unsigned long primitives. It has many of the same characteristics of TGPoint except that its fields are unsigned longs. It is mainly used for representing cardinals or physical entities, such as pages or grid locations, and where negative numbers do not have any meaning.
TULongPairs have simple math operators to combine, mix, or otherwise manipulate their value. They can be mixed with TGPoints or scalars. TULongPairs can be converted readily to and from TGPoints. When converting from TGPoints to TULongPairs, only the integer part of TGPoint fields is significant.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Clients should not derive from this class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TULongPair ()
- TULongPair (unsigned long x, unsigned long y)
- TULongPair (const TULongPair &)
- TULongPair (const TGPoint &)
Interface Category:
API.
Purpose:
- Default constructor. Constructs a TULongPair whose fields are valid but unknown.
- Construct point from individual components, x first, y second.
- Copy constructor.
- Takes the integer part of a TGPoint to form a TULongPair. It ignores any fractional part.
Calling Context:
- Called by the stream-in operators and clients who want defaulted values.
- Set point.
- Called to copy an object.
- Called to convert a TGPoint to a TULongPair.
Parameters:
- Takes no parameters.
- unsigned long x -The x-component value.
- unsigned long y -The y-component value.
- const TULongPair & -Another point to copy.
- const TGPoint & -Another TGPoint to copy integer parts from.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
~ TULongPair ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::Area
unsigned long Area () const
Interface Category:
API.
Purpose:
Calculates the total area encompassed by the point and the origin.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a count of the area enclosed by the point and the origin.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
If the x y field components of TULongPair are large, the resultant area can overflow, being too large to fit in an unsigned long. Clients should be aware that this can happen.
Member Function: TULongPair::operator-
- TULongPair operator -() const
- TULongPair operator -(const TULongPair & Src) const
Interface Category:
API.
Purpose:
- Subtracts two times the field value from each field. Causes numerical underflow.
- Performs a component-wise subtraction of the TULongPair point from this point.
Calling Context:
- Called in unary minus expressions.
- Called in difference expressions.
Parameters:
- Takes no parameters.
- const TULongPair & Src -The point being subtracted.
Return Value:
The TULongPair result of the unary operation or the subtraction.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator+
TULongPair operator + (const TULongPair & Src) const
Interface Category:
API.
Purpose:
Addition operator.
Calling Context:
Called in addition expressions.
Parameters:
Return Value:
The TULongPair result of the addition.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator*
TULongPair operator * (const TULongPair & Src) const
Interface Category:
API.
Purpose:
Does a component-wise multiplication of each field with each field of the source.
Calling Context:
Called in expressions containing multiplication with other TULongPairs.
Parameters:
- const TULongPair & Src -The point being multiplied.
Return Value:
The TULongPair result of the multiplication.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator/
TULongPair operator / (const TULongPair & Src) const
Interface Category:
API.
Purpose:
Does component-wise division of points.
Calling Context:
Called in division expressions.
Parameters:
Return Value:
The TULongPair result of the division.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator+=
TULongPair & operator += (const TULongPair & Src)
Interface Category:
API.
Purpose:
Component-wise addition to itself.
Calling Context:
Called in += expressions.
Parameters:
Return Value:
Returns itself as the result of the addition to itself.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator-=
TULongPair & operator -=(const TULongPair & Src)
Interface Category:
API.
Purpose:
Component-wise subtraction of itself.
Calling Context:
Called in -=expressions.
Parameters:
- const TULongPair & Src -The point being subtracted.
Return Value:
Returns itself as a result of the subtraction from itself.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator*=
TULongPair & operator *= (const TULongPair & Src)
Interface Category:
API.
Purpose:
Component-wise multiplication of itself.
Calling Context:
Called in *= expressions.
Parameters:
- const TULongPair & Src -The point being multiplied.
Return Value:
Returns itself as a result of the multiplication to itself.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator/=
TULongPair & operator /= (const TULongPair & Src)
Interface Category:
API.
Purpose:
Component-wise division of itself by input point.
Calling Context:
Called in /= expressions.
Parameters:
Return Value:
Returns itself as the result of the division into itself.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Arithmetic operations can cause underflow or overflow. There is no check.
Member Function: TULongPair::operator==
bool operator ==(const TULongPair & Src) const
Interface Category:
API.
Purpose:
Compares itself with input.
Calling Context:
Called to compare TULongPairs.
Parameters:
Return Value:
Returns true if the source is equal to this.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::operator!=
bool operator != (const TULongPair & Src) const
Interface Category:
API.
Purpose:
Compares itself with input, but returns the logical complement.
Calling Context:
Called to compare TULongPairs.
Parameters:
Return Value:
Returns true if the source is not equal to this.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::operator=
TULongPair & operator =(const TULongPair &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object. Returns itself as a result of the assignment.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::operatorTGPoint
operator TGPoint () const
Interface Category:
API.
Purpose:
Converts (or casts) a TGPoint to a TULongPair.
Calling Context:
Called by conversion or TGPoint casting operator.
Parameters:
Return Value:
Returns a TGPoint whose fields are the same values as itself.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::operator<<=
TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::operator>>=
TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TULongPair::Set
void Set (unsigned long x, unsigned long y)
Interface Category:
API.
Purpose:
Sets the point to be the x, y values of the input.
Calling Context:
Called to set fields to explicit values.
Parameters:
- unsigned long x -The value of the x-component.
- unsigned long y -The value of the y-component.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.