MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bitMask.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: bitMask.h,v $ $Revision: 1.4 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtBitMask_H_
13 #define DtBitMask_H_
14 
15 #include <vlutil/vlMachineTypes.h>
16 #include <rtiMsConfig.h>
17 
18 //
25 {
26 public:
28  DtBitMask( unsigned int length );
29 
32  DtBitMask( const char* bitMask, unsigned int length );
33 
35  DtBitMask( const DtBitMask& orig );
36 
38  virtual ~DtBitMask();
39 
41  virtual const DtBitMask& operator=( const DtBitMask& orig );
42 
44  virtual const DtBitMask& operator&=( const DtBitMask& orig );
45 
47  virtual const DtBitMask& operator|=( const DtBitMask& orig );
48 
50  virtual inline unsigned int length() const;
51 
53  virtual bool isEmpty() const;
54 
56  virtual unsigned int numSet() const;
57 
59  virtual void reset(bool value=false);
60 
62  virtual void setBit( unsigned int bitPosition, bool isOn = true );
63 
65  virtual bool getBit( unsigned int bitPosition ) const;
66 
68  virtual unsigned int netSize() const;
69 
72  virtual void encode( char* buffer ) const;
73 
75  virtual void decode(const char* buffer, unsigned int numBytes);
76 
79  virtual void print(bool listHandles=false) const;
80 
81 public:
82 
84  static unsigned int lengthToWords( unsigned int length );
85 
87  static unsigned int lengthToChars( unsigned int length );
88 
89 protected:
90 
92 
94  MAKRti::DtU32* myBitField;
95 
97  unsigned int myLength;
98 
99 };
100 
101 
103 DtBitMask DT_DLL_RTIUTIL operator&( const DtBitMask& first, const DtBitMask& second );
104 DtBitMask DT_DLL_RTIUTIL operator|( const DtBitMask& first, const DtBitMask& second );
105 
106 
107 inline unsigned int DtBitMask::length() const
108 {
109  return myLength;
110 }
111 
112 #endif
113 
DtBitMask DT_DLL_RTIUTIL operator|(const DtBitMask &first, const DtBitMask &second)
virtual unsigned int length() const
Get number of data bits in field ( does not include padding )
Definition: bitMask.h:107
unsigned int myLength
The number of bits represented.
Definition: bitMask.h:97
DtBitMask DT_DLL_RTIUTIL operator&(const DtBitMask &first, const DtBitMask &second)
Bitwise AND and OR operators for DtBitMasks.
DtBitMask represents a variable length bit-field which may be used to represent an array of boolean d...
Definition: bitMask.h:24
MAKRti::DtU32 * myBitField
Data Members.
Definition: bitMask.h:94
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:127

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)