Indy 9 | Content | Index | Reference

TIdThreadSafeString
Hierarchy, Properties, Methods, See Also, Unit: IdThreadSafe
Implements a thread-safe String data type.

    TIdThreadSafeString = class(TIdThreadSafe)

Unit
IdThreadSafe
Description
TIdThreadSafeString is a TIdThreadSafe descendant that implements a thread-safe data type for storing a String value. TIdThreadSafeString relies on the inherited TCriticalSection for resource protection in multi-threaded applications. TIdThreadSafeString implements the Value property for reading and writing the String value associated with the class instance with resource protection. TIdThreadSafeString also implements methods that protect write access to Value using Append and Prepend.

TIdThreadSafeString.Value
TIdThreadSafeString, See Also
Reads or Writes the value for the thread-safe data type.

    property Value: string;

Description
Value is a String property that represents the value for the thread-safe String data type. Read and write access to the content of Value uses the resource protection capabilities of the object instance to insure reliable access in multi-threaded applications.

TIdThreadSafeString.Append
TIdThreadSafeString, See Also
Concatenates characters to the end of the thread-safe data type.

    procedure Append(const AValue: string);

Parameters
const AValue: string
characters to be added to the end of the value.
Description
Append is a procedure used to concatenate the characters in AValue to the end of the thread-safe String data type. Append calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated value for the data type. Append calls Unlock to disable resource protection when the value is successfully updated, or an exception is raised.

Use Prepend to insert a sequence of characters at the beginning of the thread-safe data type.

TIdThreadSafeString.Prepend
TIdThreadSafeString, See Also
Inserts characters at the beginning of the thread-safe data type.

    procedure Prepend(const AValue: string);

Parameters
const AValue: string
characters to be inserted in the the data type.
Description
Prepend is a procedure used to insert the sequence of characters in AValue at the beginning of the thread-safe String data type. Prepend calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated value for the data type. Prepend calls Unlock to disable resource protection when the value is successfully updated, or an exception is raised.

Use Append to add a sequence of characters at the end of the thread-safe data type.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.