Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PaletteGroups Class Reference

A set of PaletteGroups. More...

#include <paletteGroups.h>

Inheritance diagram for PaletteGroups:

TypedWritable TypedObject List of all members.

Public Types

typedef Groups::const_pointer pointer
typedef Groups::const_pointer const_pointer
typedef Groups::const_reference reference
typedef Groups::const_reference const_reference
typedef Groups::const_iterator iterator
typedef Groups::const_iterator const_iterator
typedef Groups::const_reverse_iterator reverse_iterator
typedef Groups::const_reverse_iterator const_reverse_iterator
typedef Groups::size_type size_type
typedef Groups::difference_type difference_type

Public Member Functions

 PaletteGroups ()
void insert (PaletteGroup *group)
 Inserts a new group to the set, if it is not already there.

size_type count (PaletteGroup *group) const
 Returns the number of times the given group appears in the set.

void make_complete (const PaletteGroups &a)
 Completes the set with the transitive closure of all dependencies: for each PaletteGroup already in the set a, all of the groups that it depends on are added to the set, and so on.

void make_union (const PaletteGroups &a, const PaletteGroups &b)
 Computes the union of PaletteGroups a and b, and stores the result in this object.

void make_intersection (const PaletteGroups &a, const PaletteGroups &b)
 Computes the intersection of PaletteGroups a and b, and stores the result in this object.

void clear ()
 Empties the set.

bool empty () const
 Returns true if the set is empty, false otherwise.

size_type size () const
 Returns the number of elements in the set.

iterator begin () const
 Returns an iterator suitable for traversing the set.

iterator end () const
 Returns an iterator suitable for traversing the set.

void output (ostream &out) const
void write (ostream &out, int indent_level=0) const
virtual void write_datagram (BamWriter *writer, Datagram &datagram)
 Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.

virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.

void fillin (DatagramIterator &scan, BamReader *manager)
 Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().

virtual TypeHandle get_type () const
virtual void finalize ()
virtual TypeHandle force_init_type (void)
int get_type_index () const
bool is_of_type (TypeHandle handle) const
bool is_exact_type (TypeHandle handle) const

Static Public Member Functions

void register_with_read_factory ()
 Registers the current object as something that can be read from a Bam file.

TypeHandle get_class_type ()
void init_type ()

Static Public Attributes

TypedWritable *const Null

Static Protected Member Functions

TypedWritablemake_PaletteGroups (const FactoryParams &params)
 This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read.


Private Types

typedef pset< PaletteGroup * > Groups

Private Member Functions

void r_make_complete (Groups &result, PaletteGroup *group)
 The recursive implementation of make_complete(), this adds the indicated group and all of its dependencies to the set.


Private Attributes

Groups _groups
int _num_groups

Static Private Attributes

TypeHandle _type_handle

Detailed Description

A set of PaletteGroups.

This presents an interface very like an STL set, with a few additional functions.

Definition at line 43 of file paletteGroups.h.


Member Typedef Documentation

typedef Groups::const_iterator PaletteGroups::const_iterator
 

Definition at line 55 of file paletteGroups.h.

typedef Groups::const_pointer PaletteGroups::const_pointer
 

Definition at line 50 of file paletteGroups.h.

typedef Groups::const_reference PaletteGroups::const_reference
 

Definition at line 53 of file paletteGroups.h.

typedef Groups::const_reverse_iterator PaletteGroups::const_reverse_iterator
 

Definition at line 57 of file paletteGroups.h.

typedef Groups::difference_type PaletteGroups::difference_type
 

Definition at line 59 of file paletteGroups.h.

typedef pset<PaletteGroup *> PaletteGroups::Groups [private]
 

Definition at line 45 of file paletteGroups.h.

typedef Groups::const_iterator PaletteGroups::iterator
 

Definition at line 54 of file paletteGroups.h.

Referenced by clear(), PaletteGroup::get_placements(), and PaletteGroup::group_with().

typedef Groups::const_pointer PaletteGroups::pointer
 

Definition at line 49 of file paletteGroups.h.

typedef Groups::const_reference PaletteGroups::reference
 

Definition at line 52 of file paletteGroups.h.

typedef Groups::const_reverse_iterator PaletteGroups::reverse_iterator
 

Definition at line 56 of file paletteGroups.h.

typedef Groups::size_type PaletteGroups::size_type
 

Definition at line 58 of file paletteGroups.h.

Referenced by insert().


Constructor & Destructor Documentation

PaletteGroups::PaletteGroups  ) 
 

Definition at line 43 of file paletteGroups.cxx.

References _groups.


Member Function Documentation

PaletteGroups::iterator PaletteGroups::begin  )  const
 

Returns an iterator suitable for traversing the set.

Definition at line 240 of file paletteGroups.cxx.

References _groups.

Referenced by PaletteGroup::get_placements(), and PaletteGroup::group_with().

void PaletteGroups::clear void   ) 
 

Empties the set.

Definition at line 201 of file paletteGroups.cxx.

References _groups, and iterator.

Referenced by EggFile::clear_surprise(), EggFile::get_textures(), and PaletteGroup::has_dirname().

int PaletteGroups::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual]
 

Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.

