18 #include "pandabase.h" 19 #include "ordered_vector.h" 52 INLINE SparseArray(
const SparseArray ©);
53 INLINE SparseArray &operator = (
const SparseArray ©);
56 INLINE
static SparseArray all_on();
57 INLINE
static SparseArray all_off();
58 INLINE
static SparseArray lower_on(
int on_bits);
59 INLINE
static SparseArray bit(
int index);
60 INLINE
static SparseArray range(
int low_bit,
int size);
62 INLINE ~SparseArray();
64 INLINE
static bool has_max_num_bits();
65 INLINE
static int get_max_num_bits();
67 INLINE
int get_num_bits()
const;
68 INLINE
bool get_bit(
int index)
const;
69 INLINE
void set_bit(
int index);
70 INLINE
void clear_bit(
int index);
71 INLINE
void set_bit_to(
int index,
bool value);
72 INLINE
bool get_highest_bits()
const;
73 INLINE
bool is_zero()
const;
74 INLINE
bool is_all_on()
const;
76 INLINE
bool has_any_of(
int low_bit,
int size)
const;
77 INLINE
bool has_all_of(
int low_bit,
int size)
const;
78 INLINE
void set_range(
int low_bit,
int size);
79 INLINE
void clear_range(
int low_bit,
int size);
80 INLINE
void set_range_to(
bool value,
int low_bit,
int size);
82 int get_num_on_bits()
const;
83 int get_num_off_bits()
const;
84 int get_lowest_on_bit()
const;
85 int get_lowest_off_bit()
const;
86 int get_highest_on_bit()
const;
87 int get_highest_off_bit()
const;
88 int get_next_higher_different_bit(
int low_bit)
const;
90 INLINE
void invert_in_place();
91 bool has_bits_in_common(
const SparseArray &other)
const;
94 void output(ostream &out)
const;
96 INLINE
bool operator == (
const SparseArray &other)
const;
97 INLINE
bool operator != (
const SparseArray &other)
const;
98 INLINE
bool operator < (
const SparseArray &other)
const;
99 int compare_to(
const SparseArray &other)
const;
102 operator & (
const SparseArray &other)
const;
105 operator | (
const SparseArray &other)
const;
108 operator ^ (
const SparseArray &other)
const;
114 operator << (
int shift)
const;
117 operator >> (
int shift)
const;
119 void operator &= (
const SparseArray &other);
120 void operator |= (
const SparseArray &other);
121 void operator ^= (
const SparseArray &other);
122 INLINE
void operator <<= (
int shift);
123 INLINE
void operator >>= (
int shift);
125 INLINE
bool is_inverse()
const;
126 INLINE
int get_num_subranges()
const;
127 INLINE
int get_subrange_begin(
int n)
const;
128 INLINE
int get_subrange_end(
int n)
const;
131 void do_add_range(
int begin,
int end);
132 void do_remove_range(
int begin,
int end);
133 bool do_has_any(
int begin,
int end)
const;
134 bool do_has_all(
int begin,
int end)
const;
136 void do_intersection(
const SparseArray &other);
137 void do_union(
const SparseArray &other);
138 void do_intersection_neg(
const SparseArray &other);
139 void do_shift(
int offset);
145 INLINE Subrange(
int begin,
int end);
146 INLINE
bool operator < (
const Subrange &other)
const;
152 Subranges _subranges;
163 static void init_type() {
164 register_type(_type_handle,
"SparseArray");
171 #include "sparseArray.I" 174 operator << (ostream &out,
const SparseArray &array) {
This class records a set of integers, where each integer is either present or not present in the set...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A dynamic array with an unlimited number of bits.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...