#include "segment.h"
Go to the source code of this file.
Classes | |
struct | _tuple |
Typedefs | |
typedef _tuple | Tuple |
Functions | |
void | tuple_Init (void *(*tuple_allocate)(size_t), void(*tuple_deallocate)(void *)) |
Initialize the tuple memory allocation routines. The defaults are the system malloc and free. If those are acceptable, use of this function is not necessary. | |
Tuple * | tuple_Create (Segment *seg, unsigned int ibegin, unsigned int iend) |
Create a tuple from its components:. | |
void | tuple_DeleteBorrowed (Tuple *tuple) |
Delete a borrowed tuple. | |
void | tuple_DeleteOwned (Tuple *tuple) |
Delete an owned tuple. | |
Tuple * | tuple_Copy (Tuple *tuple) |
Copy a tuple. | |
void | tuple_Print (Tuple *tuple) |
char * | tuple_SegElPtr (Tuple *tuple, unsigned int index) |
Get a pointer to the view-able piece of a segment. | |
Segment * | tuple_Seg (Tuple *tuple) |
Simple accessor function for the tuple's segment address. | |
unsigned int | tuple_Begin (Tuple *tuple) |
Simple accessor function for the tuple's begin index. | |
unsigned int | tuple_End (Tuple *tuple) |
Simple accessor function for the tuple's end index. | |
unsigned int | tuple_SetBegin (Tuple *tuple, unsigned int begin) |
unsigned int | tuple_SetEnd (Tuple *tuple, unsigned int end) |
unsigned int | tuple_Length (Tuple *tuple) |
Simple accessor function for the tuple's length. | |
unsigned int | tuple_ShiftBegin (Tuple *tuple, unsigned int N) |
Move the begin index to the right by N positions. The begin index is always moved even if N is larger than the sub-segment length. | |
unsigned int | tuple_ShiftEnd (Tuple *tuple, unsigned int N) |
Move the end index to the left by N positions. The end index is always moved even if N is larger than the sub-segment length. |
Each tuple owns its segment address. When a new tuple is created it either creates the segment it references or makes a copy of it. Likewise, when a give tuple is deleted, it always deletes the segment it owns.
|
Make it easier to declare Tuples. |
|
Simple accessor function for the tuple's begin index.
|
|
Copy a tuple.
|
|
Create a tuple from its components:.
|
|
Delete a borrowed tuple.
|
|
Delete an owned tuple.
|
|
Simple accessor function for the tuple's end index.
|
|
Initialize the tuple memory allocation routines. The defaults are the system malloc and free. If those are acceptable, use of this function is not necessary.
|
|
Simple accessor function for the tuple's length.
|
|
/brief Print out a tuple. This is used for understanding and debugging the view library and applications that use it. The tuple's elements and segment address are printed. /param tuple the tuple to print. /return void |
|
Simple accessor function for the tuple's segment address.
|
|
Get a pointer to the view-able piece of a segment.
|
|
Move the begin index to the right by N positions. The begin index is always moved even if N is larger than the sub-segment length. The reason this function behaves the way it does, is that it was meant to be used from a view method that is masking chunks of a view. The caller will want to mask N elements. And, won't really care how much each tuple has to mask. So, we mask as much as we can, if we can't mask all N elements with this one tuple, then we set ibegin == iend and return how much of N is still left to mask. Then, the caller can see there is more to do, and move on to the next tuple with the new (reduced) value of N. Note that the caller should most likely delete a tuple that returns a positive value.
|
|
Move the end index to the left by N positions. The end index is always moved even if N is larger than the sub-segment length.
|