25 #ifndef _ASN1CBITSTR_H_ 26 #define _ASN1CBITSTR_H_ 47 #ifndef _NO_UTILS_CLASSES 57 virtual OSUINT32 getValue ()
const = 0;
58 virtual int setValue (OSUINT32 value) = 0;
75 virtual OSUINT32 getValue ()
const {
return mSize; }
76 virtual int setValue (OSUINT32 value);
98 virtual OSUINT32 getValue ()
const {
return mSize; }
99 virtual int setValue (OSUINT32 value);
121 virtual OSUINT32 getValue ()
const {
return mSize; }
122 virtual int setValue (OSUINT32 value);
148 OSUINT32 mMaxNumBits;
151 OSUINT32 mUnitsAllocated;
155 OSOCTET* allocateMemory (OSUINT32 sz);
156 OSOCTET* reallocateMemory
157 (OSOCTET* old, OSUINT32 oldBufSz, OSUINT32 newBufSz);
158 void freeMemory (OSOCTET* mem);
165 void recalculateUnitsUsed();
171 int checkCapacity (OSUINT32 unitsRequired);
177 OSOCTET getBits (OSUINT32 j);
179 void privateInit (OSUINT32 nbits);
180 void privateInit (OSOCTET* bitStr, OSUINT32 maxNumbits_);
188 EXTRTMETHOD
ASN1CBitStr (OSRTMessageBufferIF& msgBuf);
194 EXTRTMETHOD ASN1CBitStr();
211 EXTRTMETHOD ASN1CBitStr
212 (OSOCTET* pBits, OSUINT32& numbits, OSUINT32 maxNumbits);
214 EXTRTMETHOD ASN1CBitStr
215 (OSOCTET* pBits, OSUINT8& numbits, OSUINT32 maxNumbits);
217 EXTRTMETHOD ASN1CBitStr
218 (OSOCTET* pBits, OSUINT16& numbits, OSUINT32 maxNumbits);
221 EXTRTMETHOD ASN1CBitStr (OSOCTET* pBits, OSUINT32 maxNumbits);
231 void initBase (OSOCTET* pBits, OSUINT32 numbits, OSUINT32 maxNumbits);
233 EXTRTMETHOD
void init
234 (OSOCTET* pBits, OSUINT32& numbits, OSUINT32 maxNumbits);
236 EXTRTMETHOD
void init
237 (OSOCTET* pBits, OSUINT8& numbits, OSUINT32 maxNumbits);
239 EXTRTMETHOD
void init
240 (OSOCTET* pBits, OSUINT16& numbits, OSUINT32 maxNumbits);
254 EXTRTMETHOD ASN1CBitStr (OSRTMessageBufferIF& msgbuf, OSUINT32 nbits);
267 EXTRTMETHOD ASN1CBitStr
268 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
269 OSUINT32& numbits, OSUINT32 maxNumbits_);
271 EXTRTMETHOD ASN1CBitStr
272 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
273 OSUINT8& numbits, OSUINT32 maxNumbits_);
275 EXTRTMETHOD ASN1CBitStr
276 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
277 OSUINT16& numbits, OSUINT32 maxNumbits_);
279 EXTRTMETHOD ASN1CBitStr
280 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr, OSUINT32 maxNumbits_);
287 EXTRTMETHOD ASN1CBitStr
294 EXTRTMETHOD ASN1CBitStr (
OSRTContext& ctxt, OSUINT32 nbits);
303 EXTRTMETHOD ASN1CBitStr
305 OSUINT32& octsNumbits, OSUINT32 maxNumbits_);
307 EXTRTMETHOD ASN1CBitStr
309 OSUINT8& octsNumbits, OSUINT32 maxNumbits_);
311 EXTRTMETHOD ASN1CBitStr
313 OSUINT16& octsNumbits, OSUINT32 maxNumbits_);
315 EXTRTMETHOD ASN1CBitStr
316 (
OSRTContext& ctxt, OSOCTET* bitStr, OSUINT32 maxNumbits_);
328 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr);
333 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr, OSBOOL extendable);
336 EXTRTMETHOD ~ASN1CBitStr();
356 EXTRTMETHOD
int set (OSUINT32 bitIndex);
383 EXTRTMETHOD
int set (OSUINT32 fromIndex, OSUINT32 toIndex);
400 inline int change (OSUINT32 bitIndex, OSBOOL value) {
401 return (value) ?
set (bitIndex) : clear (bitIndex);
423 EXTRTMETHOD
int clear (OSUINT32 bitIndex);
450 EXTRTMETHOD
int clear (OSUINT32 fromIndex, OSUINT32 toIndex);
463 EXTRTMETHOD
void clear();
488 EXTRTMETHOD
int invert (OSUINT32 bitIndex);
519 EXTRTMETHOD
int invert(OSUINT32 fromIndex, OSUINT32 toIndex);
535 EXTRTMETHOD OSBOOL
get(OSUINT32 bitIndex);
545 inline OSBOOL
isSet(OSUINT32 bitIndex) {
return get(bitIndex); }
559 inline OSBOOL
isEmpty() {
return (mUnitsUsed == 0); }
573 EXTRTMETHOD OSUINT32 size()
const;
591 EXTRTMETHOD OSUINT32 length()
const;
606 EXTRTMETHOD OSUINT32 cardinality()
const;
624 EXTRTMETHOD
int getBytes (OSOCTET* pBuf, OSUINT32 bufSz);
652 (OSUINT32 fromIndex, OSUINT32 toIndex, OSOCTET* pBuf, OSUINT32 bufSz);
671 EXTRTMETHOD
int doAnd (
const OSOCTET* pOctstr, OSUINT32 octsNumbits);
685 return doAnd(bitStr.data, bitStr.numbits);
698 inline int doAnd(
const ASN1CBitStr& bitStr) {
699 return doAnd(*bitStr.mpUnits, bitStr.
length());
719 EXTRTMETHOD
int doOr(
const OSOCTET* pOctstr, OSUINT32 octsNumbits);
733 return doOr(bitStr.data, bitStr.numbits);
746 inline int doOr(
const ASN1CBitStr& bitStr) {
747 return doOr(*bitStr.mpUnits, bitStr.
length());
766 EXTRTMETHOD
int doXor(
const OSOCTET* pOctstr, OSUINT32 octsNumbits);
780 return doXor(bitStr.data, bitStr.numbits);
793 inline int doXor(
const ASN1CBitStr& bitStr) {
794 return doXor(*bitStr.mpUnits, bitStr.
length());
820 EXTRTMETHOD
int doAndNot(
const OSOCTET* pOctstr, OSUINT32 octsNumbits);
837 return doAndNot(bitStr.data, bitStr.numbits);
854 return doAndNot(*bitStr.mpUnits, bitStr.
length());
873 EXTRTMETHOD
int shiftLeft(OSUINT32 shift);
891 EXTRTMETHOD
int shiftRight(OSUINT32 shift);
902 EXTRTMETHOD OSUINT32 unusedBitsInLastUnit();
934 EXTRTMETHOD
operator ASN1TDynBitStr*();
937 typedef class _ASN1CBitStr :
public ASN1CType {
939 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSUINT32 nbits) :
942 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSOCTET* bitStr,
943 OSUINT32& octsNumbits, OSUINT32 maxNumbits_) :
946 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf,
ASN1TDynBitStr& bitStr) :
949 #endif // _NO_UTILS_CLASSES 950 #endif // _ASN1CBITSTR_H_ EXTRTMETHOD OSUINT32 length() const
int doXor(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:793
int doOr(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:732
int doAndNot(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:853
int doAnd(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:698
int change(OSUINT32 bitIndex, OSBOOL value)
Definition: ASN1CBitStr.h:400
Definition: asn1CppTypes.h:314
int doXor(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:779
OSBOOL isSet(OSUINT32 bitIndex)
Definition: ASN1CBitStr.h:545
Definition: ASN1CBitStr.h:54
int doOr(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:746
Definition: asn1CppTypes.h:624
Definition: ASN1CBitStr.h:66
Definition: ASN1CBitStr.h:112
Definition: OSRTContext.h:65
Definition: ASN1CBitStr.h:141
int doAnd(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:684
int doAndNot(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:836
Definition: ASN1CBitStr.h:89
OSBOOL isEmpty()
Definition: ASN1CBitStr.h:559