*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ifl/iflBitArray (3)              
Title
Content
Arch
Section
 

Contents


iflBitArray(3)	  Image	Format Library C++ Reference Manual	iflBitArray(3)


NAME    [Toc]    [Back]

     iflBitArray - limited subscriptable bit array class

INHERITS FROM    [Toc]    [Back]

     none, standalone object

HEADER FILE    [Toc]    [Back]

     #include <ifl/iflBitArray.h>

CLASS DESCRIPTION    [Toc]    [Back]

     This class	implements a very limited functionality	subscriptable bit
     array that	is used	by the image data type converter (iflConverter).  The
     constructor requires a void* initializer, so a form such as

	  int from[1024], to[1024];
	  iflBitArray f	= from,	t = to;

     declares bit "pointers" referencing the int arrays.  The bit array	can
     then be accessed with contructs of	the form

	  floatVal = (float)f[i];


     and deposits made with statements such as

	  t[i] = floatVal;    // no cast needed

CLASS MEMBER FUNCTION SUMMARY    [Toc]    [Back]

     Constructor

	  iflBitArray(void* dp)


     Subscripted access    [Toc]    [Back]

	  iflBitArray& operator[](int idx)
	  void operator=(long rhs)
	  operator long()

FUNCTION DESCRIPTIONS    [Toc]    [Back]

     iflBitArray()

	  iflBitArray(void* dp)


	  Constructs a bit "pointer" that accesses the bit array pointed to by
	  dp.  Use the subscript operator to access elements of	the array off
	  this pseudo-pointer on either	the left-hand or right-hand side of an
	  assignment.




									Page 1






iflBitArray(3)	  Image	Format Library C++ Reference Manual	iflBitArray(3)



     operator[]

	  iflBitArray& operator[](int idx)


	  The subscript	operator stores	the byte and bit offsets needed	to
	  access the element specified by idx. This function returns a selfreference
 so the real	work can be done with the cast and assigment
	  operators for	this class.  It	works with certain restrictions	noted
	  below.

     operator=

	  void operator=(long rhs)


	  The assignment operator clears or sets the bit pointed to by the
	  left-hand side of the	assigment.  The	bit is set if rhs is nonzero,
	  otherwise it is cleared.  By only allowing a long for	the right-hand
	  side,	a bit subscript	on the right is	automatically extracted	by
	  going	through	the cast operator.  C++	converts other types such as
	  float	and short to long without complaining.

     operator long

	  operator long()


	  The cast operator extracts the (previously remembered) subscripted
	  bit.	Again, C++ fills in all	the other type conversions.

NOTES    [Toc]    [Back]

     Due to limitations	of the implementation, the same	bit "pointer" must not
     occur twice in the	same assignment	(with different	subscripts):

	  t[i] = ~(long)t[j];  // bogus	result (depends	on order of evaluation)
	  t[i] = f[j];	 // ok even if 't' and 'f' point to same data array


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
ratecheck OpenBSD function to help implement rate-limited actions
ppsratecheck OpenBSD function to help implement rate-limited actions
ppsratecheck NetBSD function to help implement rate-limited actions
ratecheck NetBSD function to help implement rate-limited actions
unpack IRIX Unpacks an array of rank one into an array under control of a mask
class_index_to_name Tru64 gets the class name given the class index
qsort Linux sorts an array
arrayd IRIX array services daemon
arrayconfig IRIX configure a simple array
setash IRIX set array session handle
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service