51 INLINE
static SparseArray range(
int low_bit,
int size);
53 INLINE
static bool has_max_num_bits();
54 INLINE
static int get_max_num_bits();
56 INLINE
int get_num_bits()
const;
57 INLINE
bool get_bit(
int index)
const;
58 INLINE
void set_bit(
int index);
59 INLINE
void clear_bit(
int index);
60 INLINE
void set_bit_to(
int index,
bool value);
61 INLINE
bool get_highest_bits()
const;
62 INLINE
bool is_zero()
const;
63 INLINE
bool is_all_on()
const;
65 INLINE
bool has_any_of(
int low_bit,
int size)
const;
66 INLINE
bool has_all_of(
int low_bit,
int size)
const;
67 INLINE
void set_range(
int low_bit,
int size);
68 INLINE
void clear_range(
int low_bit,
int size);
69 INLINE
void set_range_to(
bool value,
int low_bit,
int size);
71 int get_num_on_bits()
const;
72 int get_num_off_bits()
const;
74 int get_lowest_off_bit()
const;
76 int get_highest_off_bit()
const;
77 int get_next_higher_different_bit(
int low_bit)
const;
79 INLINE
void invert_in_place();
80 bool has_bits_in_common(
const SparseArray &other)
const;
83 void output(std::ostream &out)
const;
85 INLINE
bool operator == (
const SparseArray &other)
const;
86 INLINE
bool operator != (
const SparseArray &other)
const;
87 INLINE
bool operator < (
const SparseArray &other)
const;
103 operator << (
int shift)
const;
106 operator >> (
int shift)
const;
111 INLINE
void operator <<= (
int shift);
112 INLINE
void operator >>= (
int shift);
114 INLINE
bool is_inverse()
const;
115 INLINE
size_t get_num_subranges()
const;
116 INLINE
int get_subrange_begin(
size_t n)
const;
117 INLINE
int get_subrange_end(
size_t n)
const;
120 void do_add_range(
int begin,
int end);
121 void do_remove_range(
int begin,
int end);
122 bool do_has_any(
int begin,
int end)
const;
123 bool do_has_all(
int begin,
int end)
const;
127 void do_intersection_neg(
const SparseArray &other);
128 void do_shift(
int offset);
133 INLINE Subrange(
int begin,
int end);
134 INLINE
bool operator < (
const Subrange &other)
const;
151 static void init_type() {
161 INLINE std::ostream &
162 operator << (std::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...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
int get_lowest_on_bit(uint16_t x)
Returns the index of the lowest 1 bit in the word.
A dynamic array with an unlimited number of bits.
int get_highest_on_bit(uint16_t x)
Returns the index of the highest 1 bit in the word.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...