The return value is the number of pointers processed from the list.

Reimplemented from TypedWritable.

Definition at line 394 of file paletteGroups.cxx.

Referenced by EggFile::write_description().

PaletteGroups::size_type PaletteGroups::count PaletteGroup group  )  const
 

Returns the number of times the given group appears in the set.

This is either 1 if it appears at all, or 0 if it does not appear.

Definition at line 74 of file paletteGroups.cxx.

References _groups, and r_make_complete().

Referenced by EggFile::is_stale().

bool PaletteGroups::empty  )  const
 

Returns true if the set is empty, false otherwise.

Definition at line 214 of file paletteGroups.cxx.

References _groups.

Referenced by TextureImage::note_egg_file(), and EggFile::update_egg().

PaletteGroups::iterator PaletteGroups::end  )  const
 

Returns an iterator suitable for traversing the set.

Definition at line 253 of file paletteGroups.cxx.

Referenced by PaletteGroup::get_placements(), and PaletteGroup::group_with().

void PaletteGroups::fillin DatagramIterator scan,
BamReader manager
 

Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().

Reimplemented from TypedWritable.

Definition at line 442 of file paletteGroups.cxx.

TypeHandle PaletteGroups::get_class_type void   )  [inline, static]
 

Reimplemented from TypedWritable.

Definition at line 102 of file paletteGroups.h.

virtual TypeHandle PaletteGroups::get_type void   )  const [inline, virtual]
 

Reimplemented from TypedWritable.

Definition at line 110 of file paletteGroups.h.

References INLINE, ostream, and output().

void PaletteGroups::init_type void   )  [inline, static]
 

Reimplemented from TypedWritable.

Definition at line 105 of file paletteGroups.h.

References _type_handle.

void PaletteGroups::insert PaletteGroup group  ) 
 

Inserts a new group to the set, if it is not already there.

Definition at line 57 of file paletteGroups.cxx.

References _groups, and size_type.

Referenced by EggFile::clear_surprise(), and PaletteGroup::get_dirname().

void PaletteGroups::make_complete const PaletteGroups &  a  ) 
 

Completes the set with the transitive closure of all dependencies: for each PaletteGroup already in the set a, all of the groups that it depends on are added to the set, and so on.

The indicated set a may be the same as this set.

Definition at line 95 of file paletteGroups.cxx.

Referenced by EggFile::clear_surprise(), and PaletteGroup::group_with().

void PaletteGroups::make_intersection const PaletteGroups &  a,
const PaletteGroups &  b
 

Computes the intersection of PaletteGroups a and b, and stores the result in this object.

The result may be the same object as either a or b.

Definition at line 168 of file paletteGroups.cxx.

References _groups.

Referenced by EggFile::is_stale().

TypedWritable * PaletteGroups::make_PaletteGroups const FactoryParams params  )  [static, protected]
 

This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read.

Definition at line 419 of file paletteGroups.cxx.

void PaletteGroups::make_union const PaletteGroups &  a,
const PaletteGroups &  b
 

Computes the union of PaletteGroups a and b, and stores the result in this object.

The result may be the same object as either a or b.

Definition at line 119 of file paletteGroups.cxx.

Referenced by EggFile::get_textures().

void PaletteGroups::output ostream &  out  )  const
 

Definition at line 265 of file paletteGroups.cxx.

References PaletteGroup::_dependent, _groups, and r_make_complete().

Referenced by get_type().

void PaletteGroups::r_make_complete PaletteGroups::Groups result,
PaletteGroup group
[private]
 

The recursive implementation of make_complete(), this adds the indicated group and all of its dependencies to the set.

Definition at line 325 of file paletteGroups.cxx.

References _groups, _num_groups, and DCAST_INTO_R.

Referenced by count(), and output().

void PaletteGroups::register_with_read_factory void   )  [static]
 

Registers the current object as something that can be read from a Bam file.

Definition at line 349 of file paletteGroups.cxx.

PaletteGroups::size_type PaletteGroups::size  )  const
 

Returns the number of elements in the set.

Definition at line 227 of file paletteGroups.cxx.

void PaletteGroups::write ostream &  out,
int  indent_level = 0
const
 

Definition at line 295 of file paletteGroups.cxx.

References _groups, Datagram::add_uint32(), TypedWritable::write_datagram(), and writer().

Referenced by EggFile::build_cross_links().

void PaletteGroups::write_datagram BamWriter writer,
Datagram datagram
[virtual]
 

Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.

Reimplemented from TypedWritable.

Definition at line 367 of file paletteGroups.cxx.


Member Data Documentation

Groups PaletteGroups::_groups [private]
 

Definition at line 81 of file paletteGroups.h.

Referenced by begin(), clear(), count(), empty(), insert(), make_intersection(), output(), PaletteGroups(), r_make_complete(), and write().

int PaletteGroups::_num_groups [private]
 

Definition at line 99 of file paletteGroups.h.

Referenced by r_make_complete().

TypeHandle PaletteGroups::_type_handle [static, private]
 

Reimplemented from TypedWritable.

Definition at line 33 of file paletteGroups.cxx.

Referenced by init_type().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:44 2003 for Panda-Tool by doxygen1.3