Panda3D
Public Member Functions | List of all members
InternalNameCollection Class Reference

Public Member Functions

 InternalNameCollection (const InternalNameCollection &copy)
 
void add_name (const InternalName *name)
 Adds a new InternalName to the collection. More...
 
void add_names_from (const InternalNameCollection &other)
 Adds all the InternalNames indicated in the other collection to this name. More...
 
void clear ()
 Removes all InternalNames from the collection. More...
 
const InternalName * get_name (int index) const
 Returns the nth InternalName in the collection. More...
 
int get_num_names () const
 Returns the number of InternalNames in the collection. More...
 
bool has_name (const InternalName *name) const
 Returns true if the indicated InternalName appears in this collection, false otherwise. More...
 
 MAKE_SEQ (get_names, get_num_names, get_name)
 
InternalNameCollection operator+ (const InternalNameCollection &other) const
 Returns a InternalNameCollection representing the concatenation of the two lists. More...
 
void operator+= (const InternalNameCollection &other)
 Appends the other list onto the end of this one. More...
 
void operator= (const InternalNameCollection &copy)
 
const InternalName * operator[] (int index) const
 Returns the nth InternalName in the collection. More...
 
void output (ostream &out) const
 Writes a brief one-line description of the InternalNameCollection to the indicated output stream. More...
 
void remove_duplicate_names ()
 Removes any duplicate entries of the same InternalNames on this collection. More...
 
bool remove_name (const InternalName *name)
 Removes the indicated InternalName from the collection. More...
 
void remove_names_from (const InternalNameCollection &other)
 Removes from this collection all of the InternalNames listed in the other collection. More...
 
int size () const
 Returns the number of names in the collection. More...
 
void write (ostream &out, int indent_level=0) const
 Writes a complete multi-line description of the InternalNameCollection to the indicated output stream. More...
 

Detailed Description

Definition at line 26 of file internalNameCollection.h.

Member Function Documentation

◆ add_name()

void InternalNameCollection::add_name ( const InternalName *  name)

Adds a new InternalName to the collection.

Definition at line 55 of file internalNameCollection.cxx.

References remove_name().

Referenced by NodePath::find_all_texcoords(), and NodePath::find_all_vertex_columns().

◆ add_names_from()

void InternalNameCollection::add_names_from ( const InternalNameCollection other)

Adds all the InternalNames indicated in the other collection to this name.

The other names are simply appended to the end of the names in this list; duplicates are not automatically removed.

Definition at line 115 of file internalNameCollection.cxx.

References get_name(), get_num_names(), and remove_names_from().

Referenced by operator+=(), and remove_name().

◆ clear()

void InternalNameCollection::clear ( )

Removes all InternalNames from the collection.

Definition at line 193 of file internalNameCollection.cxx.

References get_num_names().

Referenced by has_name().

◆ get_name()

const InternalName * InternalNameCollection::get_name ( int  index) const

Returns the nth InternalName in the collection.

Definition at line 213 of file internalNameCollection.cxx.

References operator[]().

Referenced by add_names_from(), and get_num_names().

◆ get_num_names()

int InternalNameCollection::get_num_names ( ) const

Returns the number of InternalNames in the collection.

Definition at line 203 of file internalNameCollection.cxx.

References get_name().

Referenced by add_names_from(), and clear().

◆ has_name()

bool InternalNameCollection::has_name ( const InternalName *  name) const

Returns true if the indicated InternalName appears in this collection, false otherwise.

Definition at line 178 of file internalNameCollection.cxx.

References clear().

Referenced by remove_duplicate_names(), and remove_names_from().

◆ operator+()

InternalNameCollection InternalNameCollection::operator+ ( const InternalNameCollection other) const
inline

Returns a InternalNameCollection representing the concatenation of the two lists.

Definition at line 42 of file internalNameCollection.I.

Referenced by operator+=().

◆ operator+=()

void InternalNameCollection::operator+= ( const InternalNameCollection other)
inline

Appends the other list onto the end of this one.

Definition at line 31 of file internalNameCollection.I.

References add_names_from(), and operator+().

◆ operator[]()

const InternalName * InternalNameCollection::operator[] ( int  index) const

Returns the nth InternalName in the collection.

This is the same as get_name(), but it may be a more convenient way to access it.

Definition at line 227 of file internalNameCollection.cxx.

References size().

Referenced by get_name().

◆ output()

void InternalNameCollection::output ( ostream &  out) const

Writes a brief one-line description of the InternalNameCollection to the indicated output stream.

Definition at line 251 of file internalNameCollection.cxx.

References write().

Referenced by size().

◆ remove_duplicate_names()

void InternalNameCollection::remove_duplicate_names ( )

Removes any duplicate entries of the same InternalNames on this collection.

If a InternalName appears multiple times, the first appearance is retained; subsequent appearances are removed.

Definition at line 151 of file internalNameCollection.cxx.

References has_name().

Referenced by remove_names_from().

◆ remove_name()

bool InternalNameCollection::remove_name ( const InternalName *  name)

Removes the indicated InternalName from the collection.

Returns true if the name was removed, false if it was not a member of the collection.

Definition at line 78 of file internalNameCollection.cxx.

References add_names_from().

Referenced by add_name().

◆ remove_names_from()

void InternalNameCollection::remove_names_from ( const InternalNameCollection other)

Removes from this collection all of the InternalNames listed in the other collection.

Definition at line 130 of file internalNameCollection.cxx.

References has_name(), and remove_duplicate_names().

Referenced by add_names_from().

◆ size()

int InternalNameCollection::size ( ) const

Returns the number of names in the collection.

This is the same thing as get_num_names().

Definition at line 240 of file internalNameCollection.cxx.

References output().

Referenced by operator[]().

◆ write()

void InternalNameCollection::write ( ostream &  out,
int  indent_level = 0 
) const

Writes a complete multi-line description of the InternalNameCollection to the indicated output stream.

Definition at line 266 of file internalNameCollection.cxx.

Referenced by output().


The documentation for this class was generated from the following files: