VectorInt.VectorInt Constructor

Overload List

#SignatureDescription
1VectorInt(TVecInt Src)Uses TVecInt object as internal storage.
2VectorInt(Boolean FromObjectCache)Constructor of the record.
3VectorInt(Int32 ALength)Constructor of the record.
4VectorInt(Int32 ALength, TIntPrecision aPrecision)Internally creates TVecInt object without using object cache.

Overload 1: VectorInt(TVecInt Src)

Uses TVecInt object as internal storage.

#NameTypeDescription
1SrcTVecIntsource TVecInt

Result: stored in self (calling object)

Remarks:

The resulting Vector will own Src object of TVecInt type and will release it once Vector gets out of scope.

Overload 2: VectorInt(Boolean FromObjectCache)

Constructor of the record.

#NameTypeDescription
1FromObjectCacheBoolean

Result: stored in self (calling object)

Remarks:

Returns a Vector with internal TVecInt object created from object cache (CreateIt), if FromObjectCache is True. Pass false to the constructor or do not call it at all, if the variable is a local variable. Object cache has limited size.

Overload 3: VectorInt(Int32 ALength)

Constructor of the record.

#NameTypeDescription
1ALengthInt32

Result: stored in self (calling object)

Remarks:

Returns a Vector with internal TVecInt object created explicitely with Length property set to aLength and IntPrecision property set to int32. Call this constructor, if the Vector type variable is a global variable with a long life span.

Examples
VectorInt a;
VectorInt b;
TVecInt bvec;
a = VectorInt.Create(true); //create from object cache via CreateIt

//this constructor can be omitted, because it is implicitly called
//the first time that the variable is used.
//However:

b = VectorInt.Create(10);

//Similar to

bvec = TVecInt.Create;
try
    {
        bvec.Size(10);
    }
finally
    {
        bvec.Free;  //b is freed on the exit from the procedure
    }
See Also: TMtxVecInt.IsEqual

Overload 4: VectorInt(Int32 ALength, TIntPrecision aPrecision)

Internally creates TVecInt object without using object cache.

#NameTypeDescription
1ALengthInt32
2aPrecisionTIntPrecision

Result: stored in self (calling object)

Remarks:

Creates TVecInt object without using object cache. Suitable for declaring global variables.