Class: TPropertyFor

Declaration: Property.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TProperty

Inherited By:

None.

Purpose:

TPropertyFor is a derived class of TProperty class which provides protocol for dealing with values of type AType. AType can be any of the portable primitive types or any class type which has the following public functions: AType (); AType (const AType& copy); HashResult Hash () const; bool operator ==(const AType& right) const; TStream& operator >>=(TStream& toWhere) const; TStream& operator <<= (TStream& fromWhere); The primitive types supported are: signed char signed short signed long unsigned char unsigned short unsigned long double float

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is not intended to be derived from.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TPropertyFor::TPropertyFor

  1. TPropertyFor (const TPropertyIDFor < AType > & id)
  2. TPropertyFor (const TPropertyName & name, TPropertyID :: EValueFilter filter =TPropertyID :: kMonomorphicValues)
  3. TPropertyFor (const TPropertyIDFor < AType > & id, const AType & value)
  4. TPropertyFor (const TPropertyName & name, const AType & value, TPropertyID :: EValueFilter filter =TPropertyID :: kMonomorphicValues)
  5. TPropertyFor (const TPropertyFor < AType > & copy)
  6. TPropertyFor (const TProperty & right)
  7. TPropertyFor ()

Interface Category:

API

Purpose:

  1. Constructs a property with the specified ID and an invalid value.
  2. Constructs a property with the specified name and an invalid value. Constructs the ID from the name.
  3. Constructs a property with the specified ID and value.
  4. Constructs a property with the specified name and value. Constructs the ID from the name.
  5. Constructs a property with the content of the argument.
  6. Determines if the type of its argument is equivalent to the type of this object, and if so, constructs a property with the content of the argument.
  7. Default constructor.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.
  5. Call this function directly.
  6. Call this function directly.
  7. Called by the stream-in operators and to create an instance to assign to.

Parameters:

Return Value:

None.

Exceptions:

  1. Throws no exceptions, passes all exceptions through.
  2. Throws TTypeMismatch when the argument cannot be converted to TPropertyFor < AType >.
  3. Throws no exceptions, passes all exceptions through.
  4. Throws no exceptions, passes all exceptions through.
  5. Throws no exceptions, passes all exceptions through.
  6. Throws no exceptions, passes all exceptions through.
  7. Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPropertyFor::operator=

  1. TPropertyFor < AType > & operator =(const TPropertyFor < AType > & right)
  2. TPropertyFor < AType > & operator =(const TProperty & right)

Interface Category:

API.

Purpose:

  1. Assigns the contents of the argument to this object.
  2. Determines if the type of its argument is equivalent to the type of this object, and if so, assigns the contents of the argument to this object.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

  1. Throws no exceptions, passes all exceptions through.
  2. Throws TTypeMismatch when the argument cannot be converted to TPropertyFor < AType >.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPropertyFor::~TPropertyFor

~ TPropertyFor ()

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: TPropertyFor::GetID

TPropertyIDFor < AType > GetID () const

Interface Category:

API.

Purpose:

Returns the property identifier.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The identifier of this property.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPropertyFor::CopyValue

AType * CopyValue () const

Interface Category:

API.

Purpose:

Returns a copy of the property value.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A copy of the property value.

Exceptions:

Throws TInvalidValue if no value exists.

Concurrency:

Not multithread safe.

Other Considerations:

Use this function, rather than GetValue, when you want to allow polymorphism.

Member Function: TPropertyFor::operatorTPropertyIDFor<AType>

operator TPropertyIDFor < AType > () const

Interface Category:

API.

Purpose:

Extracts the identifier from this property. This is a conversion operator that allows this object to be passed to functions which take a TPropertyIDFor < AType >.

Calling Context:

Called implicitly by the compiler whenever this object is passed to a function which takes a TPropertyIDFor < AType >. Called explicitly when this object is cast to a TPropertyIDFor < AType >.

Parameters:

Return Value:

A reference to an instance of TPropertyIDFor < AType > const.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPropertyFor::operator!=

  1. bool operator != (const TPropertyIDFor < AType > & right) const
  2. bool operator != (const TPropertyFor < AType > & right) const

Interface Category:

API.

Purpose:

  1. Determines if the id contained in this property is equal to its argument.
  2. Determines if this property is equal to its argument.

Calling Context:

  1. Called to test the equivalence of two objects.
  2. Called to test the equivalence of two objects.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None

Member Function: TPropertyFor::operator==

  1. bool operator ==(const TPropertyIDFor < AType > & right) const
  2. bool operator ==(const TPropertyFor < AType > & right) const

Interface Category:

API.

Purpose:

  1. Determines if the id contained in this property is not equal to its argument.
  2. Determines if this property is not equal to its argument.

Calling Context:

  1. Called to test the equivalence of two objects.
  2. Called to test the equivalence of two objects.

Parameters:

Return Value:

Returns true if the objects are not equal.

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.