Tbits (unit classes)

Source: Internet
Author: User
Tags int size numeric

Tbits is used to hold an array of Boolean values.

Class Relationship TObject

Using Tbits, you can save and access an indeterminate value for a Boolean value. Tbits can save as many Boolean values as available memory can, and automatically expand its storage space when needed. If a Boolean value has a proficiency limit of 32, it can be accomplished by using the same functions as bitwise and (and) and or (or) operations on an integer variable.

Property List

Bits provides variable access to a sensitive group of Boolean numeric values represented by an object

Size represents the number of Boolean values that a Tbits object can have

Method List

~tbits deletes an instance of a Tbits object

Openbit returns the subscript of the first false value

Tbits Create a Tbits object

Detailed description

Property:

Tbits::bits

__property bool Bits[int Index] = {Read=getbit,write=setbit};

Provides a variable access to an array of Boolean numeric values represented by a Tbits object.

Using the Bits property, you can read out or set a special Boolean value with the index argument as the subscript. If the index parameter is not at the expense of 0 to Size-1 range, a Ebitserror exception is generated.

Tbits:; Size

__property int Size = {Read=fsize,write=setsize,nodefault};

Represents the number of Boolean values that the Tbits object can hold.

Set the Size property to enlarge or decrease the number of array values. When the array size is enlarged, the new item value is false. When the size of the array is reduced, the subscript less than or equal to the new array size is saved, and the item value that is larger than the new array size is lost.

Method

Tbits::~tbits

__fastcall virtual ~tbits (void);

Deletes an instance of the Tbits object.

Instead of calling ~tbits directly in your application, you should call delete. ~tbits frees the memory used to hold a Boolean array of values.

Tbits::openbit

int __fastcall openbit (void);

Returns the subscript for the first false value.

Using the Openbit function, you can find the first position in the array that is not set to true.

Tbits::tbits

__fastcall virtual tbits (void);

Creates a new Tbits object.

Do not call the Tbits constructor. Use new to create an indirect reference to a newly constructed tbits instance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.