Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::containers::sets Namespace

Routines to deal with SLAB allocated blocks of structures. Each slab has multiple elements of a type in it, and the blocks are tracked as a linked list. Each block also has a bitmask of allocated elements in the set. 

 

--------------------------------------------------------------------------- 

Set type 

Usage: 

typedef struct name_tag { } <name>; 

#define MAX<name>SPERSET 

DeclareSet( <name> ); 

Should alias GetFromset, DeleteFromSet, CountUsedInSet, GetLinearSetArray 

etc so that the type name is reflected there 

another good place where #define defining defines is good.

Name 
Description 
The following table lists functions in this documentation. 
The following table lists structs, records, enums in this documentation. 
The following table lists types in this documentation. 
The following table lists macros in this documentation. 
 
Name 
Description 
 
 
 
Count number of elements that are allocated in the set. 
 
 
 
Delete all allocated slabs. 
 
Marks a member in a set as usable. 
 
Returned the index of an item in a linear array returned from a set. 
 
Performs an iteration over each allocated set member. Calls the user provided callback routine with each element in the set. 
 
 
 
 
 
Converts a set into a copy of the objects in the set organized in a flat array. 
 
Gets the index of a member passed as a pointer. 
 
 
 
 
 
This function can check to see if a pointer is a valid element from a set. 
Name 
Description 
A macro for use by internal code that tests a whole set of bits for used. (32 bits, can check to see if any in 32 is free) 
A macro for use by internal code that marks a member of a set as available. 
CPP_ 
A macro which is used to emit code in C++ mode... 
 
 
Delete all allocated slabs. 
Marks a member in a set as usable. 
 
 
 
 
 
Gets the index of a member passed as a pointer. 
 
 
 
 
A macro for use by internal code that tests a member of a set as used. 
This function can check to see if a pointer is a valid element from a set. 
A macro for use by internal code that marks a member of a set as used. 
Hard coded 32 bit division for getting word index. (x>>5) 
Hard coded 32 bit division for getting bit index. (x & 0x1f) 
 
Name 
Description 
 
Generic sets are good for tracking lots of tiny structures.

They track slabs of X structures at a time. They allocate a slab of X structures with an array of X bits indicating whether a node is used or not. The structure overall has how many are used, so once full, a block can be quickly checked whether there is anything free. Then when checking a block that might have room, the availablility is checked 32 bits at a time, until a free spot is found.
Sets of 1024 members of x,y coordinates for example are good for this sort... more 
 
Generic sets are good for tracking lots of tiny structures.

They track slabs of X structures at a time. They allocate a slab of X structures with an array of X bits indicating whether a node is used or not. The structure overall has how many are used, so once full, a block can be quickly checked whether there is anything free. Then when checking a block that might have room, the availablility is checked 32 bits at a time, until a free spot is found.
Sets of 1024 members of x,y coordinates for example are good for this sort... more 
 
Generic sets are good for tracking lots of tiny structures.

They track slabs of X structures at a time. They allocate a slab of X structures with an array of X bits indicating whether a node is used or not. The structure overall has how many are used, so once full, a block can be quickly checked whether there is anything free. Then when checking a block that might have room, the availablility is checked 32 bits at a time, until a free spot is found.
Sets of 1024 members of x,y coordinates for example are good for this sort... more 
Name 
Description 
This is type sack::containers::sets::FAISCallback. 
This is type sack::containers::sets::FESMCallback. 
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!