MAK RTIspy API Documentation for HLA 1516
bitMask.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1998 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: bitMask.h,v $ $Revision: 1.4 $ $State: Exp $
00007 *********************************************************************/
00008 
00011 
00012 #ifndef DtBitMask_H_
00013 #define DtBitMask_H_
00014 
00015 #include <vlutil/vlMachineTypes.h>
00016 #include <rtiMsConfig.h>
00017 
00018 //
00024 class DT_DLL_RTIUTIL DtBitMask
00025 {
00026 public:
00028    DtBitMask( unsigned int length );
00029 
00032    DtBitMask( const char* bitMask, unsigned int length );
00033 
00035    DtBitMask( const DtBitMask& orig );
00036 
00038    virtual ~DtBitMask();
00039    
00041    virtual const DtBitMask& operator=( const DtBitMask& orig );
00042 
00044    virtual const DtBitMask& operator&=( const DtBitMask& orig );
00045 
00047    virtual const DtBitMask& operator|=( const DtBitMask& orig );
00048    
00050    virtual inline unsigned int length() const;
00051 
00053    virtual bool isEmpty() const;
00054 
00056    virtual unsigned int numSet() const;
00057    
00059    virtual void reset(bool value=false);
00060 
00062    virtual void setBit( unsigned int bitPosition, bool isOn = true );
00063 
00065    virtual bool getBit( unsigned int bitPosition ) const;
00066 
00068    virtual unsigned int netSize() const;
00069    
00072    virtual void encode( char* buffer ) const;
00073 
00075    virtual void decode(const char* buffer, unsigned int numBytes);
00076 
00079    virtual void print(bool listHandles=false) const;
00080 
00081 public:
00082 
00084    static unsigned int lengthToWords( unsigned int length );
00085 
00087    static unsigned int lengthToChars( unsigned int length );
00088    
00089 protected:
00090 
00092 
00094    MAKRti::DtU32* myBitField;
00095 
00097    unsigned int myLength;
00098    
00099 };
00100 
00101 
00103 DtBitMask DT_DLL_RTIUTIL operator&( const DtBitMask& first, const DtBitMask& second );
00104 DtBitMask DT_DLL_RTIUTIL operator|( const DtBitMask& first, const DtBitMask& second );
00105 
00106 
00107 inline unsigned int DtBitMask::length() const
00108 {
00109    return myLength;
00110 }
00111 
00112 #endif //! DtBitMask_H_
00113 

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)